diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0a43f5b..5e60f80 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,6 +29,7 @@ jobs: - ["3.12", "py312"] - ["3.13", "py313"] - ["3.14", "py314"] + - ["3.15", "py315"] - ["pypy-3.11", "pypy3"] - ["3.11", "docs"] - ["3.11", "coverage"] @@ -41,8 +42,8 @@ jobs: with: persist-credentials: false - name: Install uv + caching - # astral/setup-uv@7.2.0 - uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b + # astral/setup-uv@8.1.0 + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b with: enable-cache: true cache-dependency-glob: | @@ -58,3 +59,32 @@ jobs: uvx coveralls --service=github env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Build package artifacts + if: > + matrix.os[0] == 'ubuntu' + && matrix.config[1] == 'py314' + run: | + rm -f dist/* + pip install -U packaging "setuptools >= 78.1.1,< 82" wheel twine + python setup.py sdist + python setup.py bdist_wheel + + - name: Upload package wheel + if: > + matrix.os[0] == 'ubuntu' + && matrix.config[1] == 'py314' + uses: actions/upload-artifact@v7 + with: + name: zope.formlib.whl + path: dist/*whl + + - name: Upload package source distribution + if: > + matrix.os[0] == 'ubuntu' + && matrix.config[1] == 'py314' + uses: actions/upload-artifact@v7 + with: + name: zope.formlib.tar.gz + path: dist/*gz + diff --git a/.gitignore b/.gitignore index 2596a59..188120b 100644 --- a/.gitignore +++ b/.gitignore @@ -28,5 +28,6 @@ lib64 log/ parts/ pyvenv.cfg +share/ testing.log var/ diff --git a/.meta.toml b/.meta.toml index a7974a2..2c796bb 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,15 +2,16 @@ # https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python [meta] template = "pure-python" -commit-id = "f6df9072" +commit-id = "516c594a" [python] with-pypy = true with-docs = true with-sphinx-doctests = false with-windows = false -with-future-python = false +with-future-python = true with-macos = false +with-free-threaded-python = false [coverage] fail-under = 93 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 56fecdb..d2d5029 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ minimum_pre_commit_version: '3.6' repos: - repo: https://github.com/pycqa/isort - rev: "7.0.0" + rev: "8.0.1" hooks: - id: isort - repo: https://github.com/hhatto/autopep8 @@ -20,6 +20,7 @@ repos: rev: 0.4.3 hooks: - id: teyit + language_version: python3.13 - repo: https://github.com/PyCQA/flake8 rev: "7.3.0" hooks: diff --git a/CHANGES.rst b/CHANGES.rst index 346fdb1..b5efeb2 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -9,6 +9,8 @@ - Add support for Python 3.14. +- Fix tests to accommodate the changed ``pprint`` output on Python 3.15. + - Drop support for Python 3.9. diff --git a/pyproject.toml b/pyproject.toml index a06c1b3..2a18db4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,12 +2,11 @@ # https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python [build-system] requires = [ - "setuptools >= 78.1.1,< 81", + "setuptools >= 78.1.1,< 82", "wheel", ] build-backend = "setuptools.build_meta" - [project] name = "zope.formlib" version = "7.1.dev0" @@ -40,7 +39,6 @@ maintainers = [ {name = "Plone Foundation and contributors",email = "zope-dev@zope.dev"}, ] dependencies = [ - "setuptools", "pytz", "zope.browser>=1.1", "zope.browserpage>=3.11.0", diff --git a/setup.cfg b/setup.cfg index cc2c247..626fbdb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,5 @@ # Generated with zope.meta (https://zopemeta.readthedocs.io/) from: # https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python - [flake8] doctests = 1 # F401 imported but unused diff --git a/src/zope/formlib/tests/test_formlib.py b/src/zope/formlib/tests/test_formlib.py index 7abc8ef..a588db6 100644 --- a/src/zope/formlib/tests/test_formlib.py +++ b/src/zope/formlib/tests/test_formlib.py @@ -11,6 +11,7 @@ # ############################################################################## +import re import unittest import pytz @@ -767,6 +768,16 @@ def test_suite(): '../form.rst', setUp=formSetUp, tearDown=tearDown, optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS, + # Python 3.15 changed pprint to put each item of a wrapped + # collection on its own line, indent it, and append a trailing + # comma after the last item. Normalize the whitespace around + # brackets and drop the trailing comma so the expected output + # matches on all supported Python versions. + checker=zope.testing.renormalizing.RENormalizing([ + (re.compile(r',(\s*[}\])])'), r'\1'), + (re.compile(r'([{[(])\s+'), r'\1'), + (re.compile(r'\s+([}\])])'), r'\1'), + ]), ), doctest.DocTestSuite(setUp=formSetUp, tearDown=tearDown), doctest.DocTestSuite('zope.formlib.errors'), diff --git a/tox.ini b/tox.ini index 76e739f..a0b7ab0 100644 --- a/tox.ini +++ b/tox.ini @@ -10,6 +10,7 @@ envlist = py312 py313 py314 + py315 pypy3 docs coverage @@ -18,8 +19,9 @@ envlist = usedevelop = true package = wheel wheel_build_env = .pkg +pip_pre = py315: true deps = - setuptools >= 78.1.1,< 81 + setuptools >= 78.1.1,< 82 setenv = ZOPE_INTERFACE_STRICT_IRO=1 commands = @@ -37,12 +39,12 @@ description = ensure that the distribution is ready to release basepython = python3 skip_install = true deps = - setuptools >= 78.1.1,< 81 + setuptools >= 78.1.1,< 82 wheel twine build check-manifest - check-python-versions >= 0.20.0 + check-python-versions >= 0.24.2 wheel commands_pre = commands =