Skip to content

Avoid prepare_metadata_for_build_wheel calls for Hatch packages with dynamic dependencies#2645

Merged
charliermarsh merged 1 commit intomainfrom
charlie/dynamic
Mar 25, 2024
Merged

Avoid prepare_metadata_for_build_wheel calls for Hatch packages with dynamic dependencies#2645
charliermarsh merged 1 commit intomainfrom
charlie/dynamic

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

@charliermarsh charliermarsh commented Mar 25, 2024

Summary

Hatch allows for highly dynamic customization of metadata via hooks. In such cases, Hatch
can't upload the PEP 517 contract, in that the metadata Hatch would return by
prepare_metadata_for_build_wheel isn't guaranteed to match that of the built wheel.

Hatch disables prepare_metadata_for_build_wheel entirely for pip. We'll instead disable
it on our end when metadata is defined as "dynamic" in the pyproject.toml, which should
allow us to leverage the hook in most cases while still avoiding incorrect metadata for
the remaining cases.

Closes: #2130.

@charliermarsh
Copy link
Copy Markdown
Member Author

Just the failing test to start.

Comment thread scripts/packages/hatch_dynamic/requirements-cli.txt Outdated
Comment thread crates/uv-build/src/lib.rs Outdated
@zanieb zanieb added bug Something isn't working compatibility Compatibility with a specification or another tool labels Mar 25, 2024
@charliermarsh charliermarsh enabled auto-merge (squash) March 25, 2024 22:22
@charliermarsh charliermarsh changed the title Avoid prepare_metadata_for_build_wheel calls for dynamic dependencies Avoid prepare_metadata_for_build_wheel calls for Hatch packages with dynamic dependencies Mar 25, 2024
@charliermarsh charliermarsh disabled auto-merge March 25, 2024 22:23
@charliermarsh charliermarsh enabled auto-merge (squash) March 25, 2024 22:23
@charliermarsh charliermarsh merged commit 5270624 into main Mar 25, 2024
@charliermarsh charliermarsh deleted the charlie/dynamic branch March 25, 2024 22:26
@potiuk
Copy link
Copy Markdown

potiuk commented Mar 26, 2024

Installed uv from main and I confirm it fixes the issue. Both - local installation from "file://" and remote via URL work.

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

Labels

bug Something isn't working compatibility Compatibility with a specification or another tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The "standard" installation use pyproject.toml in UV rather than dynamic dependencies via build hooks (comparing to PIP)

4 participants