RestrictedPython 8.0__tar.gz → 8.1__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 (128) hide show
  1. {restrictedpython-8.0 → restrictedpython-8.1}/.pre-commit-config.yaml +4 -4
  2. {restrictedpython-8.0 → restrictedpython-8.1}/CHANGES.rst +13 -0
  3. {restrictedpython-8.0 → restrictedpython-8.1}/CONTRIBUTING.md +1 -1
  4. {restrictedpython-8.0 → restrictedpython-8.1}/PKG-INFO +30 -3
  5. restrictedpython-8.1/docs/_build/doctest/output.txt +35 -0
  6. restrictedpython-8.1/docs/_build/html/_sources/contributing/changes_from313to314.rst.txt +5 -0
  7. restrictedpython-8.1/docs/_build/html/_sources/contributing/index.rst.txt +308 -0
  8. restrictedpython-8.1/docs/_build/html/_static/scripts/furo.js.LICENSE.txt +7 -0
  9. restrictedpython-8.1/docs/changes.rst +1 -0
  10. {restrictedpython-8.0 → restrictedpython-8.1}/docs/conf.py +3 -2
  11. restrictedpython-8.1/docs/contributing/ast/python3_14.ast +196 -0
  12. restrictedpython-8.1/docs/contributing/changes_from310to311.rst +5 -0
  13. restrictedpython-8.1/docs/contributing/changes_from311to312.rst +5 -0
  14. restrictedpython-8.1/docs/contributing/changes_from312to313.rst +5 -0
  15. restrictedpython-8.1/docs/contributing/changes_from313to314.rst +5 -0
  16. restrictedpython-8.1/docs/contributing/changes_from38to39.rst +5 -0
  17. restrictedpython-8.1/docs/contributing/changes_from39to310.rst +5 -0
  18. {restrictedpython-8.0 → restrictedpython-8.1}/docs/contributing/index.rst +6 -0
  19. restrictedpython-8.1/docs/idea.rst +85 -0
  20. restrictedpython-8.1/docs/index.rst +42 -0
  21. restrictedpython-8.1/docs/install/index.rst +10 -0
  22. restrictedpython-8.1/docs/logo.jpg +0 -0
  23. restrictedpython-8.1/docs/roadmap/index.rst +33 -0
  24. restrictedpython-8.1/docs/usage/api.rst +139 -0
  25. restrictedpython-8.1/docs/usage/basic_usage.rst +175 -0
  26. restrictedpython-8.1/docs/usage/framework_usage.rst +86 -0
  27. restrictedpython-8.1/docs/usage/index.rst +9 -0
  28. restrictedpython-8.1/docs/usage/policy.rst +237 -0
  29. {restrictedpython-8.0 → restrictedpython-8.1}/pyproject.toml +15 -3
  30. {restrictedpython-8.0 → restrictedpython-8.1}/setup.py +3 -2
  31. {restrictedpython-8.0 → restrictedpython-8.1}/src/RestrictedPython/_compat.py +2 -0
  32. {restrictedpython-8.0 → restrictedpython-8.1}/src/RestrictedPython/transformer.py +23 -0
  33. {restrictedpython-8.0 → restrictedpython-8.1}/src/RestrictedPython.egg-info/PKG-INFO +30 -3
  34. {restrictedpython-8.0 → restrictedpython-8.1}/src/RestrictedPython.egg-info/SOURCES.txt +23 -0
  35. restrictedpython-8.1/tests/transformer/test_tstring.py +91 -0
  36. {restrictedpython-8.0 → restrictedpython-8.1}/tox.ini +8 -3
  37. {restrictedpython-8.0 → restrictedpython-8.1}/.readthedocs.yaml +0 -0
  38. {restrictedpython-8.0 → restrictedpython-8.1}/COPYRIGHT.txt +0 -0
  39. {restrictedpython-8.0 → restrictedpython-8.1}/LICENSE.txt +0 -0
  40. {restrictedpython-8.0 → restrictedpython-8.1}/MANIFEST.in +0 -0
  41. {restrictedpython-8.0 → restrictedpython-8.1}/README.rst +0 -0
  42. {restrictedpython-8.0 → restrictedpython-8.1}/buildout.cfg +0 -0
  43. {restrictedpython-8.0 → restrictedpython-8.1}/constraints.txt +0 -0
  44. {restrictedpython-8.0 → restrictedpython-8.1}/docs/Makefile +0 -0
  45. {restrictedpython-8.0/docs → restrictedpython-8.1/docs/_build/html/_images}/logo.jpg +0 -0
  46. /restrictedpython-8.0/docs/changes.rst → /restrictedpython-8.1/docs/_build/html/_sources/changes.rst.txt +0 -0
  47. /restrictedpython-8.0/docs/contributing/changes_from310to311.rst → /restrictedpython-8.1/docs/_build/html/_sources/contributing/changes_from310to311.rst.txt +0 -0
  48. /restrictedpython-8.0/docs/contributing/changes_from311to312.rst → /restrictedpython-8.1/docs/_build/html/_sources/contributing/changes_from311to312.rst.txt +0 -0
  49. /restrictedpython-8.0/docs/contributing/changes_from312to313.rst → /restrictedpython-8.1/docs/_build/html/_sources/contributing/changes_from312to313.rst.txt +0 -0
  50. /restrictedpython-8.0/docs/contributing/changes_from38to39.rst → /restrictedpython-8.1/docs/_build/html/_sources/contributing/changes_from38to39.rst.txt +0 -0
  51. /restrictedpython-8.0/docs/contributing/changes_from39to310.rst → /restrictedpython-8.1/docs/_build/html/_sources/contributing/changes_from39to310.rst.txt +0 -0
  52. /restrictedpython-8.0/docs/idea.rst → /restrictedpython-8.1/docs/_build/html/_sources/idea.rst.txt +0 -0
  53. /restrictedpython-8.0/docs/index.rst → /restrictedpython-8.1/docs/_build/html/_sources/index.rst.txt +0 -0
  54. /restrictedpython-8.0/docs/install/index.rst → /restrictedpython-8.1/docs/_build/html/_sources/install/index.rst.txt +0 -0
  55. /restrictedpython-8.0/docs/roadmap/index.rst → /restrictedpython-8.1/docs/_build/html/_sources/roadmap/index.rst.txt +0 -0
  56. /restrictedpython-8.0/docs/usage/api.rst → /restrictedpython-8.1/docs/_build/html/_sources/usage/api.rst.txt +0 -0
  57. /restrictedpython-8.0/docs/usage/basic_usage.rst → /restrictedpython-8.1/docs/_build/html/_sources/usage/basic_usage.rst.txt +0 -0
  58. /restrictedpython-8.0/docs/usage/framework_usage.rst → /restrictedpython-8.1/docs/_build/html/_sources/usage/framework_usage.rst.txt +0 -0
  59. /restrictedpython-8.0/docs/usage/index.rst → /restrictedpython-8.1/docs/_build/html/_sources/usage/index.rst.txt +0 -0
  60. /restrictedpython-8.0/docs/usage/policy.rst → /restrictedpython-8.1/docs/_build/html/_sources/usage/policy.rst.txt +0 -0
  61. {restrictedpython-8.0 → restrictedpython-8.1}/docs/contributing/ast/python3_10.ast +0 -0
  62. {restrictedpython-8.0 → restrictedpython-8.1}/docs/contributing/ast/python3_11.ast +0 -0
  63. {restrictedpython-8.0 → restrictedpython-8.1}/docs/contributing/ast/python3_12.ast +0 -0
  64. {restrictedpython-8.0 → restrictedpython-8.1}/docs/contributing/ast/python3_13.ast +0 -0
  65. {restrictedpython-8.0 → restrictedpython-8.1}/docs/contributing/ast/python3_8.ast +0 -0
  66. {restrictedpython-8.0 → restrictedpython-8.1}/docs/contributing/ast/python3_9.ast +0 -0
  67. {restrictedpython-8.0 → restrictedpython-8.1}/docs/make.bat +0 -0
  68. {restrictedpython-8.0 → restrictedpython-8.1}/docs/requirements.txt +0 -0
  69. {restrictedpython-8.0 → restrictedpython-8.1}/setup.cfg +0 -0
  70. {restrictedpython-8.0 → restrictedpython-8.1}/src/RestrictedPython/Eval.py +0 -0
  71. {restrictedpython-8.0 → restrictedpython-8.1}/src/RestrictedPython/Guards.py +0 -0
  72. {restrictedpython-8.0 → restrictedpython-8.1}/src/RestrictedPython/Limits.py +0 -0
  73. {restrictedpython-8.0 → restrictedpython-8.1}/src/RestrictedPython/PrintCollector.py +0 -0
  74. {restrictedpython-8.0 → restrictedpython-8.1}/src/RestrictedPython/Utilities.py +0 -0
  75. {restrictedpython-8.0 → restrictedpython-8.1}/src/RestrictedPython/__init__.py +0 -0
  76. {restrictedpython-8.0 → restrictedpython-8.1}/src/RestrictedPython/compile.py +0 -0
  77. {restrictedpython-8.0 → restrictedpython-8.1}/src/RestrictedPython.egg-info/dependency_links.txt +0 -0
  78. {restrictedpython-8.0 → restrictedpython-8.1}/src/RestrictedPython.egg-info/not-zip-safe +0 -0
  79. {restrictedpython-8.0 → restrictedpython-8.1}/src/RestrictedPython.egg-info/requires.txt +0 -0
  80. {restrictedpython-8.0 → restrictedpython-8.1}/src/RestrictedPython.egg-info/top_level.txt +0 -0
  81. {restrictedpython-8.0 → restrictedpython-8.1}/tests/__init__.py +0 -0
  82. {restrictedpython-8.0 → restrictedpython-8.1}/tests/builtins/test_limits.py +0 -0
  83. {restrictedpython-8.0 → restrictedpython-8.1}/tests/builtins/test_utilities.py +0 -0
  84. {restrictedpython-8.0 → restrictedpython-8.1}/tests/helper.py +0 -0
  85. {restrictedpython-8.0 → restrictedpython-8.1}/tests/test_Guards.py +0 -0
  86. {restrictedpython-8.0 → restrictedpython-8.1}/tests/test_NamedExpr.py +0 -0
  87. {restrictedpython-8.0 → restrictedpython-8.1}/tests/test_Utilities.py +0 -0
  88. {restrictedpython-8.0 → restrictedpython-8.1}/tests/test_compile.py +0 -0
  89. {restrictedpython-8.0 → restrictedpython-8.1}/tests/test_compile_restricted_function.py +0 -0
  90. {restrictedpython-8.0 → restrictedpython-8.1}/tests/test_eval.py +0 -0
  91. {restrictedpython-8.0 → restrictedpython-8.1}/tests/test_imports.py +0 -0
  92. {restrictedpython-8.0 → restrictedpython-8.1}/tests/test_iterating_over_dict_items.py +0 -0
  93. {restrictedpython-8.0 → restrictedpython-8.1}/tests/test_print_function.py +0 -0
  94. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/operators/test_arithmetic_operators.py +0 -0
  95. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/operators/test_bit_wise_operators.py +0 -0
  96. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/operators/test_bool_operators.py +0 -0
  97. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/operators/test_comparison_operators.py +0 -0
  98. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/operators/test_identity_operators.py +0 -0
  99. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/operators/test_logical_operators.py +0 -0
  100. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/operators/test_unary_operators.py +0 -0
  101. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_assert.py +0 -0
  102. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_assign.py +0 -0
  103. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_async.py +0 -0
  104. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_attribute.py +0 -0
  105. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_augassign.py +0 -0
  106. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_base_types.py +0 -0
  107. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_breakpoint.py +0 -0
  108. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_call.py +0 -0
  109. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_classdef.py +0 -0
  110. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_comparators.py +0 -0
  111. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_conditional.py +0 -0
  112. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_dict_comprehension.py +0 -0
  113. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_eval_exec.py +0 -0
  114. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_fstring.py +0 -0
  115. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_functiondef.py +0 -0
  116. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_generic.py +0 -0
  117. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_global_local.py +0 -0
  118. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_import.py +0 -0
  119. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_inspect.py +0 -0
  120. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_iterator.py +0 -0
  121. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_lambda.py +0 -0
  122. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_loop.py +0 -0
  123. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_name.py +0 -0
  124. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_slice.py +0 -0
  125. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_subscript.py +0 -0
  126. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_try.py +0 -0
  127. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_with_stmt.py +0 -0
  128. {restrictedpython-8.0 → restrictedpython-8.1}/tests/transformer/test_yield.py +0 -0
