Skip to content

Commit

Permalink
Use "build" for building
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
EliahKagan committed Sep 10, 2023
1 parent 3aacb37 commit e1d8b40
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools", "wheel"]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
Expand Down
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ black

pre-commit

build
virtualenv

pytest
Expand Down

0 comments on commit e1d8b40

Please sign in to comment.