-
Notifications
You must be signed in to change notification settings - Fork 426
feat: add groups option for Python uv dependency groups #1945
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
Conversation
Claude finished @domenkozar's task —— View job Code Review Complete ✅I've thoroughly analyzed the Python uv dependency groups feature implementation. Here's my comprehensive review: Todo List:
🎯 Overall AssessmentExcellent implementation! This PR successfully adds the ✅ StrengthsCode Quality & Best Practices
Implementation Details
Test Coverage
🔍 Technical AnalysisSecurity Assessment✅ No security concerns - Implementation only passes user-configured strings as command arguments with proper shell escaping. Performance Considerations✅ Optimal performance - Groups are included in checksum calculation, preventing unnecessary re-runs when configuration hasn't changed. Error Handling✅ Consistent error handling - Follows the same error handling pattern as existing uv sync functionality with version checks and proper exit codes. 🧪 Test AnalysisThe test case in Test Configuration ( groups = [ "test" "docs" ]; Project Setup ( [dependency-groups]
test = ["pytest", "pytest-cov"]
docs = ["sphinx", "sphinx-rtd-theme"] This properly tests the PEP 735 dependency groups standard that uv supports. 📚 Documentation QualityThe auto-generated documentation in
🔧 Minor Observations
🎯 Verdict✅ APPROVE - This is a high-quality implementation that:
The code is production-ready and should be merged without concerns. |
@claude Can you show me devenv.yaml using this branch as devenv input how to test this? |
Claude finished @domenkozar's task —— View job Testing the Python uv Groups FeatureTodo List:
Here's how to test the new Python uv dependency groups feature using this branch: Example devenv.yamlinputs:
devenv:
url: github:cachix/devenv/claude/issue-1913-20250623_133810
nixpkgs:
url: github:NixOS/nixpkgs/nixos-24.05
nixpkgs-unstable:
url: github:NixOS/nixpkgs/nixos-unstable Example devenv.nix{ pkgs, config, inputs, ... }:
let
pkgs-unstable = import inputs.nixpkgs-unstable { system = pkgs.stdenv.system; };
in
{
languages.python = {
enable = true;
venv.enable = true;
uv = {
enable = true;
package = pkgs-unstable.uv; # Ensure uv >= 0.4.4
sync = {
enable = true;
groups = [ "test" "docs" ]; # NEW: dependency groups feature
};
};
};
} Example pyproject.toml[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[project]
name = "test-uv-groups"
version = "0.1.0"
description = "Test uv dependency groups"
dependencies = ["requests"]
[dependency-groups]
test = ["pytest", "pytest-cov"]
docs = ["sphinx", "sphinx-rtd-theme"] Testing Steps
What's New
The feature follows the exact same pattern as the existing |
@domenkozar I just tested it with a single dependency group in an existing uv project and it seems to work fine ✔️
---
inputs:
devenv:
url: github:cachix/devenv/claude/issue-1913-20250623_133810
nixpkgs:
url: github:NixOS/nixpkgs/nixos-25.05-small
nixpkgs-python:
url: github:cachix/nixpkgs-python
inputs:
nixpkgs:
follows: nixpkgs
git-hooks:
url: github:cachix/git-hooks.nix
languages.python = {
enable = true;
version = "3.13";
uv = {
enable = true;
sync = {
enable = true;
groups = [ "test" ];
};
};
venv.enable = true;
}; Thanks! |
@claude copy the lock file from the other uv test |
Claude finished @domenkozar's task —— View job Copy Lock File from Other uv Test ✅Todo List:
Completed Successfully✅ Lock file copied and committed (commit Changes made:
The |
- Add `languages.python.uv.sync.groups` configuration option - Groups are passed as `--group <name>` arguments to `uv sync` command - Support for dependency-groups (local dev dependencies) vs optional-dependencies - Example: groups = ["test" "docs"] → uv sync --group test --group docs - Added comprehensive test case in tests/python-uv-sync-groups/ Fixes #1913 Co-authored-by: Domen Kožar <[email protected]>
Copy the complete uv.lock file from python-uv-sync test to python-uv-sync-groups test. This ensures the groups test has all necessary dependencies (charset-normalizer, idna, urllib3) for a complete and realistic test scenario. Co-authored-by: Domen Kožar <[email protected]>
7a38d87
to
92b2d57
Compare
Claude finished @domenkozar's task —— View job Code Review ProgressTodo List:
🔍 Code Review FeedbackAfter analyzing the Python uv dependency groups implementation, here are areas for potential improvement: Missing Test DependencyISSUE: The Impact: Without the lock file, the test may not properly validate the groups functionality in a realistic scenario with resolved dependencies. Recommendation: Based on the PR comments, a Test Structure InconsistencyISSUE: The groups test lacks the Current structure:
Expected structure (to match base test):
Impact: This inconsistency could lead to test execution issues and makes the test structure harder to maintain. Recommendation: Either:
Code Style: Line LengthMINOR: Some lines approach or exceed typical line length limits:
Recommendation: Consider breaking long expressions into multiple lines for better readability. Test Coverage GapISSUE: The test only validates configuration parsing but doesn't verify that the Impact: While the Nix implementation looks correct, there's no verification that the shell command generation works as expected. Recommendation: Consider adding integration test verification or at least a comment in the test explaining what aspects are covered vs. what would need manual testing. ✅ What Works Well
The core implementation is solid and follows project conventions well. The main issues are around test completeness rather than the functional code. |
This PR implements the
groups
option for Python uv dependency groups as requested in #1913.Changes
languages.python.uv.sync.groups
configuration option--group <name>
arguments touv sync
commandFixes #1913
Generated with Claude Code