-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test coverage for
--python-version
overriding UV_PYTHON
entirely
- Loading branch information
Showing
1 changed file
with
57 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -1737,13 +1737,14 @@ fn compile_python_build_version_different_than_target() -> Result<()> { | |
.arg("requirements.in") | ||
.arg("--python-version") | ||
.arg("3.12") | ||
.env(EnvVars::UV_PYTHON, "3.11") | ||
.arg("-p") | ||
.arg("[email protected]") | ||
.env_remove(EnvVars::VIRTUAL_ENV), @r###" | ||
success: true | ||
exit_code: 0 | ||
----- stdout ----- | ||
# This file was autogenerated by uv via the following command: | ||
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --python-version 3.12 | ||
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --python-version 3.12 -p [email protected] | ||
black==23.10.[X] | ||
# via -r requirements.in | ||
click==8.1.7 | ||
|
@@ -1762,18 +1763,51 @@ fn compile_python_build_version_different_than_target() -> Result<()> { | |
"### | ||
); | ||
|
||
// If we can't find the interpreter, we fail | ||
uv_snapshot!(context.filters(), context.pip_compile() | ||
.arg("requirements.in") | ||
.arg("--python-version") | ||
.arg("3.12") | ||
.arg("-p") | ||
.arg("[email protected]") | ||
.arg("[email protected]") | ||
.env_remove(EnvVars::VIRTUAL_ENV), @r###" | ||
success: false | ||
exit_code: 2 | ||
----- stdout ----- | ||
----- stderr ----- | ||
error: No interpreter found for PyPy 3.11 in [PYTHON SOURCES] | ||
"### | ||
); | ||
|
||
uv_snapshot!(context.filters(), context.pip_compile() | ||
.arg("requirements.in") | ||
.arg("--python-version") | ||
.arg("3.12") | ||
.arg("-p") | ||
.arg("3.13") | ||
.env_remove(EnvVars::VIRTUAL_ENV), @r###" | ||
success: false | ||
exit_code: 2 | ||
----- stdout ----- | ||
----- stderr ----- | ||
error: No interpreter found for Python 3.13 in [PYTHON SOURCES] | ||
"### | ||
); | ||
|
||
// `UV_PYTHON` is ignored if `--python-version` is set | ||
uv_snapshot!(context.filters(), context.pip_compile() | ||
.arg("requirements.in") | ||
.arg("--python-version") | ||
.arg("3.12") | ||
.env(EnvVars::UV_PYTHON, "3.11") | ||
.env_remove(EnvVars::VIRTUAL_ENV), @r###" | ||
success: true | ||
exit_code: 0 | ||
----- stdout ----- | ||
# This file was autogenerated by uv via the following command: | ||
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --python-version 3.12 -p [email protected] | ||
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --python-version 3.12 | ||
black==23.10.[X] | ||
# via -r requirements.in | ||
click==8.1.7 | ||
|
@@ -1792,36 +1826,33 @@ fn compile_python_build_version_different_than_target() -> Result<()> { | |
"### | ||
); | ||
|
||
// If we can't find the interpreter, we fail | ||
uv_snapshot!(context.filters(), context.pip_compile() | ||
.arg("requirements.in") | ||
.arg("--python-version") | ||
.arg("3.12") | ||
.arg("-p") | ||
.arg("[email protected]") | ||
.env_remove(EnvVars::VIRTUAL_ENV), @r###" | ||
success: false | ||
exit_code: 2 | ||
----- stdout ----- | ||
----- stderr ----- | ||
error: No interpreter found for PyPy 3.11 in [PYTHON SOURCES] | ||
"### | ||
); | ||
|
||
// `UV_PYTHON` is ignored if `--python-version` is set | ||
uv_snapshot!(context.filters(), context.pip_compile() | ||
.arg("requirements.in") | ||
.arg("--python-version") | ||
.arg("3.12") | ||
.arg("-p") | ||
.arg("3.13") | ||
.env(EnvVars::UV_PYTHON, "pypy") | ||
.env_remove(EnvVars::VIRTUAL_ENV), @r###" | ||
success: false | ||
exit_code: 2 | ||
success: true | ||
exit_code: 0 | ||
----- stdout ----- | ||
# This file was autogenerated by uv via the following command: | ||
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --python-version 3.12 | ||
black==23.10.[X] | ||
# via -r requirements.in | ||
click==8.1.7 | ||
# via black | ||
mypy-extensions==1.0.0 | ||
# via black | ||
packaging==24.0 | ||
# via black | ||
pathspec==0.12.1 | ||
# via black | ||
platformdirs==4.2.0 | ||
# via black | ||
----- stderr ----- | ||
error: No interpreter found for Python 3.13 in [PYTHON SOURCES] | ||
Resolved 6 packages in [TIME] | ||
"### | ||
); | ||
|
||
|