-
Notifications
You must be signed in to change notification settings - Fork 29
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
MAINT: attempt to move to pyproject.toml #969
Conversation
ab5a801
to
b89f6db
Compare
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.
These changes restore local builds for me and pass CI. The build time is O think much longer than the previous setup because all the variants are tested (not really bad a I guess)? But this can be easily supressed for development with additional build options e.g. CIBW_TEST_SKIP="*-*linux_{aarch64,ppc64le,s390x}"
I'm still looking at this to see if I can move as much as possible out of My most recent commit simplifies What's the story on the stuff currently in
Is that actually accomplishing anything? AFAIK, we still need to manually modify version numbers at release time? I'd love to automate that, just not sure that's what's happening here? @jakobluettgau did you contribute this originally? |
I spent some more time looking at this, and there are 2 outstanding issues on my end I'd like to better understand before merging. Both of these issues pop up for me locally when trying the steps you would typically take to build wheels -- apparently these are not an issue in our
So, building the extension apparently makes it so none of the packages (directories) in PyDarshan are included for install? Any ideas? Anyone else able to trip this locally?
|
cibuildwheel has the following block which ensures the modules are added though, so that might be why it is not an issue there:
I think the
We are not really using flake8 anymore in favor of mypy so I think we can drop this.
Defaults for pytest we can move to pyproject.toml, but these I think we can just discard completely. |
Thanks for the details. Maybe just focusing on this for now for simplicity:
Here's my steps on a clean checkout of Darshan
Note, I changed the build reqs in
This has certainly worked for me in the past...no idea what's changed. |
Eh, it seems that pip (or setuptools, whatever) is copying everything in the pydarshan directory into a temporary folder in
I'm not sure in what circumstances the above would have worked -- I thought it worked for me at some point, but it doesn't now and I don't see any evidence that this sort of behavior ever changed, so maybe I'm not remembering properly. I really don't understand how the Ignoring how So, I think my inclination is to just do something simple here and stop worrying about this problem. I propose:
|
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.
Eh, it seems that pip (or setuptools, whatever) is copying everything in the pydarshan directory into a temporary folder in /tmp before running setup.py.
That sounds like build isolation, which has been the default for pip
wheel building for some time now. You can of course disable it with i.e., --no-build-isolation
or use of PIP_NO_BUILD_ISOLATION=true
in CIBW_ENVIRONMENT
. A lot of the design issues seem to stem from the Python project being inside of the compiled project instead of the Python build system being in charge of the entire build from top-level. I know we've discussed that before, and there's likely no appetite to change that arrangement, for good reason, but obviously the Python build infra is designed around a Python project at the top level.
Anyone else able to trip this locally?
Sure, I can repro the error on this branch with PYDARSHAN_BUILD_EXT=1 python -m pip install -v .
, with or without build isolation active. The linker can't find the built darshan-util
library (I can't blame it, in almost all cases, Python projects contain their C code rather than the C code lib containing them).
That said, I was able to shim around that problem fairly easily, so you could probably do that in cibuildwheel
if you wanted, without having to disable build isolation: LIBRARY_PATH=/Users/treddy/installs/darshan_install/lib PYDARSHAN_BUILD_EXT=1 python -m pip install -v .
(it still has the warnings, but the error/failure seems to go away).
I did notice that pip install -v .
seems less problematic on this branch vs. main
, which was the original PR motivation I think, so that does seem better.
I'm not exactly sure what final issues remain here, since cibuildwheel
is actually working? If the remaining issue is pip install -v .
locally, perhaps LIBRARY_PATH
hack can do the trick for now for folks who don't just go manually and follow the regular CI steps.
As for the version updating, I usually just do that manually upstream, but reducing the number of places where you do it sounds good to me.
Oh, shoot. I missed one key step from our github workflow: If I run that, then In any case, as you guys point out, this is all working on I think I'll still take a stab at reducing setup.cfg and maybe seeing if there's something that could be done related to versioning. At the very least, reducing it down to a single value in the pyproject.toml would be nice. |
Looks like we can just maintain a single value in I added that here. Assuming CI passes, I think I'll call this PR done, unless you guys have more feedback. |
Inspired by recent CI failures (presumably from setuptools 69.0.0 and PEP621), I tried to move most of our project metadata to
pyproject.toml
. I'm getting some test failures locally but want to see how CI looks here.