Implement get_project_deps and tests#853
Merged
nathanjmcdougall merged 1 commit intomainfrom Jul 14, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces the get_project_deps function to extract core dependencies from a project's pyproject.toml and adds a suite of tests to validate its behavior across various edge cases.
- Implements
get_project_depsindeps.py, handling missing files, empty or malformed sections, dependency parsing, and error conditions. - Adds comprehensive tests in
test_deps.pycovering valid dependencies (with extras and version constraints), missing sections, and invalid inputs. - Updates imports in tests to include
InvalidRequirementfor requirement parsing errors.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/usethis/_integrations/uv/test_deps.py | Added TestGetProjectDeps with tests for missing/empty sections, valid deps (extras/constraints), and error cases. |
| src/usethis/_integrations/uv/deps.py | Added get_project_deps to parse project.dependencies into Dependency models, with validation and error handling. |
Comments suppressed due to low confidence (2)
src/usethis/_integrations/uv/deps.py:28
- Update the docstring to note that version specifiers and environment markers are discarded, and only package names and extras are returned.
"""Get all project dependencies.
tests/usethis/_integrations/uv/test_deps.py:250
- [nitpick] Add a test for requirement strings containing environment markers (e.g., "package; python_version<'3.8'") to verify markers are properly ignored.
with (
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. 📢 Thoughts on this report? Let us know! |
CodSpeed Instrumentation Performance ReportMerging #853 will not alter performanceComparing Summary
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.