Skip to content

fix: Find only Python3 Development.Module for the extension - #12

Open
matthewfeickert wants to merge 1 commit into
ericwait:developfrom
matthewfeickert:fix/python3-development-module
Open

matthewfeickert wants to merge 1 commit into
ericwait:developfrom
matthewfeickert:fix/python3-development-module

Conversation

@matthewfeickert

Copy link
Copy Markdown

Description

The HydraPy extension module only needs the Python headers, not libpython, but CMakeLists.txt requests find_package(Python3 COMPONENTS Development NumPy OPTIONAL). The Development component implies both Development.Module and Development.Embed, and Development.Embed requires libpython. Starting with Python 3.15, conda-forge ships libpython3.15.so in a separate libpython package rather than in python, so on Linux find_package(Python3) fails:

-- Could NOT find Python3 (missing: Python3_LIBRARIES Development Development.Embed) (found version "3.15.0")

Because the lookup is OPTIONAL, configuration still succeeds but src/c/Python is never added, so scikit-build-core's build.targets = ["HydraPy"] fails with:

ninja: error: unknown target 'HydraPy'

This PR requests only Development.Module and links Python3::Module instead of Python3::Python, which is the recommended way to build extension modules with FindPython3 (Development.Module is available since CMake 3.18). It also avoids linking the extension against libpython on 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

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Built the conda-forge feedstock with rattler-build using the linux-64, CUDA 13.4, Python 3.15 (3.15.0rc2) variant with this patch applied to v4.0.0: CMake reports Found Python3: ... found components: Development.Module NumPy Interpreter, the wheel builds, and the recipe's import tests (hydra_image_processor, HIP, Hydra) pass.
  • Without the patch, the same variant fails in conda-forge CI with the errors above, while all other Linux and Windows variants (Python 3.11–3.14, and Windows 3.15) build.

The GPU accuracy suites were not run.

Test Configuration:

  • Hardware: linux-64 (build only, no GPU)
  • SDK: CUDA 13.4, GCC 15, CMake 4.4, scikit-build-core 1.0.3

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings

🤖 Generated with Claude Code

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
@coderabbitai

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: d6ff9ed5-2c62-46a8-8cbc-7f211f481c90

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@matthewfeickert

Copy link
Copy Markdown
Author

@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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant