diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6f69029..2998d6c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,7 +22,6 @@ jobs: config: # [Python version, tox env] - ["3.11", "release-check"] - - ["3.8", "py38"] - ["3.9", "py39"] - ["3.10", "py310"] - ["3.11", "py311"] diff --git a/.meta.toml b/.meta.toml index 9814f9a..14af140 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/config/pure-python [meta] template = "pure-python" -commit-id = "d3455844" +commit-id = "d1a00d25" [python] with-pypy = false @@ -47,7 +47,7 @@ testenv-additional = [ " coverage combine", " coverage html", " coverage report -m --fail-under=100", - "depends = py38,py39,py310,py311,py311-datetime,py312,py313,coverage", + "depends = py39,py310,py311,py311-datetime,py312,py313,coverage", ] coverage-command = "pytest --cov=src --cov=tests --cov-report= tests {posargs}" coverage-setenv = [ @@ -55,7 +55,7 @@ coverage-setenv = [ ] [coverage] -fail-under = 97.9 +fail-under = 97.3 [isort] additional-sources = "{toxinidir}/tests" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7ab398c..92c124c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,10 +12,10 @@ repos: - id: autopep8 args: [--in-place, --aggressive, --aggressive] - repo: https://github.com/asottile/pyupgrade - rev: v3.17.0 + rev: v3.19.0 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] - repo: https://github.com/isidentical/teyit rev: 0.4.3 hooks: diff --git a/CHANGES.rst b/CHANGES.rst index f2cc8ed..be95822 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,11 @@ Changes 7.5 (unreleased) ---------------- +- Drop support for Python 3.8. + +- Update setuptools version pin. + (`#292 `_) + 7.4 (2024-10-09) ---------------- diff --git a/docs/conf.py b/docs/conf.py index 3ea6a2c..eb7dc5e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -60,9 +60,9 @@ # built documents. # # The short X.Y version. -version = '7.4' +version = '7.5' # The full version, including alpha/beta/rc tags. -release = '7.4' +release = '7.5' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -112,7 +112,6 @@ # Intersphinx Mapping for Links between different Documentations intersphinx_mapping = { 'python3': ('https://docs.python.org/3', None), - 'python38': ('https://docs.python.org/3.8', None), 'python39': ('https://docs.python.org/3.9', None), 'python310': ('https://docs.python.org/3.10', None), 'python311': ('https://docs.python.org/3.11', None), diff --git a/docs/contributing/ast/python3_7.ast b/docs/contributing/ast/python3_7.ast deleted file mode 100755 index 2f50bf5..0000000 --- a/docs/contributing/ast/python3_7.ast +++ /dev/null @@ -1,175 +0,0 @@ --- Python 3.7 AST --- ASDL's 7 builtin types are: --- identifier, int, string, bytes, object, singleton, constant --- --- singleton: None, True or False --- constant can be None, whereas None means "no value" for object. - -module Python version "3.7" -{ - mod = Module(stmt* body) - | Interactive(stmt* body) - | Expression(expr body) - - -- not really an actual node but useful in Jython's typesystem. - | Suite(stmt* body) - - stmt = FunctionDef(identifier name, - arguments args, - stmt* body, - expr* decorator_list, - expr? returns) - | AsyncFunctionDef(identifier name, - arguments args, - stmt* body, - expr* decorator_list, - expr? returns) - - | ClassDef(identifier name, - expr* bases, - keyword* keywords, - stmt* body, - expr* decorator_list) - | Return(expr? value) - - | Delete(expr* targets) - | Assign(expr* targets, expr value) - | AugAssign(expr target, operator op, expr value) - -- 'simple' indicates that we annotate simple name without parens - | AnnAssign(expr target, expr annotation, expr? value, int simple) - - -- use 'orelse' because else is a keyword in target languages - | For(expr target, expr iter, stmt* body, stmt* orelse) - | AsyncFor(expr target, expr iter, stmt* body, stmt* orelse) - | While(expr test, stmt* body, stmt* orelse) - | If(expr test, stmt* body, stmt* orelse) - | With(withitem* items, stmt* body) - | AsyncWith(withitem* items, stmt* body) - - | Raise(expr? exc, expr? cause) - | Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* finalbody) - | Assert(expr test, expr? msg) - - | Import(alias* names) - | ImportFrom(identifier? module, alias* names, int? level) - - | Global(identifier* names) - | Nonlocal(identifier* names) - | Expr(expr value) - | Pass - | Break - | Continue - - -- XXX Jython will be different - -- col_offset is the byte offset in the utf8 string the parser uses - attributes (int lineno, int col_offset) - - -- BoolOp() can use left & right? - expr = BoolOp(boolop op, expr* values) - | BinOp(expr left, operator op, expr right) - | UnaryOp(unaryop op, expr operand) - | Lambda(arguments args, expr body) - | IfExp(expr test, expr body, expr orelse) - | Dict(expr* keys, expr* values) - | Set(expr* elts) - | ListComp(expr elt, comprehension* generators) - | SetComp(expr elt, comprehension* generators) - | DictComp(expr key, expr value, comprehension* generators) - | GeneratorExp(expr elt, comprehension* generators) - -- the grammar constrains where yield expressions can occur - | Await(expr value) - | Yield(expr? value) - | YieldFrom(expr value) - -- need sequences for compare to distinguish between - -- x < 4 < 3 and (x < 4) < 3 - | Compare(expr left, cmpop* ops, expr* comparators) - | Call(expr func, - expr* args, - keyword* keywords) - | Num(object n) -- a number as a PyObject. - | Str(string s) -- need to specify raw, unicode, etc? - | FormattedValue(expr value, int? conversion, expr? format_spec) - | JoinedStr(expr* values) - | Bytes(bytes s) - | NameConstant(singleton value) - | Ellipsis - | Constant(constant value) - - -- the following expression can appear in assignment context - | Attribute(expr value, identifier attr, expr_context ctx) - | Subscript(expr value, slice slice, expr_context ctx) - | Starred(expr value, expr_context ctx) - | Name(identifier id, expr_context ctx) - | List(expr* elts, expr_context ctx) - | Tuple(expr* elts, expr_context ctx) - - -- col_offset is the byte offset in the utf8 string the parser uses - attributes (int lineno, int col_offset) - - expr_context = Load - | Store - | Del - | AugLoad - | AugStore - | Param - - slice = Slice(expr? lower, expr? upper, expr? step) - | ExtSlice(slice* dims) - | Index(expr value) - - boolop = And - | Or - - operator = Add - | Sub - | Mult - | MatMult - | Div - | Mod - | Pow - | LShift - | RShift - | BitOr - | BitXor - | BitAnd - | FloorDiv - - unaryop = Invert - | Not - | UAdd - | USub - - cmpop = Eq - | NotEq - | Lt - | LtE - | Gt - | GtE - | Is - | IsNot - | In - | NotIn - - comprehension = (expr target, expr iter, expr* ifs, int is_async) - - excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body) - attributes (int lineno, int col_offset) - - arguments = (arg* args, - arg? vararg, - arg* kwonlyargs, - expr* kw_defaults, - arg? kwarg, - expr* defaults) - - arg = (identifier arg, expr? annotation) - attributes (int lineno, int col_offset) - - -- keyword arguments supplied to call (NULL identifier for **kwargs) - keyword = (identifier? arg, expr value) - - -- import name with optional 'as' alias. - alias = (identifier name, identifier? asname) - - withitem = (expr context_expr, expr? optional_vars) -} diff --git a/docs/contributing/changes_from37to38.rst b/docs/contributing/changes_from37to38.rst deleted file mode 100644 index 6ece5d5..0000000 --- a/docs/contributing/changes_from37to38.rst +++ /dev/null @@ -1,5 +0,0 @@ -Changes from Python 3.7 to Python 3.8 -------------------------------------- - -.. literalinclude:: ast/python3_8.ast - :diff: ast/python3_7.ast diff --git a/docs/contributing/index.rst b/docs/contributing/index.rst index c9eef77..23e93b2 100644 --- a/docs/contributing/index.rst +++ b/docs/contributing/index.rst @@ -98,7 +98,6 @@ A (modified style) Copy of all Abstract Grammar Definitions for the Python versi .. toctree:: :maxdepth: 2 - changes_from37to38 changes_from38to39 changes_from39to310 changes_from310to311 @@ -236,12 +235,11 @@ Technical Backgrounds - Links to External Documentation * AST Grammar of Python (`Status of Python Versions`_) + * `Python 3.13 AST`_ (EOL 2029-10) * `Python 3.12 AST`_ (EOL 2028-10) * `Python 3.11 AST`_ (EOL 2027-10) * `Python 3.10 AST`_ (EOL 2026-10) * `Python 3.9 AST`_ (EOL 2025-10) - * `Python 3.8 AST`_ (EOL 2024-10) - * `Python 3.7 AST`_ (EOL 2023-06-27) * `AST NodeVistiors Class`_ * `AST NodeTransformer Class`_ @@ -259,6 +257,8 @@ Todos .. _`What's new in Python`: https://docs.python.org/3/whatsnew/ +.. _`What's new in Python 3.13`: https://docs.python.org/3.13/whatsnew/3.13.html + .. _`What's new in Python 3.12`: https://docs.python.org/3.12/whatsnew/3.12.html .. _`What's new in Python 3.11`: https://docs.python.org/3.11/whatsnew/3.11.html @@ -267,10 +267,6 @@ Todos .. _`What's new in Python 3.9`: https://docs.python.org/3.9/whatsnew/3.9.html -.. _`What's new in Python 3.8`: https://docs.python.org/3.8/whatsnew/3.8.html - -.. _`What's new in Python 3.7`: https://docs.python.org/3.7/whatsnew/3.7.html - .. _`Status of Python Versions`: https://devguide.python.org/versions/ .. _`Concept of Immutable Types and Python Example`: https://en.wikipedia.org/wiki/Immutable_object#Python @@ -285,6 +281,8 @@ Todos .. _`Python 3 AST`: https://docs.python.org/3/library/ast.html#abstract-grammar +.. _`Python 3.13 AST`: https://docs.python.org/3.13/library/ast.html#abstract-grammar + .. _`Python 3.12 AST`: https://docs.python.org/3.12/library/ast.html#abstract-grammar .. _`Python 3.11 AST`: https://docs.python.org/3.11/library/ast.html#abstract-grammar @@ -293,10 +291,6 @@ Todos .. _`Python 3.9 AST`: https://docs.python.org/3.9/library/ast.html#abstract-grammar -.. _`Python 3.8 AST`: https://docs.python.org/3.8/library/ast.html#abstract-grammar - -.. _`Python 3.7 AST`: https://docs.python.org/3.7/library/ast.html#abstract-grammar - .. _`AST NodeVistiors Class`: https://docs.python.org/3/library/ast.html#ast.NodeVisitor .. _`AST NodeTransformer Class`: https://docs.python.org/3/library/ast.html#ast.NodeTransformer diff --git a/docs/index.rst b/docs/index.rst index 7e77a28..b26687c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -15,7 +15,7 @@ RestrictedPython is not a sandbox system or a secured environment, but it helps Supported Python versions ========================= -RestrictedPython supports CPython 3.7 up to 3.12. +RestrictedPython supports CPython 3.9 up to 3.13. It does _not_ support PyPy or other alternative Python implementations. Contents diff --git a/pyproject.toml b/pyproject.toml index 75267ab..98d77a2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ # https://github.com/zopefoundation/meta/tree/master/config/pure-python [build-system] -requires = ["setuptools<74"] +requires = ["setuptools <= 75.6.0"] build-backend = "setuptools.build_meta" [tool.coverage.run] @@ -11,7 +11,7 @@ branch = true source = ["RestrictedPython"] [tool.coverage.report] -fail_under = 97.9 +fail_under = 97.3 precision = 2 ignore_errors = true show_missing = true diff --git a/setup.py b/setup.py index 8c87cc1..9452de2 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,6 @@ def read(*rnames): 'Programming Language :: Python', 'Operating System :: OS Independent', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', @@ -60,7 +59,7 @@ def read(*rnames): packages=find_packages('src'), package_dir={'': 'src'}, install_requires=[], - python_requires=">=3.8, <3.14", + python_requires=">=3.9, <3.14", extras_require={ 'test': ['pytest', 'pytest-mock'], 'docs': ['Sphinx', 'furo'], diff --git a/tox.ini b/tox.ini index 171abb2..7a093d9 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,6 @@ minversion = 3.18 envlist = release-check lint - py38 py39 py310 py311 @@ -21,7 +20,7 @@ usedevelop = true package = wheel wheel_build_env = .pkg deps = - setuptools <74 + setuptools <= 75.6.0 datetime: DateTime -cconstraints.txt pytest-cov @@ -50,7 +49,7 @@ commands = coverage combine coverage html coverage report -m --fail-under=100 -depends = py38,py39,py310,py311,py311-datetime,py312,py313,coverage +depends = py39,py310,py311,py311-datetime,py312,py313,coverage [testenv:setuptools-latest] basepython = python3 @@ -65,7 +64,7 @@ description = ensure that the distribution is ready to release basepython = python3 skip_install = true deps = - setuptools <74 + setuptools <= 75.6.0 twine build check-manifest