diff --git a/crates/puffin/tests/pip_compile_scenarios.rs b/crates/puffin/tests/pip_compile_scenarios.rs index 110868d04..be8e727a1 100644 --- a/crates/puffin/tests/pip_compile_scenarios.rs +++ b/crates/puffin/tests/pip_compile_scenarios.rs @@ -61,6 +61,7 @@ fn requires_incompatible_python_version_compatible_override() -> Result<()> { .arg(cache_dir.path()) .env("VIRTUAL_ENV", venv.as_os_str()) .env("PUFFIN_NO_WRAP", "1") + .env("PUFFIN_PYTHON_PATH", "") .current_dir(&temp_dir), @r###" success: true exit_code: 0 @@ -70,6 +71,7 @@ fn requires_incompatible_python_version_compatible_override() -> Result<()> { albatross==1.0.0 ----- stderr ----- + warning: The requested Python version 3.11 is not available; 3.9.18 will be used to build dependencies instead. Resolved 1 package in [TIME] "###); }); @@ -121,12 +123,14 @@ fn requires_compatible_python_version_incompatible_override() -> Result<()> { .arg(cache_dir.path()) .env("VIRTUAL_ENV", venv.as_os_str()) .env("PUFFIN_NO_WRAP", "1") + .env("PUFFIN_PYTHON_PATH", "") .current_dir(&temp_dir), @r###" success: false exit_code: 1 ----- stdout ----- ----- stderr ----- + warning: The requested Python version 3.9 is not available; 3.11.7 will be used to build dependencies instead. × No solution found when resolving dependencies: ╰─▶ Because the requested Python version (3.9) does not satisfy Python>=3.10 and albatross==1.0.0 depends on Python>=3.10, we can conclude that albatross==1.0.0 cannot be used. And because you require albatross==1.0.0, we can conclude that the requirements are unsatisfiable. @@ -184,16 +188,17 @@ fn requires_incompatible_python_version_compatible_override_no_wheels() -> Resul .arg(cache_dir.path()) .env("VIRTUAL_ENV", venv.as_os_str()) .env("PUFFIN_NO_WRAP", "1") + .env("PUFFIN_PYTHON_PATH", "") .current_dir(&temp_dir), @r###" - success: true - exit_code: 0 + success: false + exit_code: 1 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile requirements.in --python-version=3.11 --extra-index-url https://test.pypi.org/simple --cache-dir [CACHE_DIR] - albatross==1.0.0 ----- stderr ----- - Resolved 1 package in [TIME] + warning: The requested Python version 3.11 is not available; 3.9.18 will be used to build dependencies instead. + × No solution found when resolving dependencies: + ╰─▶ Because the current Python version (3.9.18) does not satisfy Python>=3.10 and albatross==1.0.0 depends on Python>=3.10, we can conclude that albatross==1.0.0 cannot be used. + And because you require albatross==1.0.0, we can conclude that the requirements are unsatisfiable. "###); }); @@ -248,16 +253,17 @@ fn requires_incompatible_python_version_compatible_override_no_compatible_wheels .arg(cache_dir.path()) .env("VIRTUAL_ENV", venv.as_os_str()) .env("PUFFIN_NO_WRAP", "1") + .env("PUFFIN_PYTHON_PATH", "") .current_dir(&temp_dir), @r###" - success: true - exit_code: 0 + success: false + exit_code: 1 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile requirements.in --python-version=3.11 --extra-index-url https://test.pypi.org/simple --cache-dir [CACHE_DIR] - albatross==1.0.0 ----- stderr ----- - Resolved 1 package in [TIME] + warning: The requested Python version 3.11 is not available; 3.9.18 will be used to build dependencies instead. + × No solution found when resolving dependencies: + ╰─▶ Because the current Python version (3.9.18) does not satisfy Python>=3.10 and albatross==1.0.0 depends on Python>=3.10, we can conclude that albatross==1.0.0 cannot be used. + And because you require albatross==1.0.0, we can conclude that the requirements are unsatisfiable. "###); }); @@ -317,16 +323,25 @@ fn requires_incompatible_python_version_compatible_override_other_wheel() -> Res .arg(cache_dir.path()) .env("VIRTUAL_ENV", venv.as_os_str()) .env("PUFFIN_NO_WRAP", "1") + .env("PUFFIN_PYTHON_PATH", "") .current_dir(&temp_dir), @r###" - success: true - exit_code: 0 + success: false + exit_code: 1 ----- stdout ----- - # This file was autogenerated by Puffin v[VERSION] via the following command: - # puffin pip compile requirements.in --python-version=3.11 --extra-index-url https://test.pypi.org/simple --cache-dir [CACHE_DIR] - albatross==1.0.0 ----- stderr ----- - Resolved 1 package in [TIME] + warning: The requested Python version 3.11 is not available; 3.9.18 will be used to build dependencies instead. + × No solution found when resolving dependencies: + ╰─▶ Because the current Python version (3.9.18) does not satisfy Python>=3.10 and albatross==1.0.0 depends on Python>=3.10, we can conclude that albatross==1.0.0 cannot be used. + And because there are no versions of albatross that satisfy any of: + albatross<1.0.0 + albatross>1.0.0,<2.0.0 + albatross>2.0.0 + we can conclude that albatross<2.0.0 cannot be used. (1) + + Because the requested Python version (3.11) does not satisfy Python>=3.12 and albatross==2.0.0 depends on Python>=3.12, we can conclude that albatross==2.0.0 cannot be used. + And because we know from (1) that albatross<2.0.0 cannot be used, we can conclude that all versions of albatross cannot be used. + And because you require albatross, we can conclude that the requirements are unsatisfiable. "###); }); @@ -379,6 +394,7 @@ fn requires_python_patch_version_override_no_patch() -> Result<()> { .arg(cache_dir.path()) .env("VIRTUAL_ENV", venv.as_os_str()) .env("PUFFIN_NO_WRAP", "1") + .env("PUFFIN_PYTHON_PATH", "") .current_dir(&temp_dir), @r###" success: false exit_code: 1 @@ -438,6 +454,7 @@ fn requires_python_patch_version_override_patch_compatible() -> Result<()> { .arg(cache_dir.path()) .env("VIRTUAL_ENV", venv.as_os_str()) .env("PUFFIN_NO_WRAP", "1") + .env("PUFFIN_PYTHON_PATH", "") .current_dir(&temp_dir), @r###" success: true exit_code: 0 diff --git a/scripts/scenarios/templates/compile.mustache b/scripts/scenarios/templates/compile.mustache index 44e004feb..45aab4b08 100644 --- a/scripts/scenarios/templates/compile.mustache +++ b/scripts/scenarios/templates/compile.mustache @@ -69,6 +69,7 @@ fn {{module_name}}() -> Result<()> { .arg(cache_dir.path()) .env("VIRTUAL_ENV", venv.as_os_str()) .env("PUFFIN_NO_WRAP", "1") + .env("PUFFIN_PYTHON_PATH", "") .current_dir(&temp_dir), @r###" "###); });