Skip to content
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

Avoid prepare_metadata_for_build_wheel calls for Hatch packages with dynamic dependencies #2645

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

charliermarsh
Copy link
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
Member Author

Just the failing test to start.

crates/uv-build/src/lib.rs Outdated Show resolved Hide resolved
@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
31 checks passed
@charliermarsh charliermarsh deleted the charlie/dynamic branch March 25, 2024 22:26
@potiuk
Copy link

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
4 participants