From e1d8b40e91eedabc3a2c2c1ac653f86b662323a9 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Sat, 9 Sep 2023 23:33:06 -0400 Subject: [PATCH] Use "build" for building Instead of directly running setup.py. This allows Python 3.12 (as well as previous versions) to be used for building. Although setuptools could be added as a development dependency to run setup.py, using "build" instead is recommended in https://setuptools.pypa.io/en/latest/userguide/quickstart.html. Those docs likewise recommend only listing "wheel" in the build-system section of pyproject.toml if setup.py actually imports the wheel module. So this removes that. (Running "make release", which now uses "build", will continue to build wheels.) The "build" package is not conceptually a testing dependency, but test-requirements.txt is currently the de facto list of all stable development dependencies for regular use. --- Makefile | 2 +- pyproject.toml | 2 +- test-requirements.txt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2af8de084..6bde85af1 100644 --- a/Makefile +++ b/Makefile @@ -16,5 +16,5 @@ release: clean force_release: clean git push --tags origin main - python3 setup.py sdist bdist_wheel + python -m build --sdist --wheel twine upload dist/* diff --git a/pyproject.toml b/pyproject.toml index 32c9d4a26..42bb31eda 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "wheel"] +requires = ["setuptools"] build-backend = "setuptools.build_meta" [tool.pytest.ini_options] diff --git a/test-requirements.txt b/test-requirements.txt index e202d35c5..67496031e 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,6 +5,7 @@ black pre-commit +build virtualenv pytest