-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
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. :) |
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. |
yes
well I was just surprised since this means that this override triggers the rebuild feature, but the overrides which are implicitly The env variable check doesn't appear to work properly for me. As a minimum example I attempted to use:
However this didn't appear to trigger the override. So I assumed that maybe I was setting the env variable incorrectly for some reason and tried:
However this still didn't trigger the override. I would always expect one of the two versions to trigger the override.
yes this was using plain old pip |
Reported in rapidfuzz/RapidFuzz#397. Signed-off-by: Henry Schreiner <[email protected]>
Ahh, I see what you are expecting. No, this is not implicit on an override. Overrides match based on their if contents. If The env vars should work, I'll check. |
Reported in rapidfuzz/RapidFuzz#397. This avoids declaring the optional hooks if there's a good chance it can't be computed reliably. Having an override with `failed` can't be computed without trying to build. --------- Signed-off-by: Henry Schreiner <[email protected]>
[[tool.scikit-build.overrides]]
if.failed = true
+if.env.CIBUILDWHEEL = false
+if.env.CONDA_BUILD = false
+if.env.PIWHEELS_BUILD = false
+if.env.RAPIDFUZZ_BUILD_EXTENSION = false
wheel.cmake = false
messages.after-success = "failed to build C++ Extension, falling back to pure Python Extension" You need the above or it will try to build twice. We might be able to simplify this in the future by adding a "rebuilds" parameter, perhaps. |
Ahh, we don't treat a missing environment variable the same as a falsey environment variable. I think that's a bug. |
Noticed in rapidfuzz/RapidFuzz#397. Signed-off-by: Henry Schreiner <[email protected]>
Could you retry with 0.10.7? Pushed three fixes. |
allow-prereleases needs to be set for setup-python to get 3.13. |
Upgraded
|
It's great to finally have this replacement done. |
] | ||
wheel.packages = ["src/rapidfuzz"] | ||
wheel.cmake = false | ||
messages.after-success = "{yellow}Cmake unavailable, falling back to pure Python Extension" |
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.
messages.after-success = "{yellow}Cmake unavailable, falling back to pure Python Extension" | |
messages.after-success = "{yellow}CMake unavailable, falling back to pure Python Extension" |
Unnecessary stylistic nitpick. ;)
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.
Fixed :)
@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.