diff --git a/crates/uv-client/src/html.rs b/crates/uv-client/src/html.rs index 826217c50..09d417acd 100644 --- a/crates/uv-client/src/html.rs +++ b/crates/uv-client/src/html.rs @@ -173,7 +173,7 @@ impl SimpleHtml { let filename = urlencoding::decode(filename) .map_err(|_| Error::UnsupportedFilename(filename.to_string()))?; - // Extract the `requires-python` field, which should be set on the + // Extract the `requires-python` value, which should be set on the // `data-requires-python` attribute. let requires_python = if let Some(requires_python) = link.attributes().get("data-requires-python").flatten() diff --git a/crates/uv-resolver/src/pubgrub/report.rs b/crates/uv-resolver/src/pubgrub/report.rs index d2fe410ec..d95a07add 100644 --- a/crates/uv-resolver/src/pubgrub/report.rs +++ b/crates/uv-resolver/src/pubgrub/report.rs @@ -829,7 +829,7 @@ impl std::fmt::Display for PubGrubHint { } => { write!( f, - "{}{} The `Requires-Python` requirement ({}) includes Python versions that are not supported by your dependencies (e.g., {} only supports {}). Consider using a more restrictive `Requires-Python` requirement (like {}).", + "{}{} The `requires-python` value ({}) includes Python versions that are not supported by your dependencies (e.g., {} only supports {}). Consider using a more restrictive `requires-python` value (like {}).", "hint".bold().cyan(), ":".bold(), requires_python.bold(), diff --git a/crates/uv-resolver/src/requires_python.rs b/crates/uv-resolver/src/requires_python.rs index 41ae5ef80..f1b3f7d57 100644 --- a/crates/uv-resolver/src/requires_python.rs +++ b/crates/uv-resolver/src/requires_python.rs @@ -29,7 +29,7 @@ pub struct RequiresPython { /// The supported Python versions as provides by the user, usually through the `requires-python` /// field in `pyproject.toml`. /// - /// For a workspace, it's the union of all `requires-python` fields in the workspace. If no + /// For a workspace, it's the union of all `requires-python` values in the workspace. If no /// bound was provided by the user, it's greater equal the current Python version. specifiers: VersionSpecifiers, /// The lower bound from the `specifiers` field, i.e. greater or greater equal the lowest diff --git a/crates/uv/src/commands/project/lock.rs b/crates/uv/src/commands/project/lock.rs index 7a7d21ed5..aa5cd8883 100644 --- a/crates/uv/src/commands/project/lock.rs +++ b/crates/uv/src/commands/project/lock.rs @@ -224,13 +224,13 @@ pub(super) async fn do_lock( if requires_python.is_unbounded() { let default = RequiresPython::greater_than_equal_version(&interpreter.python_minor_version()); - warn_user!("The workspace `requires-python` field does not contain a lower bound: `{requires_python}`. Set a lower bound to indicate the minimum compatible Python version (e.g., `{default}`)."); + warn_user!("The workspace `requires-python` value does not contain a lower bound: `{requires_python}`. Set a lower bound to indicate the minimum compatible Python version (e.g., `{default}`)."); } requires_python } else { let default = RequiresPython::greater_than_equal_version(&interpreter.python_minor_version()); - warn_user!("No `requires-python` field found in the workspace. Defaulting to `{default}`."); + warn_user!("No `requires-python` value found in the workspace. Defaulting to `{default}`."); default }; diff --git a/crates/uv/src/commands/python/pin.rs b/crates/uv/src/commands/python/pin.rs index 9b28e4913..fd07aa2f8 100644 --- a/crates/uv/src/commands/python/pin.rs +++ b/crates/uv/src/commands/python/pin.rs @@ -274,7 +274,7 @@ fn assert_pin_compatible_with_project(pin: &Pin, virtual_project: &VirtualProjec }; Err(anyhow::anyhow!( - "The {given} Python version `{}`{resolved} is incompatible with the {} `Requires-Python` requirement of `{}`.", + "The {given} Python version `{}`{resolved} is incompatible with the {} `requires-python` value of `{}`.", pin.request.to_canonical_string(), project_type, requires_python diff --git a/crates/uv/tests/init.rs b/crates/uv/tests/init.rs index 146439c7c..8c1f4ea52 100644 --- a/crates/uv/tests/init.rs +++ b/crates/uv/tests/init.rs @@ -111,7 +111,7 @@ fn init_no_readme() -> Result<()> { } #[test] -fn current_dir() -> Result<()> { +fn init_current_dir() -> Result<()> { let context = TestContext::new("3.12"); let dir = context.temp_dir.join("foo"); diff --git a/crates/uv/tests/lock.rs b/crates/uv/tests/lock.rs index dd8ee0adb..36efecc44 100644 --- a/crates/uv/tests/lock.rs +++ b/crates/uv/tests/lock.rs @@ -2295,7 +2295,7 @@ fn lock_requires_python() -> Result<()> { And because project==0.1.0 depends on pygls>=1.1.0, we can conclude that project==0.1.0 cannot be used. And because only project==0.1.0 is available and you require project, we can conclude that the requirements are unsatisfiable. - hint: The `Requires-Python` requirement (>=3.7) includes Python versions that are not supported by your dependencies (e.g., pygls>=1.1.0,<=1.2.1 only supports >=3.7.9, <4). Consider using a more restrictive `Requires-Python` requirement (like >=3.7.9, <4). + hint: The `requires-python` value (>=3.7) includes Python versions that are not supported by your dependencies (e.g., pygls>=1.1.0,<=1.2.1 only supports >=3.7.9, <4). Consider using a more restrictive `requires-python` value (like >=3.7.9, <4). "###); } @@ -3119,7 +3119,7 @@ fn lock_requires_python_unbounded() -> Result<()> { ----- stderr ----- warning: `uv lock` is experimental and may change without warning - warning: The workspace `requires-python` field does not contain a lower bound: `<=3.12`. Set a lower bound to indicate the minimum compatible Python version (e.g., `>=3.11`). + warning: The workspace `requires-python` value does not contain a lower bound: `<=3.12`. Set a lower bound to indicate the minimum compatible Python version (e.g., `>=3.11`). Resolved 2 packages in [TIME] "###); diff --git a/crates/uv/tests/python_pin.rs b/crates/uv/tests/python_pin.rs index 53ca8fce7..32e3d36b3 100644 --- a/crates/uv/tests/python_pin.rs +++ b/crates/uv/tests/python_pin.rs @@ -250,7 +250,7 @@ fn python_pin_compatible_with_requires_python() -> anyhow::Result<()> { ----- stdout ----- ----- stderr ----- - error: The requested Python version `3.10` is incompatible with the project `Requires-Python` requirement of `>=3.11`. + error: The requested Python version `3.10` is incompatible with the project `requires-python` value of `>=3.11`. "###); // Request a implementation version that is incompatible @@ -260,7 +260,7 @@ fn python_pin_compatible_with_requires_python() -> anyhow::Result<()> { ----- stdout ----- ----- stderr ----- - error: The requested Python version `cpython@3.10` is incompatible with the project `Requires-Python` requirement of `>=3.11`. + error: The requested Python version `cpython@3.10` is incompatible with the project `requires-python` value of `>=3.11`. "###); // Request a complex version range that resolves to an incompatible version @@ -271,7 +271,7 @@ fn python_pin_compatible_with_requires_python() -> anyhow::Result<()> { Pinned `.python-version` to `>3.8, <3.11` ----- stderr ----- - warning: The requested Python version `>3.8, <3.11` resolves to `3.10.[X]` which is incompatible with the project `Requires-Python` requirement of `>=3.11`. + warning: The requested Python version `>3.8, <3.11` resolves to `3.10.[X]` which is incompatible with the project `requires-python` value of `>=3.11`. "###); uv_snapshot!(context.filters(), context.python_pin().arg("3.11"), @r###" @@ -321,7 +321,7 @@ fn python_pin_compatible_with_requires_python() -> anyhow::Result<()> { cpython@3.11 ----- stderr ----- - warning: The pinned Python version `cpython@3.11` is incompatible with the project `Requires-Python` requirement of `>=3.12`. + warning: The pinned Python version `cpython@3.11` is incompatible with the project `requires-python` value of `>=3.12`. "###); // Request a implementation that resolves to a compatible version @@ -332,7 +332,7 @@ fn python_pin_compatible_with_requires_python() -> anyhow::Result<()> { Updated `.python-version` from `cpython@3.11` -> `cpython` ----- stderr ----- - warning: The requested Python version `cpython` resolves to `3.10.[X]` which is incompatible with the project `Requires-Python` requirement of `>=3.12`. + warning: The requested Python version `cpython` resolves to `3.10.[X]` which is incompatible with the project `requires-python` value of `>=3.12`. "###); uv_snapshot!(context.filters(), context.python_pin(), @r###" @@ -342,7 +342,7 @@ fn python_pin_compatible_with_requires_python() -> anyhow::Result<()> { cpython ----- stderr ----- - warning: The pinned Python version `cpython` resolves to `3.10.[X]` which is incompatible with the project `Requires-Python` requirement of `>=3.12`. + warning: The pinned Python version `cpython` resolves to `3.10.[X]` which is incompatible with the project `requires-python` value of `>=3.12`. "###); // Request a complex version range that resolves to a compatible version @@ -353,7 +353,7 @@ fn python_pin_compatible_with_requires_python() -> anyhow::Result<()> { Updated `.python-version` from `cpython` -> `>3.8, <3.12` ----- stderr ----- - warning: The requested Python version `>3.8, <3.12` resolves to `3.10.[X]` which is incompatible with the project `Requires-Python` requirement of `>=3.12`. + warning: The requested Python version `>3.8, <3.12` resolves to `3.10.[X]` which is incompatible with the project `requires-python` value of `>=3.12`. "###); uv_snapshot!(context.filters(), context.python_pin(), @r###" @@ -363,7 +363,7 @@ fn python_pin_compatible_with_requires_python() -> anyhow::Result<()> { >3.8, <3.12 ----- stderr ----- - warning: The pinned Python version `>3.8, <3.12` resolves to `3.10.[X]` which is incompatible with the project `Requires-Python` requirement of `>=3.12`. + warning: The pinned Python version `>3.8, <3.12` resolves to `3.10.[X]` which is incompatible with the project `requires-python` value of `>=3.12`. "###); Ok(())