@@ -3,16 +3,16 @@
3
3
  minimum_pre_commit_version: '3.6'
4
4
  repos:
5
5
  - repo: https://github.com/pycqa/isort
6
- rev: "5.13.2"
6
+ rev: "7.0.0"
7
7
  hooks:
8
8
  - id: isort
9
9
  - repo: https://github.com/hhatto/autopep8
10
- rev: "v2.3.1"
10
+ rev: "v2.3.2"
11
11
  hooks:
12
12
  - id: autopep8
13
13
  args: [--in-place, --aggressive, --aggressive]
14
14
  - repo: https://github.com/asottile/pyupgrade
15
- rev: v3.19.0
15
+ rev: v3.21.0
16
16
  hooks:
17
17
  - id: pyupgrade
18
18
  args: [--py39-plus]
@@ -21,7 +21,7 @@ repos:
21
21
  hooks:
22
22
  - id: teyit
23
23
  - repo: https://github.com/PyCQA/flake8
24
- rev: "7.1.1"
24
+ rev: "7.3.0"
25
25
  hooks:
26
26
  - id: flake8
27
27
  additional_dependencies:
@@ -1,6 +1,19 @@
1
1
  Changes
2
2
  =======
3
3
 
4
+ 8.1 (2025-10-19)
5
+ ----------------
6
+
7
+ - Allow to use the package with Python 3.14 including t-string support.
8
+
9
+
10
+ 8.1a1.dev0 (2025-03-20)
11
+ -----------------------
12
+
13
+ - Allow to use the package with Python 3.14 -- Caution: No security
14
+ audit has been done so far.
15
+
16
+
4
17
  8.0 (2025-01-23)
