bare-script 5.1.7__tar.gz → 5.1.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {bare_script-5.1.7/src/bare_script.egg-info → bare_script-5.1.8}/PKG-INFO +1 -1
  2. {bare_script-5.1.7 → bare_script-5.1.8}/pyproject.toml +1 -1
  3. {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/bare.py +2 -12
  4. {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/include.py +1 -9
  5. {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/include_source.py +1554 -1633
  6. {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/library.py +23 -68
  7. {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/options.py +8 -13
  8. {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/runtime.py +145 -119
  9. {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/value.py +42 -62
  10. {bare_script-5.1.7 → bare_script-5.1.8/src/bare_script.egg-info}/PKG-INFO +1 -1
  11. {bare_script-5.1.7 → bare_script-5.1.8}/LICENSE +0 -0
  12. {bare_script-5.1.7 → bare_script-5.1.8}/README.md +0 -0
  13. {bare_script-5.1.7 → bare_script-5.1.8}/setup.cfg +0 -0
  14. {bare_script-5.1.7 → bare_script-5.1.8}/setup.py +0 -0
  15. {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/__init__.py +0 -0
  16. {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/__main__.py +0 -0
  17. {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/runtime_c.c +0 -0
  18. {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script.egg-info/SOURCES.txt +0 -0
  19. {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script.egg-info/dependency_links.txt +0 -0
  20. {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script.egg-info/entry_points.txt +0 -0
  21. {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script.egg-info/requires.txt +0 -0
  22. {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bare-script
3
- Version: 5.1.7
3
+ Version: 5.1.8
4
4
  Summary: BareScript; a lightweight scripting and expression language
5
5
  Author-email: "Craig A. Hobbs" <craigahobbs@gmail.com>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "bare-script"
7
- version = "5.1.7"
7
+ version = "5.1.8"
8
8
  description = "BareScript; a lightweight scripting and expression language"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -7,20 +7,13 @@ bare-script command-line interface (CLI)
7
7
 
8
8
  import argparse
9
9
  from functools import partial
10
- import os
11
10
  import sys
12
11
  import time
13
12
 
13
+ from . import evaluate_expression, execute_script
14
14
  from .options import fetch_read_write, log_stdout, url_file_relative
15
15
  from .runtime import SYSTEM_GLOBAL_INCLUDES_NAME, barescript_lint_script, barescript_parse_expression, barescript_parse_script
16
16
  from .value import value_boolean
17
- if not os.environ.get('BARESCRIPT_RUNTIME_PY'): # pragma: no cover
18
- try:
19
- from .runtime_c import evaluate_expression, execute_script
20
- except ImportError:
21
- from .runtime import evaluate_expression, execute_script
22
- else:
23
- from .runtime import evaluate_expression, execute_script
24
17
 
25
18
 
26
19
  def main(argv=None):
@@ -33,6 +26,7 @@ def main(argv=None):
33
26
  if sys.version_info >= (3, 14): # pragma: no cover
34
27
  argument_parser_args['color'] = False
35
28
  parser = argparse.ArgumentParser(**argument_parser_args)
29
+ parser.set_defaults(scripts=[])
36
30
  parser.add_argument('file', nargs='*', action=_FileScriptAction, help='files to process')
37
31
  parser.add_argument('-c', '--code', action=_InlineScriptAction, help='execute the BareScript code')
38
32
  parser.add_argument('-d', '--debug', action='store_true', help='enable debug mode')
@@ -159,13 +153,9 @@ def main(argv=None):
159
153
 
160
154
  class _InlineScriptAction(argparse.Action):
161
155
  def __call__(self, parser, namespace, values, option_string=None):
162
- if 'scripts' not in namespace:
163
- setattr(namespace, 'scripts', [])
164
156
  namespace.scripts.append(('code', values))
165
157
 
166
158
 
167
159
  class _FileScriptAction(argparse.Action):
168
160
  def __call__(self, parser, namespace, values, option_string=None):
169
- if 'scripts' not in namespace:
170
- setattr(namespace, 'scripts', [])
171
161
  namespace.scripts.extend(('file', value) for value in values)
@@ -5,15 +5,7 @@
5
5
  Include library script globals and native stub functions
6
6
  """
7
7
 
8
- import os
9
-
10
- if not os.environ.get('BARESCRIPT_RUNTIME_PY'): # pragma: no cover
11
- try:
12
- from .runtime_c import execute_script
13
- except ImportError:
14
- from .runtime import execute_script
15
- else:
16
- from .runtime import execute_script
8
+ from . import execute_script
17
9
 
18
10
 
19
11
  # The include library script globals - execute the include library script