From 846283bf63ae199a4d09526509b894dac87713e1 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Mon, 17 Mar 2025 08:23:09 +0100 Subject: [PATCH 1/3] Drop support for Python 3.8. --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 62799eb..1e46acc 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,8 @@ Changelog ---------------- +- Drop support for Python 3.8. + 5.1 (2024-10-16) ---------------- From 04334d1de6070655a856284b1e782ae568d4eb1b Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Mon, 17 Mar 2025 08:23:37 +0100 Subject: [PATCH 2/3] Configuring for zope-product --- .github/workflows/pre-commit.yml | 7 +++++-- .github/workflows/tests.yml | 35 ++++++++++++++------------------ .meta.toml | 2 +- .pre-commit-config.yaml | 10 ++++----- CONTRIBUTING.md | 2 +- pyproject.toml | 16 +++++++++++++-- tox.ini | 14 ++++++------- 7 files changed, 48 insertions(+), 38 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index eb4f0c6..19e7eb4 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -15,6 +15,9 @@ env: jobs: pre-commit: + permissions: + contents: read + pull-requests: write name: linting runs-on: ubuntu-latest steps: @@ -22,12 +25,12 @@ jobs: - uses: actions/setup-python@v5 with: python-version: 3.x - - uses: pre-commit/action@v3.0.1 + - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd #v3.0.1 with: extra_args: --all-files --show-diff-on-failure env: PRE_COMMIT_COLOR: always - - uses: pre-commit-ci/lite-action@v1.0.2 + - uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 #v1.1.0 if: always() with: msg: Apply pre-commit code formatting diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4313b49..943e022 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,6 +12,9 @@ on: jobs: build: + permissions: + contents: read + pull-requests: write strategy: # We want to see all failures: fail-fast: false @@ -21,7 +24,6 @@ jobs: config: # [Python version, tox env] - ["3.11", "release-check"] - - ["3.8", "py38"] - ["3.9", "py39"] - ["3.10", "py310"] - ["3.11", "py311"] @@ -34,33 +36,26 @@ jobs: name: ${{ matrix.config[1] }} steps: - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 with: - python-version: ${{ matrix.config[0] }} - allow-prereleases: true - - name: Pip cache - uses: actions/cache@v4 + persist-credentials: false + - name: Install uv + caching + uses: astral-sh/setup-uv@v5 with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }} - restore-keys: | - ${{ runner.os }}-pip-${{ matrix.config[0] }}- - ${{ runner.os }}-pip- - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install tox + enable-cache: true + cache-dependency-glob: | + setup.* + tox.ini + python-version: ${{ matrix.matrix.config[0] }} + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Test if: ${{ !startsWith(runner.os, 'Mac') }} - run: tox -e ${{ matrix.config[1] }} + run: uvx --with tox-uv tox -e ${{ matrix.config[1] }} - name: Test (macOS) if: ${{ startsWith(runner.os, 'Mac') }} - run: tox -e ${{ matrix.config[1] }}-universal2 + run: uvx --with tox-uv tox -e ${{ matrix.config[1] }}-universal2 - name: Coverage if: matrix.config[1] == 'coverage' run: | - pip install coveralls - coveralls --service=github + uvx coveralls --service=github env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.meta.toml b/.meta.toml index 89f3e48..4d94b71 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/config/zope-product [meta] template = "zope-product" -commit-id = "93bf5454" +commit-id = "a0de4e93" [python] with-pypy = false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8d0156c..7f83638 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,25 +3,25 @@ minimum_pre_commit_version: '3.6' repos: - repo: https://github.com/pycqa/isort - rev: "5.13.2" + rev: "6.0.1" hooks: - id: isort - repo: https://github.com/hhatto/autopep8 - rev: "v2.3.1" + rev: "v2.3.2" hooks: - id: autopep8 args: [--in-place, --aggressive, --aggressive] - repo: https://github.com/asottile/pyupgrade - rev: v3.17.0 + rev: v3.19.1 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] - repo: https://github.com/isidentical/teyit rev: 0.4.3 hooks: - id: teyit - repo: https://github.com/PyCQA/flake8 - rev: "7.1.1" + rev: "7.1.2" hooks: - id: flake8 additional_dependencies: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b5c34d4..ce446a6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,7 @@ +--> # Contributing to zopefoundation projects The projects under the zopefoundation GitHub organization are open source and diff --git a/pyproject.toml b/pyproject.toml index c52b483..47bd237 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,10 @@ # https://github.com/zopefoundation/meta/tree/master/config/zope-product [build-system] -requires = ["setuptools < 74"] +requires = [ + "setuptools == 75.8.2", + "wheel", +] build-backend = "setuptools.build_meta" [tool.coverage.run] @@ -15,7 +18,16 @@ fail_under = 83 precision = 2 ignore_errors = true show_missing = true -exclude_lines = ["pragma: no cover", "pragma: nocover", "except ImportError:", "raise NotImplementedError", "if __name__ == '__main__':", "self.fail", "raise AssertionError", "raise unittest.Skip"] +exclude_lines = [ + "pragma: no cover", + "pragma: nocover", + "except ImportError:", + "raise NotImplementedError", + "if __name__ == '__main__':", + "self.fail", + "raise AssertionError", + "raise unittest.Skip", +] [tool.coverage.html] directory = "parts/htmlcov" diff --git a/tox.ini b/tox.ini index a572d92..f5fcda4 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,6 @@ minversion = 3.18 envlist = release-check lint - py38 py39 py310 py311 @@ -16,9 +15,9 @@ envlist = [testenv] skip_install = true deps = - setuptools < 74 - zc.buildout >= 3.1 - wheel > 0.37 + setuptools == 75.8.2 + zc.buildout + wheel setenv = commands_pre = {envbindir}/buildout -nc {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test @@ -29,8 +28,8 @@ commands = basepython = python3 deps = git+https://github.com/pypa/setuptools.git\#egg=setuptools - zc.buildout >= 3.1 - wheel > 0.37 + zc.buildout + wheel [testenv:release-check] @@ -38,7 +37,8 @@ description = ensure that the distribution is ready to release basepython = python3 skip_install = true deps = - setuptools < 74 + setuptools == 75.8.2 + wheel twine build check-manifest From 0fe80012dd7f8283676a349e283cb80b7db5533c Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Mon, 17 Mar 2025 08:23:59 +0100 Subject: [PATCH 3/3] Update Python version support. --- setup.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 4fde7a9..592062c 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ 'Sources': ('https://github.com/zopefoundation/' 'Products.PythonScripts'), }, - license='ZPL 2.1', + license='ZPL-2.1', description='Provides support for restricted execution of Python ' 'scripts in Zope.', author='Zope Foundation and Contributors', @@ -44,7 +44,6 @@ 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', @@ -52,7 +51,7 @@ 'Programming Language :: Python :: 3.13', 'Programming Language :: Python :: Implementation :: CPython', ], - python_requires='>=3.8', + python_requires='>=3.9', install_requires=[ 'setuptools', 'AccessControl',