5
18
  ----------------
6
19
 
@@ -1,7 +1,7 @@
1
1
  <!--
2
2
  Generated from:
3
3
  https://github.com/zopefoundation/meta/tree/master/config/pure-python
4
- -->
4
+ -->
5
5
  # Contributing to zopefoundation projects
6
6
 
7
7
  The projects under the zopefoundation GitHub organization are open source and
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: RestrictedPython
3
- Version: 8.0
3
+ Version: 8.1
4
4
  Summary: RestrictedPython is a defined subset of the Python language which allows to provide a program input into a trusted environment.
5
5
  Home-page: https://github.com/zopefoundation/RestrictedPython
6
6
  Author: Zope Foundation and Contributors
@@ -20,9 +20,10 @@ Classifier: Programming Language :: Python :: 3.10
20
20
  Classifier: Programming Language :: Python :: 3.11
21
21
  Classifier: Programming Language :: Python :: 3.12
22
22
  Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
23
24
  Classifier: Programming Language :: Python :: Implementation :: CPython
24
25
  Classifier: Topic :: Security
25
- Requires-Python: >=3.9, <3.14
26
+ Requires-Python: >=3.9, <3.15
26
27
  Description-Content-Type: text/x-rst
27
28
  License-File: LICENSE.txt
28
29
  Provides-Extra: test
