diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index a078133d3..000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,24 +0,0 @@ -include CHANGELOG.rst CONTRIBUTING.rst README.rst -include LICENSE LICENSE.APACHE LICENSE.BSD - -include .coveragerc -include .flake8 -include .pre-commit-config.yaml -include mypy.ini - -recursive-include docs * -recursive-include tests *.py -recursive-include tests/manylinux hello-world-* -recursive-include tests/musllinux glibc-* -recursive-include tests/musllinux musl-* - -exclude noxfile.py -exclude .readthedocs.yml -exclude .travis.yml -exclude dev-requirements.txt -exclude tests/manylinux/build-hello-world.sh -exclude tests/musllinux/build.sh -exclude tests/hello-world.c - -prune docs/_build -prune tasks diff --git a/docs/conf.py b/docs/conf.py index edd8dd5cc..2dd029dcd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -41,11 +41,11 @@ base_dir = os.path.join(os.path.dirname(__file__), os.pardir) about = {} -with open(os.path.join(base_dir, "packaging", "__about__.py")) as f: +with open(os.path.join(base_dir, "packaging", "__init__.py")) as f: exec(f.read(), about) version = release = about["__version__"] -copyright = about["__copyright__"] +copyright = "2014-2019 Donald Stufft and individual contributors" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. diff --git a/packaging/__about__.py b/packaging/__about__.py deleted file mode 100644 index 0b163b80c..000000000 --- a/packaging/__about__.py +++ /dev/null @@ -1,26 +0,0 @@ -# This file is dual licensed under the terms of the Apache License, Version -# 2.0, and the BSD License. See the LICENSE file in the root of this repository -# for complete details. - -__all__ = [ - "__title__", - "__summary__", - "__uri__", - "__version__", - "__author__", - "__email__", - "__license__", - "__copyright__", -] - -__title__ = "packaging" -__summary__ = "Core utilities for Python packages" -__uri__ = "https://github.com/pypa/packaging" - -__version__ = "21.4.dev0" - -__author__ = "Donald Stufft and individual contributors" -__email__ = "donald@stufft.io" - -__license__ = "BSD-2-Clause or Apache-2.0" -__copyright__ = "2014-2019 %s" % __author__ diff --git a/packaging/__init__.py b/packaging/__init__.py index 3c50c5dcf..d9ba8229f 100644 --- a/packaging/__init__.py +++ b/packaging/__init__.py @@ -1,25 +1,5 @@ # This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. - -from .__about__ import ( - __author__, - __copyright__, - __email__, - __license__, - __summary__, - __title__, - __uri__, - __version__, -) - -__all__ = [ - "__title__", - "__summary__", - "__uri__", - "__version__", - "__author__", - "__email__", - "__license__", - "__copyright__", -] +"""Core utilities for Python packages""" +__version__ = "21.4.dev0" diff --git a/pyproject.toml b/pyproject.toml index cb37b725d..2788dfbc1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,34 @@ [build-system] -requires = ['setuptools >= 40.8.0', 'wheel'] -build-backend = 'setuptools.build_meta' +requires = ["flit_core >=2,<4"] +build-backend = "flit_core.buildapi" + +[tool.flit.metadata] +module = "packaging" +author = "Donald Stufft and individual contributors" +author-email = "donald@stufft.io" +home-page = "https://github.com/pypa/packaging" +description-file = "README.rst" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", +] +requires-python = ">=3.7" +requires = ["pyparsing>=2.0.2,!=3.0.5"] # 2.0.2 + needed to avoid issue #91 + +[tool.flit.metadata.urls] +Documentation = "https://packaging.pypa.io/" +Changelog = "https://packaging.pypa.io/en/latest/changelog.html" + +[tool.flit.sdist] +include = ["LICENSE", "LICENSE.BSD", "LICENSE.APACHE"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index c97a4e440..000000000 --- a/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[isort] -profile = black -combine_as_imports = true diff --git a/setup.py b/setup.py deleted file mode 100644 index 82ef248e4..000000000 --- a/setup.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env python -# This file is dual licensed under the terms of the Apache License, Version -# 2.0, and the BSD License. See the LICENSE file in the root of this repository -# for complete details. - -import os -import re - -# While I generally consider it an antipattern to try and support both -# setuptools and distutils with a single setup.py, in this specific instance -# where packaging is a dependency of setuptools, it can create a circular -# dependency when projects attempt to unbundle stuff from setuptools and pip. -# Though we don't really support that, it makes things easier if we do this and -# should hopefully cause less issues for end users. -try: - from setuptools import setup -except ImportError: - from distutils.core import setup - - -base_dir = os.path.dirname(__file__) - -about = {} -with open(os.path.join(base_dir, "packaging", "__about__.py")) as f: - exec(f.read(), about) - -with open(os.path.join(base_dir, "README.rst")) as f: - long_description = f.read() - -with open(os.path.join(base_dir, "CHANGELOG.rst")) as f: - # Remove :issue:`ddd` tags that breaks the description rendering - changelog = re.sub( - r":issue:`(\d+)`", - r"`#\1 `__", - f.read(), - ) - long_description = "\n".join([long_description, changelog]) - - -setup( - name=about["__title__"], - version=about["__version__"], - description=about["__summary__"], - long_description=long_description, - long_description_content_type="text/x-rst", - license=about["__license__"], - url=about["__uri__"], - author=about["__author__"], - author_email=about["__email__"], - python_requires=">=3.7", - install_requires=["pyparsing>=2.0.2,!=3.0.5"], # 2.0.2 + needed to avoid issue #91 - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "License :: OSI Approved :: BSD License", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - ], - packages=["packaging"], - package_data={"packaging": ["py.typed"]}, -)