-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Port to scikit-build-core #397
base: main
Are you sure you want to change the base?
Conversation
I should have ported over all build system features I was previously using and didn't run into any problems so far. Can you have a quick look over the build system? |
Amazing experience so far. This allows me to get rid of quite a few things in the build system. From a development perspective I am really pleased with the fact that I don't have to delete the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #397 +/- ##
=======================================
Coverage 82.87% 82.87%
=======================================
Files 46 46
Lines 4496 4496
=======================================
Hits 3726 3726
Misses 770 770
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
In the released version I generate the cython files and ship them as part of the sdist. These generated files get the |
FYI, 0.10 is out. It takes a bit for it to filter down everywhere (conda takes ~24 hours to pick it up), but just letting you know it's becoming available. :) |
pyproject.toml
Outdated
if.any.env.PIWHEELS_BUILD = true | ||
if.any.env.RAPIDFUZZ_BUILD_EXTENSION = true | ||
wheel.cmake = true | ||
error-message = "failed to build C++ Extension in a packaged build" |
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.
error-message = "failed to build C++ Extension in a packaged build" | |
messages.after-success = "{yellow}Failed to build C++ Extension in a packaged build, using Python fallback." |
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.
FYI, an override that never matches won't be validated, so this likely never matched in your tests.
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.
The goal was that it would:
- print a warning when falling back to the pure Python fallback in
[[tool.scikit-build.overrides]]
if.failed = true
wheel.cmake = false
so I guess this would have to be added there
- in case the environment variables are set I actually want the build to fail completely + print an error message
I don't have any tests for this in github actions yet since this requires a platform where cmake wheels are not available. Do you know an easy way to test this in github actions?
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 misunderstood your correction back then. It should certainly use messages.*
. In which context would this color actually have an effect?
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 is a success / failure message. If the override matches and the pure Python wheel is built, it "succeeds". And the color is the same color system that scikit-build-core uses, it shows up with pypa/build
directly and with buffered builders like pip if you set FORCE_COLOR
.
a8e0bc6
to
0b0e045
Compare
0b0e045
to
9fc8891
Compare
Co-authored-by: Henry Schreiner <[email protected]>
Co-authored-by: Henry Schreiner <[email protected]>
Co-authored-by: Henry Schreiner <[email protected]>
Co-authored-by: Henry Schreiner <[email protected]>
9fc8891
to
35b379a
Compare
@henryiii I took this up again and started to test the fallback handling. As a first step I did add invalid code in C++ to test the Python fallback. This falls back, but then crashes:
I did attempt a couple of other things:
my expectation here was that the second is implicitly |
Is the current state of the PR the one that produces your first traceback? Might be an issue with pyproject-metadata - I've just rewritten the way this works in pyproject-metadata, so we might get this fixed for free by upgrading. For the second one, that might be tricky. Also we produce the correct error message at the top, I should see if we can get rid of the traceback.
Isn't that still what this is asking for? The order only matters if both match, then the second replaces any fields defined (unless you set |
uv venv --python python3.13
uv pip install -e ../../scikit-build/scikit-build-core
FORCE_COLOR=1 uv build --no-build-isolation --wheel This reproduces, and you even get color in Python 3.13's traceback too! :) And something is modifying the pyproject dictionary, |
Ah, bug, and before it gets to pyproject-metadata. It's making a shallow copy but then modifying I didn't get the collision in metadata, though, what tool are you using? Ahh, uv must not call the (optional) metadata hook. Pretty sure build doesn't either. But pip does. |
@henryiii this is a first attempt at porting to
scikit-build-core
. It did work on my machine, but still has to be tested on things like android where no cmake wheels are available.