Skip to content

Commit

Permalink
Use build to create wheels
Browse files Browse the repository at this point in the history
In Python 3.12, calling `python setup.py` to create wheels is deprecated;
instead, one should use a "standard-based tool" (whatever that means),
like the `build` package from PyPA.
Therefore, instead of calling `setup.py bdist_wheel`, we use `python -m
build`, which is the recommended replacement for it (as mentioned here:
https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html#summary).
Fixes #2696.
  • Loading branch information
JCGoran committed Jan 30, 2024
1 parent a710366 commit a49af49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packaging/python/build_requirements.txt
@@ -1,2 +1,4 @@
cython<3
packaging
build
setuptools_scm
4 changes: 2 additions & 2 deletions packaging/python/build_wheels.bash
Expand Up @@ -103,7 +103,7 @@ build_wheel_linux() {
# Workaround for https://github.com/pypa/manylinux/issues/1309
git config --global --add safe.directory "*"

python setup.py build_ext --cmake-prefix="/nrnwheel/ncurses;/nrnwheel/readline" --cmake-defs="$CMAKE_DEFS" $setup_args bdist_wheel
python -m build --wheel --no-isolation

# For CI runs we skip wheelhouse repairs
if [ "$SKIP_WHEELHOUSE_REPAIR" = true ] ; then
Expand Down Expand Up @@ -175,7 +175,7 @@ build_wheel_osx() {
fi
fi

python setup.py build_ext --cmake-prefix="/opt/nrnwheel/ncurses;/opt/nrnwheel/readline;/usr/x11" --cmake-defs="$CMAKE_DEFS" $setup_args bdist_wheel
python -m build --wheel --no-isolation

echo " - Calling delocate-listdeps"
delocate-listdeps dist/*.whl
Expand Down

0 comments on commit a49af49

Please sign in to comment.