Skip to content

Conversation

@charliermarsh
Copy link
Member

Summary

uv add --dev now updates the dependency-groups.dev section, rather than tool.uv.dev-dependencies -- unless the dependency is already present in tool.uv.dev-dependencies.

uv remove --dev now removes from both dependency-groups.dev and tool.uv.dev-dependencies.

--dev and --group dev are now treated equivalently in uv add and uv remove.

@charliermarsh charliermarsh force-pushed the charlie/dev-add branch 3 times, most recently from 7ea560a to 6bb37e4 Compare October 25, 2024 17:01
@charliermarsh charliermarsh requested a review from zanieb October 25, 2024 17:02
@charliermarsh
Copy link
Member Author

I do wonder if uv add --dev should just add to tool.uv.dev-dependencies if it exists but dependency-groups.dev does not. I.e., consolidate rather than creating a separate table. But I think either is fine for now to be honest.

@charliermarsh charliermarsh added the enhancement New feature or improvement to existing functionality label Oct 25, 2024
@zanieb
Copy link
Member

zanieb commented Oct 25, 2024

I do wonder if uv add --dev should just add to tool.uv.dev-dependencies if it exists but dependency-groups.dev does not. I.e., consolidate rather than creating a separate table

Yeah I think this would be "best" in that it avoids introducing two separate tables. I think we'll get questions otherwise. I don't think it's critical, but unless it was a pain I'd probably do it.

@charliermarsh
Copy link
Member Author

Na it's easy. Will fix.

@charliermarsh
Copy link
Member Author

But should uv add --group dev add to dev-dependencies in that case? Or create a separate table?

@zanieb
Copy link
Member

zanieb commented Oct 25, 2024

I think it's fine either way, but I would be a little surprised if it didn't make a separate table.

// TODO(zanieb): Once we support `remove --group`, add a warning here.
DependencyType::Group(group) => {
warn_user!(
"`{name}` is a dependency in the `{group}` group; try calling `uv remove --group {group}`",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"`{name}` is a dependency in the `{group}` group; try calling `uv remove --group {group}`",
"`{name}` is a `{group}` group dependency; try calling `uv remove --group {group}`",

This looks better into my eyes :)

@charliermarsh charliermarsh merged commit 2aa4855 into tracking/735 Oct 25, 2024
@charliermarsh charliermarsh deleted the charlie/dev-add branch October 25, 2024 18:06
@zanieb zanieb mentioned this pull request Oct 25, 2024
zanieb pushed a commit that referenced this pull request Oct 25, 2024
## Summary

`uv add --dev` now updates the `dependency-groups.dev` section, rather
than `tool.uv.dev-dependencies` -- unless the dependency is already
present in `tool.uv.dev-dependencies`.

`uv remove --dev` now removes from both `dependency-groups.dev` and
`tool.uv.dev-dependencies`.

`--dev` and `--group dev` are now treated equivalently in `uv add` and
`uv remove`.
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.

4 participants