From c58f5049a8cee28c5de792bd805360813369e390 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 11 May 2022 16:50:27 -0400 Subject: [PATCH 1/4] refactor: use flit as a backend Signed-off-by: Henry Schreiner --- pyproject.toml | 41 ++++++++++++++++++++++++++++-- setup.cfg | 3 --- setup.py | 69 -------------------------------------------------- 3 files changed, 39 insertions(+), 74 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index ffb0dafa..d6e98f36 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,38 @@ [build-system] -requires = ['setuptools >= 40.8.0', 'wheel'] -build-backend = 'setuptools.build_meta' +requires = ["flit_core >=3.3"] +build-backend = "flit_core.buildapi" + + +[project] +name = "packaging" +description = "Core utilities for Python packages" +version = "21.4.dev0" +readme = "README.rst" +requires-python = ">=3.7" +authors = [{name = "Donald Stufft", email = "donald@stufft.io"}] +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 :: 3.11", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", +] +urls.Source = "https://github.com/pypa/packaging" +dependencies = [] + + +[tool.flit.sdist] +include = ["LICENSE*", "tests/", "docs/"] +exclude = ["docs/_build", "tests/manylinux/build-hello-world.sh", "tests/musllinux/build.sh", "tests/hello-world.c", "tests/__pycache__", "build/__pycache__"] [tool.coverage.run] @@ -19,3 +51,8 @@ enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] [[tool.mypy.overrides]] module = ["_manylinux"] ignore_missing_imports = true + + +[tool.isort] +profile = "black" +combine_as_imports = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index c97a4e44..00000000 --- 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 b81d6330..00000000 --- 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", - 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 :: 3.11", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - ], - packages=["packaging"], - package_data={"packaging": ["py.typed"]}, -) From 6fde6451fc50ee69431823a8f27dcd118ad92dec Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Sat, 16 Jul 2022 09:03:43 -0500 Subject: [PATCH 2/4] chore: remove MANIFEST.in Signed-off-by: Henry Schreiner --- MANIFEST.in | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index f481a3fe..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,23 +0,0 @@ -include CHANGELOG.rst CONTRIBUTING.rst README.rst -include LICENSE LICENSE.APACHE LICENSE.BSD - -include .coveragerc -include .flake8 -include .pre-commit-config.yaml - -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 From 23503bb252d709578f6d99f2662b5d0979c46e9a Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 25 Aug 2022 00:19:36 -0400 Subject: [PATCH 3/4] fix: address review feedback for urls table Signed-off-by: Henry Schreiner --- pyproject.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d6e98f36..c535634e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,9 +26,11 @@ classifiers = [ "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] -urls.Source = "https://github.com/pypa/packaging" dependencies = [] +[project.urls] +Source = "https://github.com/pypa/packaging" + [tool.flit.sdist] include = ["LICENSE*", "tests/", "docs/"] From 75bae36b87b03117d2706403ca15bc0c953954e1 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Fri, 26 Aug 2022 19:05:32 -0400 Subject: [PATCH 4/4] Update pyproject.toml Co-authored-by: Brett Cannon --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index c535634e..fb60c83a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,6 +29,7 @@ classifiers = [ dependencies = [] [project.urls] +Documentation = "https://packaging.pypa.io/" Source = "https://github.com/pypa/packaging"