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

Add support for reading PEP 735 dependency groups #8104

Merged
merged 1 commit into from
Oct 16, 2024
Merged

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Oct 10, 2024

Part of #8090

As a basic first step, we parse these groups defined in pyproject.toml files.

@zanieb zanieb added compatibility Compatibility with a specification or another tool internal A refactor or improvement that is not user-facing labels Oct 10, 2024
@zanieb zanieb force-pushed the zb/735-read branch 2 times, most recently from 26e0950 to 3d82281 Compare October 10, 2024 21:14
@zanieb zanieb marked this pull request as ready for review October 10, 2024 21:19
crates/uv-workspace/src/pyproject.rs Outdated Show resolved Hide resolved
crates/uv-workspace/src/pyproject_mut.rs Outdated Show resolved Hide resolved
@@ -43,6 +43,8 @@ pub struct PyProjectToml {
pub project: Option<Project>,
/// Tool-specific metadata.
pub tool: Option<Tool>,
/// Non-project dependency groups, as defined in PEP 735.
pub dependency_groups: Option<BTreeMap<ExtraName, Vec<String>>>,
Copy link
Member

@konstin konstin Oct 15, 2024

Choose a reason for hiding this comment

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

I'd put it in a newtype so we can implement a get_group_resolved on top of it. PyO3/pyproject-toml-rs#24 is good reference implementation, we can reuse it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll add support for the include-group syntax separately. This just copies our existing patterns.

I can hold of on merging though since it'd break people using the syntax.

Copy link
Member Author

@zanieb zanieb Oct 15, 2024

Choose a reason for hiding this comment

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

Honestly pretty hesitant to change the pattern here? We probably want to change all the structures separately if you want a different approach.

Copy link
Member

Choose a reason for hiding this comment

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

We're using both styles in uv, it's not that much of a difference in the end

@zanieb zanieb changed the base branch from main to tracking/735 October 16, 2024 21:33
@zanieb zanieb merged commit 34153e9 into tracking/735 Oct 16, 2024
61 checks passed
@zanieb zanieb deleted the zb/735-read branch October 16, 2024 21:34
@zanieb zanieb mentioned this pull request Oct 17, 2024
zanieb added a commit that referenced this pull request Oct 18, 2024
Part of #8090

As a basic first step, we parse these groups defined in `pyproject.toml`
files.
charliermarsh pushed a commit that referenced this pull request Oct 20, 2024
Part of #8090

As a basic first step, we parse these groups defined in `pyproject.toml`
files.
charliermarsh pushed a commit that referenced this pull request Oct 22, 2024
Part of #8090

As a basic first step, we parse these groups defined in `pyproject.toml`
files.
charliermarsh pushed a commit that referenced this pull request Oct 22, 2024
Part of #8090

As a basic first step, we parse these groups defined in `pyproject.toml`
files.
charliermarsh pushed a commit that referenced this pull request Oct 23, 2024
Part of #8090

As a basic first step, we parse these groups defined in `pyproject.toml`
files.
charliermarsh pushed a commit that referenced this pull request Oct 25, 2024
Part of #8090

As a basic first step, we parse these groups defined in `pyproject.toml`
files.
zanieb added a commit that referenced this pull request Oct 25, 2024
Part of #8090

As a basic first step, we parse these groups defined in `pyproject.toml`
files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with a specification or another tool internal A refactor or improvement that is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants