bare-script 5.1.5__tar.gz → 5.1.7__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.5/src/bare_script.egg-info → bare_script-5.1.7}/PKG-INFO +12 -1
  2. {bare_script-5.1.5 → bare_script-5.1.7}/README.md +11 -0
  3. {bare_script-5.1.5 → bare_script-5.1.7}/pyproject.toml +1 -1
  4. {bare_script-5.1.5 → bare_script-5.1.7}/src/bare_script/include.py +23 -0
  5. {bare_script-5.1.5 → bare_script-5.1.7}/src/bare_script/include_source.py +771 -553
  6. {bare_script-5.1.5 → bare_script-5.1.7}/src/bare_script/runtime.py +25 -16
  7. {bare_script-5.1.5 → bare_script-5.1.7}/src/bare_script/runtime_c.c +26 -2
  8. {bare_script-5.1.5 → bare_script-5.1.7/src/bare_script.egg-info}/PKG-INFO +12 -1
  9. {bare_script-5.1.5 → bare_script-5.1.7}/LICENSE +0 -0
  10. {bare_script-5.1.5 → bare_script-5.1.7}/setup.cfg +0 -0
  11. {bare_script-5.1.5 → bare_script-5.1.7}/setup.py +0 -0
  12. {bare_script-5.1.5 → bare_script-5.1.7}/src/bare_script/__init__.py +0 -0
  13. {bare_script-5.1.5 → bare_script-5.1.7}/src/bare_script/__main__.py +0 -0
  14. {bare_script-5.1.5 → bare_script-5.1.7}/src/bare_script/bare.py +0 -0
  15. {bare_script-5.1.5 → bare_script-5.1.7}/src/bare_script/library.py +0 -0
  16. {bare_script-5.1.5 → bare_script-5.1.7}/src/bare_script/options.py +0 -0
  17. {bare_script-5.1.5 → bare_script-5.1.7}/src/bare_script/value.py +0 -0
  18. {bare_script-5.1.5 → bare_script-5.1.7}/src/bare_script.egg-info/SOURCES.txt +0 -0
  19. {bare_script-5.1.5 → bare_script-5.1.7}/src/bare_script.egg-info/dependency_links.txt +0 -0
  20. {bare_script-5.1.5 → bare_script-5.1.7}/src/bare_script.egg-info/entry_points.txt +0 -0
  21. {bare_script-5.1.5 → bare_script-5.1.7}/src/bare_script.egg-info/requires.txt +0 -0
  22. {bare_script-5.1.5 → bare_script-5.1.7}/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.5
3
+ Version: 5.1.7
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
@@ -296,6 +296,17 @@ builds. See the Performance section below for benchmark results comparing the C
296
296
  pure-Python runtime, and native Python.
297
297
 
298
298
 
299
+ ## Thread Safety
300
+
301
+ Both runtimes may be used from multiple threads, including on the free-threaded (no-GIL) Python
302
+ builds. Script models and a `globals` dict may be shared across threads once populated - for example,
303
+ execute a script that defines functions once, then call those functions concurrently. Each
304
+ concurrently executing thread must pass its own `options` dict to `execute_script`, since the runtime
305
+ records the running `statementCount` there. The parser, linter, and include library stubs initialize
306
+ lazily and are safe to call from any thread. As in Python, unsynchronized concurrent mutation of a
307
+ shared array or object from several threads has unspecified results but never crashes the runtime.
308
+
309
+
299
310
  ## Performance
300
311
 
301
312
  The `make perf` target benchmarks the BareScript runtime with a suite of compute-intensive tests —
@@ -270,6 +270,17 @@ builds. See the Performance section below for benchmark results comparing the C
270
270
  pure-Python runtime, and native Python.
271
271
 
272
272
 
273
+ ## Thread Safety
274
+
275
+ Both runtimes may be used from multiple threads, including on the free-threaded (no-GIL) Python
276
+ builds. Script models and a `globals` dict may be shared across threads once populated - for example,
277
+ execute a script that defines functions once, then call those functions concurrently. Each
278
+ concurrently executing thread must pass its own `options` dict to `execute_script`, since the runtime
279
+ records the running `statementCount` there. The parser, linter, and include library stubs initialize
280
+ lazily and are safe to call from any thread. As in Python, unsynchronized concurrent mutation of a
281
+ shared array or object from several threads has unspecified results but never crashes the runtime.
282
+
283
+
273
284
  ## Performance
274
285
 
275
286
  The `make perf` target benchmarks the BareScript runtime with a suite of compute-intensive tests —
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "bare-script"
7
- version = "5.1.5"
7
+ version = "5.1.7"
8
8
  description = "BareScript; a lightweight scripting and expression language"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -30,6 +30,7 @@ execute_script(
30
30
  {'url': 'markdown.bare', 'system': True},
31
31
  {'url': 'markdownElements.bare', 'system': True},
32
32
  {'url': 'markdownParser.bare', 'system': True},
33
+ {'url': 'markdownString.bare', 'system': True},
33
34
  {'url': 'qrcode.bare', 'system': True},
34
35
  {'url': 'schema.bare', 'system': True},
35
36
  {'url': 'schemaDoc.bare', 'system': True},
@@ -499,6 +500,28 @@ def markdown_parse(text):
499
500
  return _INCLUDE_GLOBALS['markdownParse']([text], _include_options())
500
501
 
501
502
 
503
+ #
504
+ # markdownString.bare
505
+ #
506
+
507
+
508
+ def markdown_to_string(markdown, wrap_width=None, ref_count=None):
509
+ """
510
+ Render a Markdown model as Markdown text
511
+
512
+ :param dict markdown: The Markdown model
513
+ :param wrap_width: The text wrap width (default is 100). If zero or less, text is not wrapped.
514
+ :type wrap_width: int or None, optional
515
+ :param ref_count: The minimum number of occurrences of a link/image URL for which a link/image
516
+ reference is rendered (default is 0). If zero or less, all links/images are rendered inline.
517
+ :type ref_count: int or None, optional
518
+ :return: The Markdown text
519
+ :rtype: str
520
+ """
521
+
522
+ return _INCLUDE_GLOBALS['markdownToString']([markdown, wrap_width, ref_count], _include_options())
523
+
524
+
502
525
  #
503
526
  # qrcode.bare
504
527
  #