From 9372bdb9f1860dc3cec52dbc613ce5aa258523ef Mon Sep 17 00:00:00 2001 From: Ashley Whetter Date: Sat, 3 Apr 2021 18:39:08 -0700 Subject: [PATCH] Package with PEP-517 --- CHANGELOG.rst | 1 + autoapi/__init__.py | 9 +++-- autoapi/_version.py | 2 - docs/maintenance/release-process.rst | 2 +- pyproject.toml | 3 ++ setup.cfg | 57 +++++++++++++++++++++++++++- setup.py | 47 ----------------------- tox.ini | 1 + 8 files changed, 67 insertions(+), 55 deletions(-) delete mode 100644 autoapi/_version.py create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0a6eafc..3ad621c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -32,6 +32,7 @@ Trivial/Internal Changes * Fixed ``FutureWarning`` for ``Node.traverse()`` becoming an iterator instead of list. * New example implementation of ``autoapi-skip-member`` Sphinx event. * Can run tests with tox 4. +* Updated packaging to use PEP-517. V1.7.0 (2021-01-31) diff --git a/autoapi/__init__.py b/autoapi/__init__.py index 798f90e..ada2041 100644 --- a/autoapi/__init__.py +++ b/autoapi/__init__.py @@ -1,6 +1,7 @@ -""" -Sphinx AutoAPI -""" +"""Sphinx AutoAPI""" from .extension import setup -from ._version import __version__, __version_info__ + + +__version__ = "1.7.0" +__version_info__ = (1, 7, 0) diff --git a/autoapi/_version.py b/autoapi/_version.py deleted file mode 100644 index 1562f62..0000000 --- a/autoapi/_version.py +++ /dev/null @@ -1,2 +0,0 @@ -__version_info__ = (1, 7, 0) -__version__ = ".".join(str(x) for x in __version_info__) diff --git a/docs/maintenance/release-process.rst b/docs/maintenance/release-process.rst index 8e5a731..14d3c1f 100644 --- a/docs/maintenance/release-process.rst +++ b/docs/maintenance/release-process.rst @@ -14,7 +14,7 @@ Pre-Checks Preparation ----------- -1. Update the version number in ``autoapi/_version.py``. +1. Update the version numbers in ``autoapi/__init__.py``. 2. Add any missing changelog entries. 3. Put the version number and release date into the changelog. 4. Commit and push the changes. diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..ead8162 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools>=46.4.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg index 5e40900..470832c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,57 @@ -[wheel] +[metadata] +name = sphinx-autoapi +version = attr: autoapi.__version__ +author = Eric Holscher +author_email = eric@ericholscher.com +maintainer = Ashley Whetter +maintainer_email = ashley@awhetter.co.uk +description = Sphinx API documentation generator +long_description = file: README.rst +long_description_content_type = text/x-rst +url = http://github.com/readthedocs/sphinx-autoapi +license = MIT +license_files = + LICENSE.rst +classifiers = + Development Status :: 4 - Beta + Environment :: Plugins + Framework :: Sphinx :: Extension + Intended Audience :: Developers + License :: OSI Approved :: MIT License + Natural Language :: English + Programming Language :: Python + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 +project_urls = + Documentation = https://sphinx-autoapi.readthedocs.io/en/latest/ + +[options] +packages = find: +include_package_data = True +python_requires = >=3.6 +install_requires = + astroid>=2.4 + Jinja2 + PyYAML + sphinx>=3.0 + unidecode + +[options.extras_require] +docs = + sphinx + sphinx_rtd_theme +go = + sphinxcontrib-golangdomain +dotnet = + sphinxcontrib-dotnetdomain + +[options.packages.find] +include = + autoapi + autoapi.* + +[bdist_wheel] universal = 1 diff --git a/setup.py b/setup.py deleted file mode 100644 index fa795fc..0000000 --- a/setup.py +++ /dev/null @@ -1,47 +0,0 @@ -import io - -from setuptools import setup, find_packages - -version = {} -with open("autoapi/_version.py") as fp: - exec(fp.read(), version) - -setup( - name="sphinx-autoapi", - version=version["__version__"], - author="Eric Holscher", - author_email="eric@ericholscher.com", - url="http://github.com/readthedocs/sphinx-autoapi", - license="BSD", - description="Sphinx API documentation generator", - packages=find_packages("."), - long_description=io.open("README.rst", "r", encoding="utf-8").read(), - include_package_data=True, - install_requires=[ - "astroid>=2.4", - "Jinja2", - "PyYAML", - "sphinx>=3.0", - "unidecode", - ], - extras_require={ - "docs": ["sphinx", "sphinx_rtd_theme"], - "go": ["sphinxcontrib-golangdomain"], - "dotnet": ["sphinxcontrib-dotnetdomain"], - }, - python_requires=">=3.6", - classifiers=[ - "Development Status :: 4 - Beta", - "Environment :: Plugins", - "Framework :: Sphinx :: Extension", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - ], -) diff --git a/tox.ini b/tox.ini index 9341c7b..92095d9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,4 +1,5 @@ [tox] +isolated_build = true envlist = py{36,37,38,39}-sphinx{30,31,32,33,34,35} formatting