Skip to content

Add --all-groups to uv sync|run|export|tree#8892

Merged
charliermarsh merged 6 commits intoastral-sh:mainfrom
j178:all-groups
Nov 20, 2024
Merged

Add --all-groups to uv sync|run|export|tree#8892
charliermarsh merged 6 commits intoastral-sh:mainfrom
j178:all-groups

Conversation

@j178
Copy link
Copy Markdown
Contributor

@j178 j178 commented Nov 7, 2024

Summary

Closes #8594

Copy link
Copy Markdown
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

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

Exciting :)

Comment thread crates/uv-configuration/src/dev.rs Outdated
Comment on lines +68 to +81
#[derive(Debug, Clone)]
pub enum Include {
/// Include dependencies from the specified groups.
Some(Vec<GroupName>),
/// Include dependencies from all groups.
All,
}
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.

cc @charliermarsh

Just want to confirm you think this is the right structure. The parent type differs pretty significantly from ExtrasSpecification.

Comment thread crates/uv-configuration/src/dev.rs Outdated
@zanieb zanieb requested a review from charliermarsh November 7, 2024 17:35
@j178
Copy link
Copy Markdown
Contributor Author

j178 commented Nov 7, 2024

uv sync --frozen --all-groups could panic now, gonna check it tomorrow.

Comment thread crates/uv-resolver/src/lock/mod.rs Outdated
if seen.insert((&dep.package_id, Some(extra))) {
queue.push_back((dep_dist, Some(extra)));
}
for dep in root
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm struggling to find a straightforward way to make dev.iter() work with IncludeGroups::All, as it needs to be resolved to specific groups before iteration. Consequently, I changed dev.iter() to dev.contains(group), allowing DevGroupManifest to decide which groups are included. Hopefully, there is a more elegant solution than this.

@j178 j178 marked this pull request as ready for review November 8, 2024 16:47
@charliermarsh
Copy link
Copy Markdown
Member

I'll review tomorrow -- sorry for the delay.

@charliermarsh
Copy link
Copy Markdown
Member

This generally looks good. I have some ideas for addressing the comment you left around dev.iter(), etc. I'll try to merge this today.

@charliermarsh charliermarsh added the enhancement New feature or improvement to existing functionality label Nov 20, 2024

// Validate that any referenced dependency groups are defined in the workspace.
if !frozen {
let target = DependencyGroupsTarget::Workspace(&workspace);
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.

Why did this move @j178?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

by accident I think...

@charliermarsh charliermarsh enabled auto-merge (squash) November 20, 2024 15:59
@charliermarsh charliermarsh merged commit 23cc9b0 into astral-sh:main Nov 20, 2024
@j178 j178 deleted the all-groups branch November 20, 2024 16:33
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Nov 21, 2024
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.5.3` -> `0.5.4` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>astral-sh/uv (astral-sh/uv)</summary>

### [`v0.5.4`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#054)

[Compare Source](astral-sh/uv@0.5.3...0.5.4)

##### Enhancements

-   Accept either singular or plural values for CLI requirements ([#&#8203;9196](astral-sh/uv#9196))
-   Add `--all-groups` to `uv sync`, `uv run`, `uv export`, and `uv tree` ([#&#8203;8892](astral-sh/uv#8892))
-   Add a progress bar to `uv tree --outdated` and `uv pip list --outdated` ([#&#8203;9284](astral-sh/uv#9284))
-   Add retries for Python downloads ([#&#8203;9274](astral-sh/uv#9274))
-   Use exponential backoff for publish retries ([#&#8203;9276](astral-sh/uv#9276))
-   Add manylinux target triples up to glibc 2.40 ([#&#8203;9234](astral-sh/uv#9234))

##### Performance

-   Parallelize network requests in `uv tree --outdated` ([#&#8203;9280](astral-sh/uv#9280))
-   Use `zlib-rs` on all platforms ([#&#8203;9264](astral-sh/uv#9264))

##### Bug fixes

-   Avoid validating extra and group sources in `build-system.requires` ([#&#8203;9273](astral-sh/uv#9273))
-   Catch retries with wrapped `reqwest` errors ([#&#8203;9253](astral-sh/uv#9253))
-   Sort hashes in `uv export` output ([#&#8203;9237](astral-sh/uv#9237))
-   Strip `--index` and `--default-index` from command header ([#&#8203;9288](astral-sh/uv#9288))

##### Documentation

-   Add breadcrumbs to the documentation ([#&#8203;9242](astral-sh/uv#9242))
-   Add minimum version to PyTorch guide ([#&#8203;9247](astral-sh/uv#9247))
-   Add support for anchor redirects with client-side js ([#&#8203;9212](astral-sh/uv#9212))
-   Improve content on project configuration ([#&#8203;9235](astral-sh/uv#9235))
-   Improve the project creation documentation ([#&#8203;9236](astral-sh/uv#9236))
-   Move the integration guides into the "Guides" section as a collapsed group ([#&#8203;9245](astral-sh/uv#9245))
-   Reorganize the project concept documentation ([#&#8203;9121](astral-sh/uv#9121))
-   Use the full screen height for the main content to stabilize the nav ([#&#8203;9153](astral-sh/uv#9153))

##### Error messages

-   Add dedicated warning for empty stdin ([#&#8203;9256](astral-sh/uv#9256))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
tommcd pushed a commit to tommcd/doctk that referenced this pull request Nov 18, 2025
After investigating gemini-code-assist review feedback, determined that
--all-groups is actually valid and preferable:

- `uv sync --all-groups` was added in uv 0.5.4 (Nov 2024)
- See: astral-sh/uv#8892
- It's cleaner, matches setup-environment.sh, and is more maintainable
- Added clarifying comments "(dev and docs)" to show what groups exist

Changes kept from previous commit (df36f34):
✅ Fix pytest -m slow marker syntax (was incorrectly --run-slow)
✅ Use relative path doctk/ instead of /home/user/doctk/
✅ Fix markdown.py typo in writers directory (was markdown.md)
✅ Add missing imports to code example (Callable, Document, Node, Operation)

Changes reverted:
↩️  Restore --all-groups instead of --group dev --group docs

The explicit --group syntax was the reviewer's suggestion, but --all-groups
is simpler, matches actual implementation, and is now well-established.
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.

Add --all-group option to uv sync

3 participants