diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f6087fb..120923f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,8 +41,8 @@ jobs: with: persist-credentials: false - name: Install uv + caching - # astral/setup-uv@7.1.4 - uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 + # astral/setup-uv@7.2.1 + uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41 with: enable-cache: true cache-dependency-glob: | @@ -51,11 +51,7 @@ jobs: python-version: ${{ matrix.config[0] }} github-token: ${{ secrets.GITHUB_TOKEN }} - name: Test - if: ${{ !startsWith(runner.os, 'Mac') }} run: uvx --with tox-uv tox -e ${{ matrix.config[1] }} - - name: Test (macOS) - if: ${{ startsWith(runner.os, 'Mac') }} - run: uvx --with tox-uv tox -e ${{ matrix.config[1] }}-universal2 - name: Coverage if: matrix.config[1] == 'coverage' run: | diff --git a/.meta.toml b/.meta.toml index aeffa7f..88736ba 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python [meta] template = "pure-python" -commit-id = "76e81852" +commit-id = "c0ec1387" [python] with-windows = false diff --git a/CHANGES.rst b/CHANGES.rst index ec82cb6..8ffa5e0 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,8 @@ 7.1 (unreleased) ================ +- Move package metadata from setup.py to pyproject.toml. + - Add support for Python 3.14. - Drop support for Python 3.9. diff --git a/docs/conf.py b/docs/conf.py index 18b67ba..50a77c0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,12 +14,12 @@ import os import sys - -import pkg_resources +from datetime import datetime +from importlib import metadata sys.path.append(os.path.abspath('../src')) -rqmt = pkg_resources.require('zope.contentprovider')[0] +rqmt = metadata.distribution('zope.contentprovider') # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the @@ -46,7 +46,7 @@ templates_path = ['_templates'] # The suffix of source filenames. -source_suffix = '.rst' +source_suffix = {'.rst': 'restructuredtext'} # The encoding of source files. # source_encoding = 'utf-8-sig' @@ -56,7 +56,7 @@ # General information about the project. project = 'zope.contentprovider' -copyright = '2015-2024, Zope Foundation and Contributors' +copyright = f'2015-{datetime.now().year}, Zope Foundation and Contributors' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the diff --git a/pyproject.toml b/pyproject.toml index 5663ad8..91bb3cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,62 @@ # Generated with zope.meta (https://zopemeta.readthedocs.io/) from: # https://github.com/zopefoundation/meta/tree/master/src/zope/meta/pure-python - [build-system] -requires = [ - "setuptools >= 78.1.1,< 81", - "wheel", -] +requires = ["setuptools >= 78.1.1,< 81", "wheel"] build-backend = "setuptools.build_meta" + +[project] +name = "zope.contentprovider" +version = "7.1.dev0" +description = "Content Provider Framework for Zope Templates" +license = "ZPL-2.1" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Web Environment", + "Intended Audience :: Developers", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Natural Language :: English", + "Operating System :: OS Independent", + "Topic :: Internet :: WWW/HTTP", + "Framework :: Zope :: 3", +] +dynamic = ["readme"] +requires-python = ">=3.10" +authors = [ + { name = "Zope Foundation and contributors", email = "zope-dev@zope.dev" }, +] +maintainers = [ + { name = "Plone Foundation and contributors", email = "zope-dev@zope.dev" }, +] +dependencies = [ + "zope.component", + "zope.event", + "zope.interface >= 3.8", + "zope.location", + "zope.publisher", + "zope.schema", + "zope.tales", +] +keywords = ["zope3", "content", "provider"] + +[project.optional-dependencies] +test = ["zope.browserpage>=3.12", "zope.testing", "zope.testrunner >= 6.4"] +docs = ["Sphinx", "repoze.sphinx.autointerface"] + +[project.urls] +Source = "https://github.com/zopefoundation/zope.contentprovider" +Documentation = "https://zopecontentprovider.readthedocs.io/" +Issues = "https://github.com/zopefoundation/zope.contentprovider/issues" +Changelog = "https://raw.githubusercontent.com/zopefoundation/zope.contentprovider/master/CHANGES.rst" + [tool.coverage.run] branch = true source = ["zope.contentprovider"] @@ -30,3 +79,6 @@ exclude_lines = [ [tool.coverage.html] directory = "parts/htmlcov" + +[tool.setuptools.dynamic] +readme = { file = ["README.rst", "CHANGES.rst"] } diff --git a/setup.py b/setup.py index ffd3387..0b508f4 100644 --- a/setup.py +++ b/setup.py @@ -17,75 +17,8 @@ # Zope Toolkit policies as described by this documentation. ############################################################################## """Setup for zope.contentprovider package""" - -import os - from setuptools import setup -def read(*rnames): - with open(os.path.join(os.path.dirname(__file__), *rnames)) as f: - return f.read() - - -TESTS_REQUIRE = [ - 'zope.browserpage>=3.12', - 'zope.testing', - 'zope.testrunner >= 6.4', -] - - -setup( - name='zope.contentprovider', - version='7.1.dev0', - author='Zope Foundation and Contributors', - author_email='zope-dev@zope.dev', - description='Content Provider Framework for Zope Templates', - long_description=( - read('README.rst') - + '\n\n' + - read('CHANGES.rst') - ), - keywords="zope3 content provider", - classifiers=[ - 'Development Status :: 5 - Production/Stable', - 'Environment :: Web Environment', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: Zope Public License', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: 3.14', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy', - 'Natural Language :: English', - 'Operating System :: OS Independent', - 'Topic :: Internet :: WWW/HTTP', - 'Framework :: Zope :: 3', - ], - url='https://github.com/zopefoundation/zope.contentprovider', - license='ZPL-2.1', - python_requires='>=3.10', - extras_require={ - 'test': TESTS_REQUIRE, - 'docs': [ - 'Sphinx', - 'repoze.sphinx.autointerface', - ], - }, - install_requires=[ - 'setuptools', - 'zope.component', - 'zope.event', - 'zope.interface >= 3.8', - 'zope.location', - 'zope.publisher', - 'zope.schema', - 'zope.tales', - ], - include_package_data=True, - zip_safe=False, -) +# See pyproject.toml for package metadata +setup()