From 7337a5b112f4ac204aed99829ea4e14086c0b21a Mon Sep 17 00:00:00 2001 From: Branch Vincent Date: Thu, 28 Nov 2024 12:25:18 -0800 Subject: [PATCH] migrate to pyproject.toml --- .github/workflows/tests.yaml | 2 +- MANIFEST.in | 8 ---- pyproject.toml | 66 +++++++++++++++++++++++++++++++ pytest.ini | 2 - setup.py | 77 ------------------------------------ 5 files changed, 67 insertions(+), 88 deletions(-) delete mode 100644 MANIFEST.in create mode 100644 pyproject.toml delete mode 100644 pytest.ini delete mode 100644 setup.py diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 53fab480..4f6d0bac 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -47,6 +47,6 @@ jobs: uses: actions/cache@v4 with: path: ${{ steps.pip-cache.outputs.dir }} - key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }}|${{ hashFiles('requirements/*.txt') }} + key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('pyproject.toml') }}|${{ hashFiles('requirements/*.txt') }} - run: pip install tox - run: tox -e ${{ matrix.tox }} diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 52702da3..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,8 +0,0 @@ -include CHANGELOG.md -include LICENSE -include README.md -include pytest.ini -include tox.ini -recursive-include docs/* -recursive-include tests/* -prune docs/_build diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..77fdb8ac --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,66 @@ +[project] +name = "boltons" +version = "24.1.1dev" +description = "When they're not builtins, they're boltons." +readme = "README.md" +authors = [{ name = "Mahmoud Hashemi", email = "mahmoud@hatnote.com" }] +classifiers = [ + # See: https://pypi.python.org/pypi?:action=list_classifiers + "Topic :: Utilities", + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + "Topic :: Software Development :: Libraries", + "Development Status :: 5 - Production/Stable", + "Operating System :: OS Independent", + # List of python versions and their support status: + # https://en.wikipedia.org/wiki/CPython#Version_history + "Programming Language :: Python :: 3", + "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 :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", +] +requires-python = ">=3.7" +license = { file = "LICENSE" } + +[project.urls] +Homepage = "https://github.com/mahmoud/boltons" + +[tool.flit.sdist] +include = ["doc/", "tests/", "CHANGELOG.md", "tox.ini"] +exclude = ["doc/_build"] + +[tool.pytest.ini_options] +doctest_optionflags = [ + "ALLOW_UNICODE", + "ELLIPSIS", + "IGNORE_EXCEPTION_DETAIL", + "NORMALIZE_WHITESPACE", +] + +[build-system] +requires = ["flit_core >=3.2,<4"] +build-backend = "flit_core.buildapi" + +# A brief checklist for release: +# * tox +# * git commit (if applicable) +# * Bump pyproject.toml version off of -dev +# * git commit -a -m "bump version for x.y.z release" +# * rm -rf dist/* +# * python -m build +# * twine upload dist/* +# * bump docs/conf.py version +# * git commit +# * git tag -a x.y.z -m "brief summary" +# * write CHANGELOG +# * git commit +# * bump pyproject.toml version onto n+1 dev +# * git commit +# * git push diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 4049dc74..00000000 --- a/pytest.ini +++ /dev/null @@ -1,2 +0,0 @@ -[pytest] -doctest_optionflags=NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ELLIPSIS ALLOW_UNICODE diff --git a/setup.py b/setup.py deleted file mode 100644 index ecdde361..00000000 --- a/setup.py +++ /dev/null @@ -1,77 +0,0 @@ -"""Functionality that should be in the standard library. Like -builtins, but Boltons. - -Otherwise known as, "everyone's util.py," but cleaned up and -tested. - -Contains over 250 BSD-licensed utility types and functions that can be -used as a package or independently. `Extensively documented on Read -the Docs `_. -""" - -from setuptools import setup - - -__author__ = 'Mahmoud Hashemi' -__version__ = '24.1.1dev' -__contact__ = 'mahmoud@hatnote.com' -__url__ = 'https://github.com/mahmoud/boltons' -__license__ = 'BSD' - - -setup(name='boltons', - version=__version__, - description="When they're not builtins, they're boltons.", - long_description=__doc__, - author=__author__, - author_email=__contact__, - url=__url__, - packages=['boltons'], - include_package_data=True, - zip_safe=False, - license=__license__, - platforms='any', - python_requires='>=3.7', - classifiers=[ - # See: https://pypi.python.org/pypi?:action=list_classifiers - 'Topic :: Utilities', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: BSD License', - 'Topic :: Software Development :: Libraries', - 'Development Status :: 5 - Production/Stable', - 'Operating System :: OS Independent', - # List of python versions and their support status: - # https://en.wikipedia.org/wiki/CPython#Version_history - 'Programming Language :: Python :: 3', - '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 :: 3.12', - 'Programming Language :: Python :: 3.13', - 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: Implementation :: CPython', - 'Programming Language :: Python :: Implementation :: PyPy', ] - ) - -""" -A brief checklist for release: - -* tox -* git commit (if applicable) -* Bump setup.py version off of -dev -* git commit -a -m "bump version for x.y.z release" -* rm -rf dist/* -* python setup.py sdist bdist_wheel -* twine upload dist/* -* bump docs/conf.py version -* git commit -* git tag -a x.y.z -m "brief summary" -* write CHANGELOG -* git commit -* bump setup.py version onto n+1 dev -* git commit -* git push - -"""