-
Notifications
You must be signed in to change notification settings - Fork 3k
Add hint to use uv self version when uv version cannot find a project
#14738
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
afa915b
Initial plan
Copilot bfcd975
Add hint to use uv self version when pyproject.toml is missing
Copilot 0c66f2d
Address reviewer feedback: remove preview test and fix hint logic for…
Copilot ee9198c
Fix compilation errors by properly passing explicit_project parameter
Copilot 9dfb59f
Address reviewer feedback: remove duplicate error check and fix hint …
Copilot 2b7765d
Fix hint styling to use proper bold and cyan formatting
Copilot cae0ed1
Eliminate duplicate error handling by creating helper function
Copilot f7d7b69
Fix test to expect plain text hint without ANSI color codes
Copilot 92666e5
Rename function enhance_workspace_error to hint_uv_self_version
Copilot 826b07b
Make function documentation more specific
Copilot 399cf76
Use /// for function documentation comment
Copilot 0b2560d
Fix Rust code formatting lint issues
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1687,20 +1687,22 @@ fn version_get_fallback_missing_strict() -> Result<()> { | |
| Ok(()) | ||
| } | ||
|
|
||
| // Should error if this pyproject.toml is missing | ||
| // and --preview was passed explicitly. | ||
|
|
||
|
|
||
| // Should error with hint if pyproject.toml is missing in normal mode | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed the comment to use |
||
| #[test] | ||
| fn version_get_fallback_missing_strict_preview() -> Result<()> { | ||
| fn version_get_missing_with_hint() -> Result<()> { | ||
| let context = TestContext::new("3.12"); | ||
|
|
||
| uv_snapshot!(context.filters(), context.version() | ||
| .arg("--preview"), @r" | ||
| uv_snapshot!(context.filters(), context.version(), @r" | ||
| success: false | ||
| exit_code: 2 | ||
| ----- stdout ----- | ||
|
|
||
| ----- stderr ----- | ||
| error: No `pyproject.toml` found in current directory or any parent directory | ||
|
|
||
| hint: If you meant to view uv's version, use `uv self version` instead | ||
| "); | ||
|
|
||
| Ok(()) | ||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.