Repository navigation
fix: Find only Python3 Development.Module for the extension - #12
matthewfeickert wants to merge 1 commit into
Conversation
The HydraPy extension module only needs the Python headers, not libpython. Requesting the full Development component also requires Development.Embed (libpython), which conda-forge ships in a separate libpython package starting with Python 3.15. Without it find_package(Python3) fails, the HydraPy target is never defined, and the build fails with "ninja: error: unknown target 'HydraPy'". Use Development.Module and link Python3::Module instead, which is the recommended way to build extension modules with FindPython. c.f. https://cmake.org/cmake/help/latest/module/FindPython3.html Assisted-by: ClaudeCode:claude-opus-5-5
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@ericwait this is just applying the patch from conda-forge/hydra-image-processor-feedstock#7 to the upstream source here. This is ready for review, but let me know if you have any questions. |
Description
The
HydraPyextension module only needs the Python headers, notlibpython, butCMakeLists.txtrequestsfind_package(Python3 COMPONENTS Development NumPy OPTIONAL). TheDevelopmentcomponent implies bothDevelopment.ModuleandDevelopment.Embed, andDevelopment.Embedrequireslibpython. Starting with Python 3.15, conda-forge shipslibpython3.15.soin a separatelibpythonpackage rather than inpython, so on Linuxfind_package(Python3)fails:Because the lookup is
OPTIONAL, configuration still succeeds butsrc/c/Pythonis never added, so scikit-build-core'sbuild.targets = ["HydraPy"]fails with:This PR requests only
Development.Moduleand linksPython3::Moduleinstead ofPython3::Python, which is the recommended way to build extension modules withFindPython3(Development.Moduleis available since CMake 3.18). It also avoids linking the extension againstlibpythonon Linux.This was found in the Python 3.15 migration of the conda-forge feedstock, conda-forge/hydra-image-processor-feedstock#7, which currently carries this change as a patch. Once this is in a release, the patch can be dropped from the feedstock.
Type of change
How Has This Been Tested?
rattler-buildusing thelinux-64, CUDA 13.4, Python 3.15 (3.15.0rc2) variant with this patch applied tov4.0.0: CMake reportsFound Python3: ... found components: Development.Module NumPy Interpreter, the wheel builds, and the recipe's import tests (hydra_image_processor,HIP,Hydra) pass.The GPU accuracy suites were not run.
Test Configuration:
Checklist:
🤖 Generated with Claude Code