@@ -31,6 +32,19 @@ Requires-Dist: pytest-mock; extra == "test"
31
32
  Provides-Extra: docs
32
33
  Requires-Dist: Sphinx; extra == "docs"
33
34
  Requires-Dist: furo; extra == "docs"
35
+ Dynamic: author
36
+ Dynamic: author-email
37
+ Dynamic: classifier
38
+ Dynamic: description
39
+ Dynamic: description-content-type
40
+ Dynamic: home-page
41
+ Dynamic: keywords
42
+ Dynamic: license
43
+ Dynamic: license-file
44
+ Dynamic: project-url
45
+ Dynamic: provides-extra
46
+ Dynamic: requires-python
47
+ Dynamic: summary
34
48
 
35
49
  .. image:: https://github.com/zopefoundation/RestrictedPython/actions/workflows/tests.yml/badge.svg
36
50
  :target: https://github.com/zopefoundation/RestrictedPython/actions/workflows/tests.yml
@@ -123,6 +137,19 @@ the documentation `Contributing page
123
137
  Changes
124
138
  =======
125
139
 
140
+ 8.1 (2025-10-19)
141
+ ----------------
142
+
143
+ - Allow to use the package with Python 3.14 including t-string support.
144
+
145
+
146
+ 8.1a1.dev0 (2025-03-20)
147
+ -----------------------
148
+
149
+ - Allow to use the package with Python 3.14 -- Caution: No security
150
+ audit has been done so far.
151
+
152
+
126
153
  8.0 (2025-01-23)
127
154
  ----------------
128
155
 
@@ -0,0 +1,35 @@
1
+ Results of doctest builder run on 2025-10-19 12:08:37
2
+ =====================================================
3
+
4
+ Document: usage/api
5
+ -------------------
6
+ 1 item passed all tests:
7
+ 13 tests in default
8
+ 13 tests in 1 item.
9
+ 13 passed.
10
+ Test passed.
11
+
12
+ Document: usage/basic_usage
13
+ ---------------------------
14
+ 2 items passed all tests:
15
+ 6 tests in default
16
+ 1 test in single
17
+ 7 tests in 2 items.
18
+ 7 passed.
19
+ Test passed.
20
+
21
+ Document: usage/framework_usage
22
+ -------------------------------
23
+ 2 items passed all tests:
24
+ 1 test in default
25
+ 2 tests in own_policy
26
+ 3 tests in 2 items.
27
+ 3 passed.
28
+ Test passed.
29
+
30
+ Doctest summary
31
+ ===============
32
+ 23 tests
33
+ 0 failures in tests
34
+ 0 failures in setup code
35
+ 0 failures in cleanup code
@@ -0,0 +1,5 @@
1
+ Changes from Python 3.13 to Python 3.14
2
+ ---------------------------------------
3
+
4
+ .. literalinclude:: ast/python3_14.ast
5
+ :diff: ast/python3_13.ast
@@ -0,0 +1,308 @@
1
+ Contributing
2
+ ============
3
+
4
+
5
+ Contributing to RestrictedPython
6
+ --------------------------------
7
+
8
+ Legal requirements to contribute to RestrictedPython
9
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++
10
+
11
+ The projects under the zopefoundation GitHub organization are open source, including RestrictedPython.
12
+ We welcome contributions in different forms:
13
+
14
+ * bug reports
15
+ * code improvements and bug fixes
16
+ * documentation improvements
17
+ * pull request reviews
18
+
19
+ For any changes in the repository besides trivial typo fixes, you are required to sign the contributor agreement.
20
+ See https://www.zope.dev/developer/becoming-a-committer.html for details.
21
+
22
+ Please visit our `Developer Guidelines`_ if you'd like to contribute code changes and our `guidelines for reporting bugs`_ if you want to file a bug report.
23
+
24
+
25
+ .. _`Developer Guidelines`: https://www.zope.dev/developer/guidelines.html
26
+ .. _`guidelines for reporting bugs`: https://www.zope.dev/developer/reporting-bugs.html
27
+
28
+ Preperations for Contributing
29
+ +++++++++++++++++++++++++++++
30
+
31
+ If you want to contribute to this package, please prepare a development environment that includes ``git``, ``tox``, and several Python versions available through a Python manager such as ``pyenv``.
32
+ Please read the section :ref:`understand` first.
33
+
34
+ For all commits, use ``tox`` to run tests and lint, and build the docs, before pushing your commit to the remote repository.
35
+
36
+ .. _new_python_version:
37
+
38
+ Preperations for a new Python version
39
+ +++++++++++++++++++++++++++++++++++++
40
+
41
+ RestrictedPython should be updated for each new version of Python.
42
+ To do so:
43
+
44
+ * Read the changelog (`What's new in Python`_).
45
+ * Copy and adjust the new AST Grammar (found under: `Python 3 AST`_) to ``/docs/contributing/ast/python<version>.ast``.
46
+ * Add a new file ``changes_from<old_version>to<new_version>.rst`` in the directory ``/docs/contributing/``.
47
+ If the changes are significant, especially if related to security, then add a description of the changes in that file.
48
+ * Add those files to the ``toctree`` directive in ``index.rst``.
49
+ * For each new **AST Node** or functionality:
50
+
51
+ * Add tests to ``/tests/``.
52
+ * Add a ``visit_<AST Node>`` to ``/src/RestrictedPython/transformer.py``.
53
+
54
+ If the new AST Node should be enabled by default, with or without any modification, please add a ``visit_<AST Node>`` method such as the following:
55
+
56
+ .. code-block:: python
57
+
58
+ def visit_<AST Node>(self, node):
59
+ """Allow `<AST Node>` expressions."""
60
+ ... # modifications
61
+ return self.node_contents_visit(node)
62
+
63
+ All AST Nodes without an explicit ``visit_<AST Node>`` method, are denied by default.
64
+ So the usage of this expression and functionality is not allowed.
65
+
66
+ * Check the documentation for `inspect <https://docs.python.org/3/library/inspect.html>`_ and adjust the ``transformer.py:INSPECT_ATTRIBUTES`` list.
67
+ * Add a corresponding changelog entry.
68
+ * Additionally modify ``.meta.toml`` and run the ``meta/config`` script (for details see: https://github.com/mgedmin/check-python-versions) to update the following files:
69
+
70
+ * ``/setup.py`` - Check that the new Python version classifier has been added ``"Programming Language :: Python :: <version>",``, and that the ``python_requires`` section has been updated correctly.
71
+ * ``/tox.ini`` - Check that a ``testenv`` entry is added to the general ``envlist`` statement.
72
+ * ``/.github/workflows/tests.yml`` - Check that a corresponding Python version entry has been added to the matrix definition.
73
+ * ``/docs/conf.py`` - Add the Python version to the ``intersphinx_mapping`` list.
74
+
75
+ * On your local environment, use ``tox`` to run tests and lint, and build the docs, before pushing your commit to the remote repository.
76
+ * Create a pull request.
77
+
78
+ Enable a Python Feature in RestrictedPython
79
+ +++++++++++++++++++++++++++++++++++++++++++
80
+
81
+ To enable a certain functionality in RestrictedPython, do the following:
82
+
83
+ * `Create a new issue on GitHub <https://github.com/zopefoundation/RestrictedPython/issues/new/choose>`__, requesting the new feature, for discussion.
84
+ * In ``/src/RestrictedPython/transformer.py``, change the corresponding ``visit_<AST Node>`` method.
85
+ * In ``/tests/``, add or change the corresponding tests for this functionality.
86
+ * Add a changelog entry.
87
+ * On your local environment, use ``tox`` to run tests and lint, and build the docs, before pushing your commit to the remote repository.
88
+ * Create a pull request and request a review by a core maintainer, e.g.:
89
+
90
+ * icemac
91
+ * loechel
92
+
93
+ Differences between Python versions
94
+ -----------------------------------
95
+
96
+ A (modified style) Copy of all Abstract Grammar Definitions for the Python versions does live in this Documentation (ast Subfolder) to help finding difference quicker by comparing files.
97
+
98
+ .. toctree::
99
+ :maxdepth: 2
100
+
101
+ changes_from38to39
102
+ changes_from39to310
103
+ changes_from310to311
104
+ changes_from311to312
105
+ changes_from312to313
106
+ changes_from313to314
107
+
108
+ .. _understand:
109
+
110
+ Understanding How RestrictedPython works internally
111
+ ---------------------------------------------------
112
+
113
+ RestrictedPython is a classic approach of compiler construction to create a limited subset of an existing programming language.
114
+
115
+ Defining a programming language requires a regular grammar (`Chomsky 3`_ / `EBNF`_) definition.
116
+ This grammar will be implemented in an abstract syntax tree (AST), which will be passed on to a code generator to produce a machine-readable version.
117
+
118
+ .. _`_sec_code_generation`:
119
+
120
+ Code generation
121
+ +++++++++++++++
122
+
123
+ As Python is a platform independent programming language, this machine readable version is a byte code which will be translated on the fly by an interpreter into machine code.
124
+ This machine code then gets executed on the specific CPU architecture, with the standard operating system restrictions.
125
+
126
+ The byte code produced must be compatible with the execution environment that the Python interpreter is running in, so we do not generate the byte code directly from ``compile_restricted`` and the other ``compile_restricted_*`` methods manually, it may not match what the interpreter expects.
127
+
128
+ Thankfully, the Python ``compile()`` function introduced the capability to compile ``ast.AST`` code into byte code in Python 2.6, so we can return the platform-independent AST and keep byte code generation delegated to the interpreter.
129
+
130
+ ``ast`` module (Abstract Syntax Trees)
131
+ ++++++++++++++++++++++++++++++++++++++
132
+
133
+ The ``ast`` module consists of four areas:
134
+
135
+ * ``AST`` (Basis of all Nodes) + all node class implementations
136
+ * ``NodeVisitor`` and ``NodeTransformer`` (tool to consume and modify the AST)
137
+ * Helper methods
138
+
139
+ * ``parse``
140
+ * ``walk``
141
+ * ``dump``
142
+
143
+ * Constants
144
+
145
+ * ``PyCF_ONLY_AST``
146
+
147
+
148
+ ``NodeVisitor`` & ``NodeTransformer``
149
+ +++++++++++++++++++++++++++++++++++++
150
+
151
+ A ``NodeVisitor`` is a class of a node / AST consumer, it reads the data by stepping through the tree without modifying it.
152
+ In contrast, a ``NodeTransformer`` (which inherits from a ``NodeVisitor``) is allowed to modify the tree and nodes.
153
+
154
+ Technical decisions on how to implement / maintain RestrictedPython (Design, Structure, Tools, ...)
155
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
156
+
157
+ RestrictedPython is a core Package of the Zope & Plone Stack.
158
+ Until Version 3.6 RestrictedPython was Python 2 only, and a critical blocker for Zope & Plone.
159
+ With RestrictedPython 4.0 an API compatible rewrite has happened, which supports modern Python Versions.
160
+
161
+ * Use modern python tool stack for maintenance and tests
162
+
163
+ * tox
164
+ * pytest
165
+ * black
166
+ * linting tools: flake8
167
+
168
+ * Use clear package Structure
169
+
170
+ * ``/src`` - Source Code
171
+ * ``/tests`` - separated tests
172
+ * ``/docs`` - Documentation
173
+
174
+ Tests and documentation are distributed within released packages.
175
+
176
+ .. todo::
177
+
178
+ Resolve discussion about how RestrictedPython should be treat new expressions / ``ast.Nodes``.
179
+ This belongs to :ref:`new_python_version`.
180
+
181
+ **Option 1 - reduce maintenance burden (preferred by icemac)**
182
+
183
+
184
+ All AST Nodes without an explicit ``visit_<AST Node>`` method, are denied by default.
185
+ So the usage of this expression and functionality is not allowed.
186
+
187
+ *This is currently the promoted version.*
188
+
189
+ **Option 2 - be as explicit as possible (preferred by loechel)**
190
+
191
+ If the new AST Node should be disabled by default, add a ``visit_<AST Node>`` method such as the following:
192
+
193
+ .. code-block:: python
194
+
195
+ def visit_<AST Node>(self, node):
196
+ """`<AST Node>` expression currently not allowed."""
197
+ self.not_allowed(node)
198
+
199
+ Please note, that for all AST Nodes without an explicit ``visit_<AST Node>`` method, a default applies which denies the usage of this expression and functionality.
200
+ As we try to be **as explicit as possible**, all language features should have a corresponding ``visit_<AST Node>``.
201
+
202
+ That follows the Zen of Python:
203
+
204
+ .. code-block:: pycon
205
+ :emphasize-lines: 5
206
+
207
+ >>> import this
208
+ The Zen of Python, by Tim Peters
209
+
210
+ Beautiful is better than ugly.
211
+ Explicit is better than implicit.
212
+ Simple is better than complex.
213
+ Complex is better than complicated.
214
+ Flat is better than nested.
215
+ Sparse is better than dense.
216
+ Readability counts.
217
+ Special cases aren't special enough to break the rules.
218
+ Although practicality beats purity.
219
+ Errors should never pass silently.
220
+ Unless explicitly silenced.
221
+ In the face of ambiguity, refuse the temptation to guess.
222
+ There should be one-- and preferably only one --obvious way to do it.
223
+ Although that way may not be obvious at first unless you're Dutch.
224
+ Now is better than never.
225
+ Although never is often better than *right* now.
226
+ If the implementation is hard to explain, it's a bad idea.
227
+ If the implementation is easy to explain, it may be a good idea.
228
+ Namespaces are one honking great idea -- let's do more of those!
229
+
230
+
231
+ Technical Backgrounds - Links to External Documentation
232
+ +++++++++++++++++++++++++++++++++++++++++++++++++++++++
233
+
234
+ * `Concept of Immutable Types and Python Example`_
235
+ * `Python 3 Standard Library Documentation on AST module`_
236
+
237
+ * AST Grammar of Python (`Status of Python Versions`_)
238
+
239
+ * `Python 3.14 AST`_ (EOL 2030-10)
240
+ * `Python 3.13 AST`_ (EOL 2029-10)
241
+ * `Python 3.12 AST`_ (EOL 2028-10)
242
+ * `Python 3.11 AST`_ (EOL 2027-10)
243
+ * `Python 3.10 AST`_ (EOL 2026-10)
244
+ * `Python 3.9 AST`_ (EOL 2025-10)
245
+
246
+ * `AST NodeVistiors Class`_
247
+ * `AST NodeTransformer Class`_
248
+ * `AST dump method`_
249
+
250
+ * `In detail Documentation on the Python AST module (Green Tree Snakes)`_
251
+ * `Example how to Instrumenting the Python AST`_
252
+
253
+ Todos
254
+ -----
255
+
256
+ .. todolist::
257
+
258
+ .. Links:
259
+
260
+ .. _`What's new in Python`: https://docs.python.org/3/whatsnew/
261
+
262
+ .. _`What's new in Python 3.14`: https://docs.python.org/3.14/whatsnew/3.14.html
263
+
264
+ .. _`What's new in Python 3.13`: https://docs.python.org/3.13/whatsnew/3.13.html
265
+
266
+ .. _`What's new in Python 3.12`: https://docs.python.org/3.12/whatsnew/3.12.html
267
+
268
+ .. _`What's new in Python 3.11`: https://docs.python.org/3.11/whatsnew/3.11.html
269
+
270
+ .. _`What's new in Python 3.10`: https://docs.python.org/3.10/whatsnew/3.10.html
271
+
272
+ .. _`What's new in Python 3.9`: https://docs.python.org/3.9/whatsnew/3.9.html
273
+
274
+ .. _`Status of Python Versions`: https://devguide.python.org/versions/
275
+
276
+ .. _`Concept of Immutable Types and Python Example`: https://en.wikipedia.org/wiki/Immutable_object#Python
277
+
278
+ .. _`Python 3 Standard Library Documentation on AST module`: https://docs.python.org/3/library/ast.html
279
+
280
+ .. _`CamelCase`: https://en.wikipedia.org/wiki/Camel_case
281
+
282
+ .. _`EBNF`: https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form
283
+
284
+ .. _`Chomsky 3`: https://en.wikipedia.org/wiki/Chomsky_hierarchy#Type-3_grammars
285
+
286
+ .. _`Python 3 AST`: https://docs.python.org/3/library/ast.html#abstract-grammar
287
+
288
+ .. _`Python 3.14 AST`: https://docs.python.org/3.14/library/ast.html#abstract-grammar
289
+
290
+ .. _`Python 3.13 AST`: https://docs.python.org/3.13/library/ast.html#abstract-grammar
291
+
292
+ .. _`Python 3.12 AST`: https://docs.python.org/3.12/library/ast.html#abstract-grammar
293
+
294
+ .. _`Python 3.11 AST`: https://docs.python.org/3.11/library/ast.html#abstract-grammar
295
+
296
+ .. _`Python 3.10 AST`: https://docs.python.org/3.10/library/ast.html#abstract-grammar
297
+
298
+ .. _`Python 3.9 AST`: https://docs.python.org/3.9/library/ast.html#abstract-grammar
299
+
300
+ .. _`AST NodeVistiors Class`: https://docs.python.org/3/library/ast.html#ast.NodeVisitor
301
+
302
+ .. _`AST NodeTransformer Class`: https://docs.python.org/3/library/ast.html#ast.NodeTransformer
303
+
304
+ .. _`AST dump method`: https://docs.python.org/3/library/ast.html#ast.dump
305
+
306
+ .. _`In detail Documentation on the Python AST module (Green Tree Snakes)`: https://greentreesnakes.readthedocs.org/en/latest/
307
+
308
+ .. _`Example how to Instrumenting the Python AST`: http://www.dalkescientific.com/writings/diary/archive/2010/02/22/instrumenting_the_ast.html
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * gumshoejs v5.1.2 (patched by @pradyunsg)
3
+ * A simple, framework-agnostic scrollspy script.
4
+ * (c) 2019 Chris Ferdinandi
5
+ * MIT License
6
+ * http://github.com/cferdinandi/gumshoe
7
+ */
@@ -0,0 +1 @@
1
+ .. include:: ../CHANGES.rst
@@ -60,9 +60,9 @@ author = 'The Zope & Plone developer community'
60
60
  # built documents.
61
61
  #
62
62
  # The short X.Y version.
63
- version = '7.5'
63
+ version = '8.1'
64
64
  # The full version, including alpha/beta/rc tags.
65
- release = '7.5'
65
+ release = '8.1'
66
66
 
67
67
  # The language for content autogenerated by Sphinx. Refer to documentation
68
68
  # for a list of supported languages.
@@ -117,6 +117,7 @@ intersphinx_mapping = {
117
117
  'python311': ('https://docs.python.org/3.11', None),
118
118
  'python312': ('https://docs.python.org/3.12', None),
119
119
  'python313': ('https://docs.python.org/3.13', None),
120
+ 'python314': ('https://docs.python.org/3.14', None),
120
121
  }
121
122
 
122
123
  # Options for sphinx.ext.todo: