-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add hint when Python downloads are disabled #14522
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 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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
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 |
|---|---|---|
|
|
@@ -164,15 +164,15 @@ fn python_pin() { | |
| // (skip on Windows because the snapshot is different and the behavior is not platform dependent) | ||
| #[cfg(unix)] | ||
| { | ||
| uv_snapshot!(context.filters(), context.python_pin().arg("pypy"), @r###" | ||
| uv_snapshot!(context.filters(), context.python_pin().arg("pypy"), @r" | ||
| success: true | ||
| exit_code: 0 | ||
| ----- stdout ----- | ||
| Updated `.python-version` from `[PYTHON-3.11]` -> `pypy` | ||
|
|
||
| ----- stderr ----- | ||
| warning: No interpreter found for PyPy in managed installations or search path | ||
| "###); | ||
| "); | ||
|
|
||
| let python_version = context.read(PYTHON_VERSION_FILENAME); | ||
| assert_snapshot!(python_version, @r###" | ||
|
|
@@ -361,15 +361,15 @@ fn python_pin_global_creates_parent_dirs() { | |
| fn python_pin_no_python() { | ||
| let context: TestContext = TestContext::new_with_versions(&[]); | ||
|
|
||
| uv_snapshot!(context.filters(), context.python_pin().arg("3.12"), @r###" | ||
| uv_snapshot!(context.filters(), context.python_pin().arg("3.12"), @r" | ||
| success: true | ||
| exit_code: 0 | ||
| ----- stdout ----- | ||
| Pinned `.python-version` to `3.12` | ||
|
|
||
| ----- stderr ----- | ||
| warning: No interpreter found for Python 3.12 in managed installations or search path | ||
| "###); | ||
| "); | ||
| } | ||
|
|
||
| #[test] | ||
|
|
@@ -448,15 +448,15 @@ fn python_pin_compatible_with_requires_python() -> Result<()> { | |
| "###); | ||
|
|
||
| // Request a version that is compatible and uses a Python variant | ||
| uv_snapshot!(context.filters(), context.python_pin().arg("3.13t"), @r###" | ||
| uv_snapshot!(context.filters(), context.python_pin().arg("3.13t"), @r" | ||
| success: true | ||
| exit_code: 0 | ||
| ----- stdout ----- | ||
| Updated `.python-version` from `3.11` -> `3.13t` | ||
|
|
||
| ----- stderr ----- | ||
| warning: No interpreter found for Python 3.13t in [PYTHON SOURCES] | ||
| "###); | ||
| "); | ||
|
|
||
| // Request a implementation version that is compatible | ||
| uv_snapshot!(context.filters(), context.python_pin().arg("[email protected]"), @r###" | ||
|
|
@@ -587,27 +587,17 @@ fn warning_pinned_python_version_not_installed() -> Result<()> { | |
| /// We do need a Python interpreter for `--resolved` pins | ||
| #[test] | ||
| fn python_pin_resolve_no_python() { | ||
| let context: TestContext = TestContext::new_with_versions(&[]); | ||
|
|
||
| if cfg!(windows) { | ||
| uv_snapshot!(context.filters(), context.python_pin().arg("--resolved").arg("3.12"), @r###" | ||
| success: false | ||
| exit_code: 2 | ||
| ----- stdout ----- | ||
| let context: TestContext = TestContext::new_with_versions(&[]).with_filtered_python_sources(); | ||
| uv_snapshot!(context.filters(), context.python_pin().arg("--resolved").arg("3.12"), @r" | ||
| success: false | ||
| exit_code: 2 | ||
| ----- stdout ----- | ||
|
|
||
| ----- stderr ----- | ||
| error: No interpreter found for Python 3.12 in managed installations, search path, or registry | ||
| "###); | ||
| } else { | ||
| uv_snapshot!(context.filters(), context.python_pin().arg("--resolved").arg("3.12"), @r###" | ||
| success: false | ||
| exit_code: 2 | ||
| ----- stdout ----- | ||
| ----- stderr ----- | ||
| error: No interpreter found for Python 3.12 in [PYTHON SOURCES] | ||
|
|
||
| ----- stderr ----- | ||
| error: No interpreter found for Python 3.12 in managed installations or search path | ||
| "###); | ||
| } | ||
| hint: A managed Python download is available for Python 3.12, but Python downloads are set to 'never' | ||
| "); | ||
| } | ||
|
|
||
| #[test] | ||
|
|
@@ -741,14 +731,16 @@ fn python_pin_resolve() { | |
| // Request an implementation that is not installed | ||
| // (skip on Windows because the snapshot is different and the behavior is not platform dependent) | ||
| #[cfg(unix)] | ||
| uv_snapshot!(context.filters(), context.python_pin().arg("--resolved").arg("pypy"), @r###" | ||
| uv_snapshot!(context.filters(), context.python_pin().arg("--resolved").arg("pypy"), @r" | ||
| success: false | ||
| exit_code: 2 | ||
| ----- stdout ----- | ||
|
|
||
| ----- stderr ----- | ||
| error: No interpreter found for PyPy in managed installations or search path | ||
| "###); | ||
|
|
||
| hint: A managed Python download is available for PyPy, but Python downloads are set to 'never' | ||
| "); | ||
|
|
||
| let python_version = context.read(PYTHON_VERSION_FILENAME); | ||
| insta::with_settings!({ | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to also add tests for the
PythonDownloads::ManualandPythonPreference::OnlySystemhints?