Skip to content

Use PEP 517 to extract non-static pyproject.toml metadata#2633

Merged
charliermarsh merged 1 commit intomainfrom
charlie/setup-ii
Mar 25, 2024
Merged

Use PEP 517 to extract non-static pyproject.toml metadata#2633
charliermarsh merged 1 commit intomainfrom
charlie/setup-ii

Conversation

@charliermarsh
Copy link
Copy Markdown
Member

Summary

When a user passes a pyproject.toml to pip compile (e.g., uv pip compile pyproject.toml), we extract the requirements from the pyproject.toml directly. However... that isn't always possible (as seen in the linked issues). When it's not, we instead need to run the PEP 517 build hooks to identify the metadata.

Closes #1624.

Closes #1644.

Test Plan

cargo test

@charliermarsh charliermarsh marked this pull request as ready for review March 23, 2024 02:04
@charliermarsh charliermarsh added the enhancement New feature or improvement to existing functionality label Mar 23, 2024
@charliermarsh charliermarsh force-pushed the charlie/setup-ii branch 11 times, most recently from a5fb6f4 to c68cf55 Compare March 23, 2024 02:36
@charliermarsh charliermarsh requested a review from zanieb March 23, 2024 02:40
Base automatically changed from charlie/setup-i to main March 23, 2024 13:33
@zanieb
Copy link
Copy Markdown
Member

zanieb commented Mar 24, 2024

Sorry I'm a little lost in all the changes lately, just want to confirm does this address #2130 as well? or was that addressed previously?

@charliermarsh
Copy link
Copy Markdown
Member Author

I don't think so, that issue surprises me but I'll look into it separately...

Comment thread crates/pep508-rs/src/marker.rs Outdated
Comment thread crates/pep508-rs/src/marker.rs Outdated
}
}

/// Remove the extras from a marker, returning `None` if the marker tree evaluates to `true`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe @BurntSushi should review this marker code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, feel free @BurntSushi.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Messaged with Andrew, I want to build on this branch (but not related to the markers) so I'm going to merge and address any review comments post-merge.

Comment thread crates/uv/tests/pip_compile.rs
Comment thread crates/uv/src/commands/pip_compile.rs
@charliermarsh charliermarsh enabled auto-merge (squash) March 25, 2024 19:57
Copy link
Copy Markdown
Member

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. :-) Nice marker tests!

@mahimairaja
Copy link
Copy Markdown

So how can we install using uv from a poetry based project.toml?

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

Labels

enhancement New feature or improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

uv pip compile does not respect tool.setuptools.dynamic dependencies uv pip compile pyproject.toml ignores dependencies declared in setup.cfg

4 participants