-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move setup configuration to pyproject.toml #2162
Conversation
3558400
to
092acd6
Compare
|
||
[project.optional-dependencies] | ||
doc = ["numpy", "nbsphinx", "scipy", "guzzle_sphinx_theme"] | ||
test = ["ipython", "nbval", "cython", "wheel"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setup.py bdist_wheel
is deprecated, you probably want to remove wheel
here and change the one test that it's needed for (test_setup_wheel_install
) to python -m build
which produces an sdist and then a wheel from the sdist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack, I'll do that in another PR though.
pyproject.toml
Outdated
"ply>=3.4", | ||
"setuptools>=61.0", | ||
"gast~=0.5.0", | ||
"numpy", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think numpy
is needed? I can build a wheel just fine with python -m build
or pip install .
, and I am not aware of the content of that wheel then depending on whether numpy
was available in the build env.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment still applies I think. For the rest, this PR now LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Numpy is a required runtime dependency of Pythran. Isn't that what's captured by that field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, these are the requirements to build a wheel only. That is (by default) done in an isolated venv, these packages won't be installed in the user's environment. So actually more is wrong. This list needs to be dependencies =
under [project]
.
The requires =
is only setuptools
, nothing else I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I point the cross-ref'd SciPy branch to a local checkout of this branch with
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -13,7 +13,7 @@ requires = [
"meson-python>=0.15.0,<0.16.0", # working with 0.15.x series at branch time
"Cython>=0.29.35,!=3.0.3,<3.1.0", # when updating version, also update check in meson.build
"pybind11>=2.10.4,<2.12.0", # working with 2.11.x series at branch time
- "pythran>=0.14.0,<0.15.0", # working with 0.14.x series at branch time
+ "pythran @ file:///home/treddy/github_projects/pythran", # local checkout of gh-2162
The distutils
error is resolved when I try python -m pip wheel -v .
, but I see another issue crop up:
[791/1606] Compiling C++ object scipy/stats/_stats_pythran.cpython-312-x86_64-linux-gnu.so.p/meson-generated_..__stats_pythran.cpp.o
FAILED: scipy/stats/_stats_pythran.cpython-312-x86_64-linux-gnu.so.p/meson-generated_..__stats_pythran.cpp.o
c++ -Iscipy/stats/_stats_pythran.cpython-312-x86_64-linux-gnu.so.p -Iscipy/stats -I../scipy/stats -I../../../../../tmp/pip-build-env-108828f2/overlay/lib/python3.12/site-packages/pythran -I../../../../../tmp/pip-build-env-108828f2/overlay/lib/python3.12/site-packages/numpy/core/include -I/home/treddy/github_projects/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-11.3.0/python-3.12.0-xqzvew4twenwzsdf2usuartrzdghpwup/include/python3.12 -fvisibility=hidden -fvisibility-inlines-hidden -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=c++14 -O3 -fPIC -DENABLE_PYTHON_MODULE -D__PYTHRAN__=3 -DPYTHRAN_BLAS_NONE -Wno-cpp -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-unused-function -Wno-unused-variable -Wno-int-in-bool-context -MD -MQ scipy/stats/_stats_pythran.cpython-312-x86_64-linux-gnu.so.p/meson-generated_..__stats_pythran.cpp.o -MF scipy/stats/_stats_pythran.cpython-312-x86_64-linux-gnu.so.p/meson-generated_..__stats_pythran.cpp.o.d -o scipy/stats/_stats_pythran.cpython-312-x86_64-linux-gnu.so.p/meson-generated_..__stats_pythran.cpp.o -c scipy/stats/_stats_pythran.cpp
In file included from scipy/stats/_stats_pythran.cpp:34:
../../../../../tmp/pip-build-env-108828f2/overlay/lib/python3.12/site-packages/pythran/pythonic/include/numpy/ceil.hpp:8:10: fatal error: xsimd/xsimd.hpp: No such file or directory
8 | #include <xsimd/xsimd.hpp>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
I believe we've been allowing xsimd
to be an optional dependency on the SciPy side, could we guard the include or?
Not quite optional - but it's either vendored within Pythran, or a transitive dependency of it. So this error should never happen, and |
@rgommers : to fit in the |
That change will break not only SciPy, but also scikit-image and any other users of |
092acd6
to
e88d6a3
Compare
I noticed that a recent push was made to this branch, and confirmed locally that the wheel build scenario described above is now successful, at least on x86_64 Linux with Python |
fee75b7
to
67a7f3c
Compare
67a7f3c
to
c22ef23
Compare
@rgommers does that look good to you know? If so @tylerjereddy could you do a final sanity check? |
LGTM now! |
The wheel build for SciPy works for me alongside this branch. Actually, I spent a bit of time working with I think I got confused by one of the responses suggesting that So this seems "good," I wonder about the non-wheel scenario a bit, where SciPy now only needs |
Thanks @rgommers & @tylerjereddy for the review and testing! 🙇 |
Related to scipy/scipy#19670