From dd760ee507121536d98f639f1f5f097f0f93fc71 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 18 Dec 2024 10:29:34 -0500 Subject: [PATCH] Normalize `platform_system` to `sys_platform` (#9949) ## Summary A revival of an old idea (#9344) that I have slightly more confidence in now. I abandoned this idea because (1) it couldn't capture that, e.g., `platform_system == 'Windows' and sys_platform == 'foo'` (or some other unknown value) are disjoint, and (2) I thought that Android returned `"android"` for one of `sys_platform` or `platform_system`, which would've made this logic incorrect. However, it looks like Android... doesn't do that? And the values here are almost always in a small, known set. So in the end, the tradeoffs here actually seem pretty good. Vis-a-vis our current solution, this can (e.g.) _simplify out_ expressions like `sys_platform == 'win32' or platform_system == 'Windows'`. --- crates/uv-pep508/src/marker/algebra.rs | 260 ++++++++---------- ...__line-endings-poetry-with-hashes.txt.snap | 2 +- ...t__test__parse-poetry-with-hashes.txt.snap | 2 +- crates/uv-resolver/src/lock/mod.rs | 15 +- crates/uv/tests/it/export.rs | 2 +- crates/uv/tests/it/lock.rs | 60 ++-- crates/uv/tests/it/lock_conflict.rs | 2 +- crates/uv/tests/it/pip_compile.rs | 94 +++---- crates/uv/tests/it/pip_sync.rs | 2 +- .../it__ecosystem__black-lock-file.snap | 2 +- ...system__github-wikidata-bot-lock-file.snap | 4 +- ...system__home-assistant-core-lock-file.snap | 28 +- .../it__ecosystem__saleor-lock-file.snap | 2 +- ...it__ecosystem__transformers-lock-file.snap | 78 +++--- .../it__ecosystem__warehouse-lock-file.snap | 4 +- scripts/benchmark/uv.lock | 2 +- 16 files changed, 267 insertions(+), 292 deletions(-) diff --git a/crates/uv-pep508/src/marker/algebra.rs b/crates/uv-pep508/src/marker/algebra.rs index af249934e..0c1bdbce2 100644 --- a/crates/uv-pep508/src/marker/algebra.rs +++ b/crates/uv-pep508/src/marker/algebra.rs @@ -271,10 +271,49 @@ impl InternerGuard<'_> { key, operator, value, - } => ( - Variable::String(key.into()), - Edges::from_string(operator, value), - ), + } => { + // Normalize `platform_system` markers to `sys_platform` nodes. + // + // The `platform` module is "primarily intended for diagnostic information to be + // read by humans." + // + // We only normalize when we can confidently guarantee that the values are + // exactly equivalent. For example, we normalize `platform_system == 'Windows'` + // to `sys_platform == 'win32'`, but we do not normalize `platform_system == 'FreeBSD'` + // to `sys_platform == 'freebsd'`, since FreeBSD typically includes a major version + // in its `sys.platform` output. + // + // For cases that aren't normalized, we do our best to encode known-incompatible + // values in `exclusions`. + // + // See: https://discuss.python.org/t/clarify-usage-of-platform-system/70900 + let (key, value) = match (key, value.as_str()) { + (MarkerValueString::PlatformSystem, "Windows") => { + (CanonicalMarkerValueString::SysPlatform, "win32".to_string()) + } + (MarkerValueString::PlatformSystem, "Darwin") => ( + CanonicalMarkerValueString::SysPlatform, + "darwin".to_string(), + ), + (MarkerValueString::PlatformSystem, "Linux") => { + (CanonicalMarkerValueString::SysPlatform, "linux".to_string()) + } + (MarkerValueString::PlatformSystem, "AIX") => { + (CanonicalMarkerValueString::SysPlatform, "aix".to_string()) + } + (MarkerValueString::PlatformSystem, "Emscripten") => ( + CanonicalMarkerValueString::SysPlatform, + "emscripten".to_string(), + ), + // See: https://peps.python.org/pep-0738/#sys + (MarkerValueString::PlatformSystem, "Android") => ( + CanonicalMarkerValueString::SysPlatform, + "android".to_string(), + ), + _ => (key.into(), value), + }; + (Variable::String(key), Edges::from_string(operator, value)) + } // A variable representing the existence or absence of a particular extra. MarkerExpression::Extra { name: MarkerValueExtra::Extra(extra), @@ -821,99 +860,11 @@ impl InternerGuard<'_> { return exclusions; } let mut tree = NodeId::FALSE; - for (a, b) in [ - // sys_platform == 'darwin' and platform_system == 'Windows' - ( - MarkerExpression::String { - key: MarkerValueString::SysPlatform, - operator: MarkerOperator::Equal, - value: "darwin".to_string(), - }, - MarkerExpression::String { - key: MarkerValueString::PlatformSystem, - operator: MarkerOperator::Equal, - value: "Windows".to_string(), - }, - ), - // sys_platform == 'darwin' and platform_system == 'Linux' - ( - MarkerExpression::String { - key: MarkerValueString::SysPlatform, - operator: MarkerOperator::Equal, - value: "darwin".to_string(), - }, - MarkerExpression::String { - key: MarkerValueString::PlatformSystem, - operator: MarkerOperator::Equal, - value: "Linux".to_string(), - }, - ), - // sys_platform == 'win32' and platform_system == 'Darwin' - ( - MarkerExpression::String { - key: MarkerValueString::SysPlatform, - operator: MarkerOperator::Equal, - value: "win32".to_string(), - }, - MarkerExpression::String { - key: MarkerValueString::PlatformSystem, - operator: MarkerOperator::Equal, - value: "Darwin".to_string(), - }, - ), - // sys_platform == 'win32' and platform_system == 'Linux' - ( - MarkerExpression::String { - key: MarkerValueString::SysPlatform, - operator: MarkerOperator::Equal, - value: "win32".to_string(), - }, - MarkerExpression::String { - key: MarkerValueString::PlatformSystem, - operator: MarkerOperator::Equal, - value: "Linux".to_string(), - }, - ), - // sys_platform == 'linux' and platform_system == 'Darwin' - ( - MarkerExpression::String { - key: MarkerValueString::SysPlatform, - operator: MarkerOperator::Equal, - value: "linux".to_string(), - }, - MarkerExpression::String { - key: MarkerValueString::PlatformSystem, - operator: MarkerOperator::Equal, - value: "Darwin".to_string(), - }, - ), - // sys_platform == 'linux' and platform_system == 'Windows' - ( - MarkerExpression::String { - key: MarkerValueString::SysPlatform, - operator: MarkerOperator::Equal, - value: "linux".to_string(), - }, - MarkerExpression::String { - key: MarkerValueString::PlatformSystem, - operator: MarkerOperator::Equal, - value: "Windows".to_string(), - }, - ), - // os_name == 'nt' and sys_platform == 'darwin' - ( - MarkerExpression::String { - key: MarkerValueString::OsName, - operator: MarkerOperator::Equal, - value: "nt".to_string(), - }, - MarkerExpression::String { - key: MarkerValueString::SysPlatform, - operator: MarkerOperator::Equal, - value: "darwin".to_string(), - }, - ), - // os_name == 'nt' and sys_platform == 'linux' + + // Pairs of `os_name` and `sys_platform` that are known to be incompatible. + // + // For example: `os_name == 'nt' and sys_platform == 'darwin'` + let mut pairs = vec![ ( MarkerExpression::String { key: MarkerValueString::OsName, @@ -926,7 +877,30 @@ impl InternerGuard<'_> { value: "linux".to_string(), }, ), - // os_name == 'posix' and sys_platform == 'win32' + ( + MarkerExpression::String { + key: MarkerValueString::OsName, + operator: MarkerOperator::Equal, + value: "nt".to_string(), + }, + MarkerExpression::String { + key: MarkerValueString::SysPlatform, + operator: MarkerOperator::Equal, + value: "darwin".to_string(), + }, + ), + ( + MarkerExpression::String { + key: MarkerValueString::OsName, + operator: MarkerOperator::Equal, + value: "nt".to_string(), + }, + MarkerExpression::String { + key: MarkerValueString::SysPlatform, + operator: MarkerOperator::Equal, + value: "ios".to_string(), + }, + ), ( MarkerExpression::String { key: MarkerValueString::OsName, @@ -939,51 +913,61 @@ impl InternerGuard<'_> { value: "win32".to_string(), }, ), - // os_name == 'nt' and platform_system == 'Darwin' - ( - MarkerExpression::String { - key: MarkerValueString::OsName, - operator: MarkerOperator::Equal, - value: "nt".to_string(), - }, - MarkerExpression::String { - key: MarkerValueString::PlatformSystem, - operator: MarkerOperator::Equal, - value: "Darwin".to_string(), - }, - ), - // os_name == 'nt' and platform_system == 'Linux' - ( - MarkerExpression::String { - key: MarkerValueString::OsName, - operator: MarkerOperator::Equal, - value: "nt".to_string(), - }, - MarkerExpression::String { - key: MarkerValueString::PlatformSystem, - operator: MarkerOperator::Equal, - value: "Linux".to_string(), - }, - ), - // os_name == 'posix' and platform_system == 'Windows' - ( - MarkerExpression::String { - key: MarkerValueString::OsName, - operator: MarkerOperator::Equal, - value: "posix".to_string(), - }, - MarkerExpression::String { - key: MarkerValueString::PlatformSystem, - operator: MarkerOperator::Equal, - value: "Windows".to_string(), - }, - ), - ] { + ]; + + // Pairs of `platform_system` and `sys_platform` that are known to be incompatible. + // + // For example: `platform_system == 'FreeBSD' and sys_platform == 'darwin'` + // + // Any `platform_system` values that we normalize away (like `Windows` to `win32`) are + // omitted, since we never expect them to be present in the tree. + // + // Unfortunately, we can't include Cygwin here, since Cygwin appears to use a + // `platform_system` value with versions encoded (e.g., `CYGWIN_NT-10.0-22631). + // + for platform_system in ["FreeBSD", "NetBSD", "OpenBSD", "SunOS", "iOS", "iPadOS"] { + // An enumeration of known values, excluding FreeBSD, SunOS, and other Unix systems, + // which use the lowercased `uname -s`, which typically includes a version (e.g., + // `freebsd8`). + // + // See: https://docs.python.org/3/library/sys.html#sys.platform + for sys_platform in [ + "aix", + "android", + "emscripten", + "ios", + "linux", + "darwin", + "win32", + "cygwin", + "wasi", + ] { + // Some of the above pairs are actually compatible. + if matches!((platform_system, sys_platform), ("iOS" | "iPadOS", "ios")) { + continue; + } + pairs.push(( + MarkerExpression::String { + key: MarkerValueString::PlatformSystem, + operator: MarkerOperator::Equal, + value: platform_system.to_string(), + }, + MarkerExpression::String { + key: MarkerValueString::SysPlatform, + operator: MarkerOperator::Equal, + value: sys_platform.to_string(), + }, + )); + } + } + + for (a, b) in pairs { let a = self.expression(a); let b = self.expression(b); let a_and_b = conjunction(self, a, b); tree = disjunction(self, tree, a_and_b); } + self.state.exclusions = Some(tree); tree } diff --git a/crates/uv-requirements-txt/src/snapshots/uv_requirements_txt__test__line-endings-poetry-with-hashes.txt.snap b/crates/uv-requirements-txt/src/snapshots/uv_requirements_txt__test__line-endings-poetry-with-hashes.txt.snap index 15b5120a5..ad5e2a0e6 100644 --- a/crates/uv-requirements-txt/src/snapshots/uv_requirements_txt__test__line-endings-poetry-with-hashes.txt.snap +++ b/crates/uv-requirements-txt/src/snapshots/uv_requirements_txt__test__line-endings-poetry-with-hashes.txt.snap @@ -85,7 +85,7 @@ RequirementsTxt { ), ), ), - marker: python_full_version >= '3.8' and python_full_version < '4.0' and platform_system == 'Windows', + marker: python_full_version >= '3.8' and python_full_version < '4.0' and sys_platform == 'win32', origin: Some( File( "/poetry-with-hashes.txt", diff --git a/crates/uv-requirements-txt/src/snapshots/uv_requirements_txt__test__parse-poetry-with-hashes.txt.snap b/crates/uv-requirements-txt/src/snapshots/uv_requirements_txt__test__parse-poetry-with-hashes.txt.snap index 15b5120a5..ad5e2a0e6 100644 --- a/crates/uv-requirements-txt/src/snapshots/uv_requirements_txt__test__parse-poetry-with-hashes.txt.snap +++ b/crates/uv-requirements-txt/src/snapshots/uv_requirements_txt__test__parse-poetry-with-hashes.txt.snap @@ -85,7 +85,7 @@ RequirementsTxt { ), ), ), - marker: python_full_version >= '3.8' and python_full_version < '4.0' and platform_system == 'Windows', + marker: python_full_version >= '3.8' and python_full_version < '4.0' and sys_platform == 'win32', origin: Some( File( "/poetry-with-hashes.txt", diff --git a/crates/uv-resolver/src/lock/mod.rs b/crates/uv-resolver/src/lock/mod.rs index 0b52a22fb..1d469ddb9 100644 --- a/crates/uv-resolver/src/lock/mod.rs +++ b/crates/uv-resolver/src/lock/mod.rs @@ -60,24 +60,15 @@ mod tree; pub const VERSION: u32 = 1; static LINUX_MARKERS: LazyLock = LazyLock::new(|| { - let pep508 = MarkerTree::from_str( - "platform_system == 'Linux' and os_name == 'posix' and sys_platform == 'linux'", - ) - .unwrap(); + let pep508 = MarkerTree::from_str("os_name == 'posix' and sys_platform == 'linux'").unwrap(); UniversalMarker::new(pep508, ConflictMarker::TRUE) }); static WINDOWS_MARKERS: LazyLock = LazyLock::new(|| { - let pep508 = MarkerTree::from_str( - "platform_system == 'Windows' and os_name == 'nt' and sys_platform == 'win32'", - ) - .unwrap(); + let pep508 = MarkerTree::from_str("os_name == 'nt' and sys_platform == 'win32'").unwrap(); UniversalMarker::new(pep508, ConflictMarker::TRUE) }); static MAC_MARKERS: LazyLock = LazyLock::new(|| { - let pep508 = MarkerTree::from_str( - "platform_system == 'Darwin' and os_name == 'posix' and sys_platform == 'darwin'", - ) - .unwrap(); + let pep508 = MarkerTree::from_str("os_name == 'posix' and sys_platform == 'darwin'").unwrap(); UniversalMarker::new(pep508, ConflictMarker::TRUE) }); diff --git a/crates/uv/tests/it/export.rs b/crates/uv/tests/it/export.rs index 3800a7980..f343186f3 100644 --- a/crates/uv/tests/it/export.rs +++ b/crates/uv/tests/it/export.rs @@ -128,7 +128,7 @@ fn dependency_extra() -> Result<()> { click==8.1.7 \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de - colorama==0.4.6 ; platform_system == 'Windows' \ + colorama==0.4.6 ; sys_platform == 'win32' \ --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 flask==3.0.2 \ diff --git a/crates/uv/tests/it/lock.rs b/crates/uv/tests/it/lock.rs index 6aebec582..96ad22399 100644 --- a/crates/uv/tests/it/lock.rs +++ b/crates/uv/tests/it/lock.rs @@ -1014,7 +1014,7 @@ fn lock_wheel_url() -> Result<()> { { name = "trio", marker = "extra == 'trio'", specifier = ">=0.23" }, { name = "trustme", marker = "extra == 'test'" }, { name = "typing-extensions", marker = "python_full_version < '3.11'", specifier = ">=4.1" }, - { name = "uvloop", marker = "platform_python_implementation == 'CPython' and platform_system != 'Windows' and extra == 'test'", specifier = ">=0.17" }, + { name = "uvloop", marker = "platform_python_implementation == 'CPython' and sys_platform != 'win32' and extra == 'test'", specifier = ">=0.17" }, ] [[package]] @@ -1159,7 +1159,7 @@ fn lock_sdist_url() -> Result<()> { { name = "trio", marker = "extra == 'trio'", specifier = ">=0.23" }, { name = "trustme", marker = "extra == 'test'" }, { name = "typing-extensions", marker = "python_full_version < '3.11'", specifier = ">=4.1" }, - { name = "uvloop", marker = "platform_python_implementation == 'CPython' and platform_system != 'Windows' and extra == 'test'", specifier = ">=0.17" }, + { name = "uvloop", marker = "platform_python_implementation == 'CPython' and sys_platform != 'win32' and extra == 'test'", specifier = ">=0.17" }, ] [[package]] @@ -1675,7 +1675,7 @@ fn lock_dependency_extra() -> Result<()> { version = "8.1.7" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/96/d3/f04c7bfcf5c1862a2a5b845c6b2b360488cf47af55dfa79c98f6a6bf98b5/click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de", size = 336121 } wheels = [ @@ -2180,7 +2180,7 @@ fn lock_dependency_non_existent_extra() -> Result<()> { version = "8.1.7" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/96/d3/f04c7bfcf5c1862a2a5b845c6b2b360488cf47af55dfa79c98f6a6bf98b5/click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de", size = 336121 } wheels = [ @@ -12694,10 +12694,10 @@ fn lock_constrained_environment() -> Result<()> { version = 1 requires-python = ">=3.12" resolution-markers = [ - "platform_system != 'Windows'", + "sys_platform != 'win32'", ] supported-markers = [ - "platform_system != 'Windows'", + "sys_platform != 'win32'", ] [options] @@ -12708,11 +12708,11 @@ fn lock_constrained_environment() -> Result<()> { version = "24.3.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "click", marker = "platform_system != 'Windows'" }, - { name = "mypy-extensions", marker = "platform_system != 'Windows'" }, - { name = "packaging", marker = "platform_system != 'Windows'" }, - { name = "pathspec", marker = "platform_system != 'Windows'" }, - { name = "platformdirs", marker = "platform_system != 'Windows'" }, + { name = "click", marker = "sys_platform != 'win32'" }, + { name = "mypy-extensions", marker = "sys_platform != 'win32'" }, + { name = "packaging", marker = "sys_platform != 'win32'" }, + { name = "pathspec", marker = "sys_platform != 'win32'" }, + { name = "platformdirs", marker = "sys_platform != 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/8f/5f/bac24a952668c7482cfdb4ebf91ba57a796c9da8829363a772040c1a3312/black-24.3.0.tar.gz", hash = "sha256:a0c9c4a0771afc6919578cec71ce82a3e31e054904e7197deacbc9382671c41f", size = 634292 } wheels = [ @@ -12772,7 +12772,7 @@ fn lock_constrained_environment() -> Result<()> { version = "0.1.0" source = { editable = "." } dependencies = [ - { name = "black", marker = "platform_system != 'Windows'" }, + { name = "black", marker = "sys_platform != 'win32'" }, ] [package.metadata] @@ -12907,7 +12907,7 @@ fn lock_constrained_environment() -> Result<()> { version = "8.1.7" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/96/d3/f04c7bfcf5c1862a2a5b845c6b2b360488cf47af55dfa79c98f6a6bf98b5/click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de", size = 336121 } wheels = [ @@ -13024,10 +13024,10 @@ fn lock_constrained_environment_legacy() -> Result<()> { version = 1 requires-python = ">=3.12" resolution-markers = [ - "platform_system != 'Windows'", + "sys_platform != 'win32'", ] supported-markers = [ - "platform_system != 'Windows'", + "sys_platform != 'win32'", ] [options] @@ -13043,11 +13043,11 @@ fn lock_constrained_environment_legacy() -> Result<()> { version = "24.3.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "click", marker = "platform_system != 'Windows'" }, - { name = "mypy-extensions", marker = "platform_system != 'Windows'" }, - { name = "packaging", marker = "platform_system != 'Windows'" }, - { name = "pathspec", marker = "platform_system != 'Windows'" }, - { name = "platformdirs", marker = "platform_system != 'Windows'" }, + { name = "click", marker = "sys_platform != 'win32'" }, + { name = "mypy-extensions", marker = "sys_platform != 'win32'" }, + { name = "packaging", marker = "sys_platform != 'win32'" }, + { name = "pathspec", marker = "sys_platform != 'win32'" }, + { name = "platformdirs", marker = "sys_platform != 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/8f/5f/bac24a952668c7482cfdb4ebf91ba57a796c9da8829363a772040c1a3312/black-24.3.0.tar.gz", hash = "sha256:a0c9c4a0771afc6919578cec71ce82a3e31e054904e7197deacbc9382671c41f", size = 634292 } wheels = [ @@ -13062,7 +13062,7 @@ fn lock_constrained_environment_legacy() -> Result<()> { version = "0.1.0" source = { virtual = "child" } dependencies = [ - { name = "black", marker = "platform_system != 'Windows'" }, + { name = "black", marker = "sys_platform != 'win32'" }, ] [package.metadata] @@ -13169,9 +13169,9 @@ fn lock_overlapping_environment() -> Result<()> { ----- stdout ----- ----- stderr ----- - error: Supported environments must be disjoint, but the following markers overlap: `platform_system != 'Windows'` and `python_full_version >= '3.11'`. + error: Supported environments must be disjoint, but the following markers overlap: `sys_platform != 'win32'` and `python_full_version >= '3.11'`. - hint: replace `python_full_version >= '3.11'` with `python_full_version >= '3.11' and platform_system == 'Windows'`. + hint: replace `python_full_version >= '3.11'` with `python_full_version >= '3.11' and sys_platform == 'win32'`. "###); Ok(()) @@ -15049,7 +15049,7 @@ fn lock_explicit_virtual_project() -> Result<()> { version = "8.1.7" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/96/d3/f04c7bfcf5c1862a2a5b845c6b2b360488cf47af55dfa79c98f6a6bf98b5/click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de", size = 336121 } wheels = [ @@ -15266,7 +15266,7 @@ fn lock_implicit_virtual_project() -> Result<()> { version = "8.1.7" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/96/d3/f04c7bfcf5c1862a2a5b845c6b2b360488cf47af55dfa79c98f6a6bf98b5/click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de", size = 336121 } wheels = [ @@ -15765,7 +15765,7 @@ fn lock_python_upper_bound() -> Result<()> { version = "8.1.7" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/96/d3/f04c7bfcf5c1862a2a5b845c6b2b360488cf47af55dfa79c98f6a6bf98b5/click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de", size = 336121 } wheels = [ @@ -16048,7 +16048,7 @@ fn lock_python_upper_bound() -> Result<()> { version = "4.66.2" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/ea/85/3ce0f9f7d3f596e7ea57f4e5ce8c18cb44e4a9daa58ddb46ee0d13d6bff8/tqdm-4.66.2.tar.gz", hash = "sha256:6cd52cdf0fef0e0f543299cfc96fec90d7b8a7e88745f411ec33eb44d5ed3531", size = 169462 } wheels = [ @@ -17985,7 +17985,7 @@ fn lock_multiple_sources_respect_marker() -> Result<()> { name = "project" version = "0.1.0" requires-python = ">=3.12" - dependencies = ["iniconfig ; platform_system == 'Windows'"] + dependencies = ["iniconfig ; sys_platform == 'win32'"] [tool.uv.sources] iniconfig = [ @@ -18030,11 +18030,11 @@ fn lock_multiple_sources_respect_marker() -> Result<()> { version = "0.1.0" source = { virtual = "." } dependencies = [ - { name = "iniconfig", marker = "platform_system == 'Windows' and sys_platform != 'darwin'" }, + { name = "iniconfig", marker = "sys_platform == 'win32'" }, ] [package.metadata] - requires-dist = [{ name = "iniconfig", marker = "platform_system == 'Windows' and sys_platform != 'darwin'" }] + requires-dist = [{ name = "iniconfig", marker = "sys_platform == 'win32'" }] "### ); }); diff --git a/crates/uv/tests/it/lock_conflict.rs b/crates/uv/tests/it/lock_conflict.rs index de649109e..56ea22c5a 100644 --- a/crates/uv/tests/it/lock_conflict.rs +++ b/crates/uv/tests/it/lock_conflict.rs @@ -5474,7 +5474,7 @@ fn extra_inferences() -> Result<()> { version = "8.1.7" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/96/d3/f04c7bfcf5c1862a2a5b845c6b2b360488cf47af55dfa79c98f6a6bf98b5/click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de", size = 336121 } wheels = [ diff --git a/crates/uv/tests/it/pip_compile.rs b/crates/uv/tests/it/pip_compile.rs index 175bc4760..0c22b6147 100644 --- a/crates/uv/tests/it/pip_compile.rs +++ b/crates/uv/tests/it/pip_compile.rs @@ -646,7 +646,7 @@ portalocker==2.5.1 python-nvd3==0.15.0 # via apache-airflow python-slugify==8.0.4 # via apache-airflow, python-nvd3 pytz==2024.1 # via croniter, flask-babel - pywin32==306 ; platform_system == 'Windows' # via portalocker + pywin32==306 ; sys_platform == 'win32' # via portalocker pyyaml==6.0.1 # via apispec, connexion referencing==0.34.0 # via jsonschema, jsonschema-specifications requests==2.31.0 # via adal, apache-airflow-providers-http, azure-core, azure-datalake-store, azure-kusto-data, azure-storage-common, connexion, msal, msrest, requests-oauthlib, requests-toolbelt @@ -7479,7 +7479,7 @@ fn universal_disjoint_locals() -> Result<()> { ----- stdout ----- # This file was autogenerated by uv via the following command: # uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal - cmake==3.28.4 ; platform_machine == 'x86_64' and platform_system == 'Linux' + cmake==3.28.4 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via triton filelock==3.13.1 # via @@ -7487,7 +7487,7 @@ fn universal_disjoint_locals() -> Result<()> { # triton jinja2==3.1.3 # via torch - lit==18.1.2 ; platform_machine == 'x86_64' and platform_system == 'Linux' + lit==18.1.2 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via triton markupsafe==2.1.5 # via jinja2 @@ -7503,7 +7503,7 @@ fn universal_disjoint_locals() -> Result<()> { # via # -r requirements.in # triton - triton==2.0.0 ; platform_machine == 'x86_64' and platform_system == 'Linux' + triton==2.0.0 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via torch typing-extensions==4.10.0 # via torch @@ -7544,7 +7544,7 @@ fn universal_transitive_disjoint_locals() -> Result<()> { # via requests charset-normalizer==3.3.2 # via requests - cmake==3.28.4 ; platform_machine == 'x86_64' and platform_system == 'Linux' + cmake==3.28.4 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via triton filelock==3.13.1 # via @@ -7554,7 +7554,7 @@ fn universal_transitive_disjoint_locals() -> Result<()> { # via requests jinja2==3.1.3 # via torch - lit==18.1.2 ; platform_machine == 'x86_64' and platform_system == 'Linux' + lit==18.1.2 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via triton markupsafe==2.1.5 # via jinja2 @@ -7581,7 +7581,7 @@ fn universal_transitive_disjoint_locals() -> Result<()> { # triton torchvision==0.15.1+rocm5.4.2 # via -r requirements.in - triton==2.0.0 ; platform_machine == 'x86_64' and platform_system == 'Linux' + triton==2.0.0 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via torch typing-extensions==4.10.0 # via torch @@ -7628,7 +7628,7 @@ fn universal_local_path_requirement() -> Result<()> { ----- stdout ----- # This file was autogenerated by uv via the following command: # uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal - cmake==3.28.4 ; platform_machine == 'x86_64' and platform_system == 'Linux' + cmake==3.28.4 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via triton . # via -r requirements.in @@ -7638,7 +7638,7 @@ fn universal_local_path_requirement() -> Result<()> { # triton jinja2==3.1.3 # via torch - lit==18.1.2 ; platform_machine == 'x86_64' and platform_system == 'Linux' + lit==18.1.2 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via triton markupsafe==2.1.5 # via jinja2 @@ -7653,7 +7653,7 @@ fn universal_local_path_requirement() -> Result<()> { # -r requirements.in # example # triton - triton==2.0.0 ; platform_machine == 'x86_64' and platform_system == 'Linux' + triton==2.0.0 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via torch typing-extensions==4.10.0 # via torch @@ -7699,7 +7699,7 @@ fn universal_overlapping_local_requirement() -> Result<()> { ----- stdout ----- # This file was autogenerated by uv via the following command: # uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal - cmake==3.28.4 ; platform_machine == 'x86_64' and platform_system == 'Linux' + cmake==3.28.4 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via triton . # via -r requirements.in @@ -7709,7 +7709,7 @@ fn universal_overlapping_local_requirement() -> Result<()> { # triton jinja2==3.1.3 # via torch - lit==18.1.2 ; platform_machine == 'x86_64' and platform_system == 'Linux' + lit==18.1.2 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via triton markupsafe==2.1.5 # via jinja2 @@ -7724,7 +7724,7 @@ fn universal_overlapping_local_requirement() -> Result<()> { # -r requirements.in # example # triton - triton==2.0.0 ; platform_machine == 'x86_64' and platform_system == 'Linux' + triton==2.0.0 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via torch typing-extensions==4.10.0 # via torch @@ -7773,7 +7773,7 @@ fn universal_disjoint_local_requirement() -> Result<()> { ----- stdout ----- # This file was autogenerated by uv via the following command: # uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal - cmake==3.28.4 ; platform_machine == 'x86_64' and platform_system == 'Linux' + cmake==3.28.4 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via triton . # via -r requirements.in @@ -7783,7 +7783,7 @@ fn universal_disjoint_local_requirement() -> Result<()> { # triton jinja2==3.1.3 # via torch - lit==18.1.2 ; platform_machine == 'x86_64' and platform_system == 'Linux' + lit==18.1.2 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via triton markupsafe==2.1.5 # via jinja2 @@ -7802,7 +7802,7 @@ fn universal_disjoint_local_requirement() -> Result<()> { # -r requirements.in # example # triton - triton==2.0.0 ; platform_machine == 'x86_64' and platform_system == 'Linux' + triton==2.0.0 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via torch typing-extensions==4.10.0 # via torch @@ -7852,7 +7852,7 @@ fn universal_disjoint_base_or_local_requirement() -> Result<()> { ----- stdout ----- # This file was autogenerated by uv via the following command: # uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal - cmake==3.28.4 ; (python_full_version < '3.11' and platform_machine != 'x86_64') or (python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux') or (python_full_version < '3.11' and platform_system != 'Linux') + cmake==3.28.4 ; (python_full_version < '3.11' and platform_machine != 'x86_64') or (python_full_version < '3.13' and platform_machine == 'x86_64' and sys_platform == 'linux') or (python_full_version < '3.11' and sys_platform != 'linux') # via # pytorch-triton-rocm # triton @@ -7865,7 +7865,7 @@ fn universal_disjoint_base_or_local_requirement() -> Result<()> { # triton jinja2==3.1.3 # via torch - lit==18.1.2 ; (python_full_version < '3.11' and platform_machine != 'x86_64') or (python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux') or (python_full_version < '3.11' and platform_system != 'Linux') + lit==18.1.2 ; (python_full_version < '3.11' and platform_machine != 'x86_64') or (python_full_version < '3.13' and platform_machine == 'x86_64' and sys_platform == 'linux') or (python_full_version < '3.11' and sys_platform != 'linux') # via # pytorch-triton-rocm # triton @@ -7893,7 +7893,7 @@ fn universal_disjoint_base_or_local_requirement() -> Result<()> { # -r requirements.in # example # pytorch-triton-rocm - triton==2.0.0 ; python_full_version >= '3.11' and python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux' + triton==2.0.0 ; python_full_version >= '3.11' and python_full_version < '3.13' and platform_machine == 'x86_64' and sys_platform == 'linux' # via torch typing-extensions==4.10.0 # via torch @@ -7941,7 +7941,7 @@ fn universal_nested_overlapping_local_requirement() -> Result<()> { ----- stdout ----- # This file was autogenerated by uv via the following command: # uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal - cmake==3.28.4 ; platform_machine == 'x86_64' and platform_system == 'Linux' + cmake==3.28.4 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via triton . # via -r requirements.in @@ -7952,15 +7952,15 @@ fn universal_nested_overlapping_local_requirement() -> Result<()> { # triton fsspec==2024.3.1 ; platform_machine != 'x86_64' # via torch - intel-openmp==2021.4.0 ; platform_machine != 'x86_64' and platform_system == 'Windows' + intel-openmp==2021.4.0 ; platform_machine != 'x86_64' and sys_platform == 'win32' # via mkl jinja2==3.1.3 # via torch - lit==18.1.2 ; platform_machine == 'x86_64' and platform_system == 'Linux' + lit==18.1.2 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via triton markupsafe==2.1.5 # via jinja2 - mkl==2021.4.0 ; platform_machine != 'x86_64' and platform_system == 'Windows' + mkl==2021.4.0 ; platform_machine != 'x86_64' and sys_platform == 'win32' # via torch mpmath==1.3.0 # via sympy @@ -7970,7 +7970,7 @@ fn universal_nested_overlapping_local_requirement() -> Result<()> { # via torch sympy==1.12 # via torch - tbb==2021.11.0 ; platform_machine != 'x86_64' and platform_system == 'Windows' + tbb==2021.11.0 ; platform_machine != 'x86_64' and sys_platform == 'win32' # via mkl torch==2.0.0+cu118 ; platform_machine == 'x86_64' # via @@ -7979,7 +7979,7 @@ fn universal_nested_overlapping_local_requirement() -> Result<()> { # triton torch==2.3.0+rocm6.0 ; platform_machine != 'x86_64' # via -r requirements.in - triton==2.0.0 ; platform_machine == 'x86_64' and platform_system == 'Linux' + triton==2.0.0 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via torch typing-extensions==4.10.0 # via torch @@ -8018,7 +8018,7 @@ fn universal_nested_overlapping_local_requirement() -> Result<()> { ----- stdout ----- # This file was autogenerated by uv via the following command: # uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal - cmake==3.28.4 ; platform_machine == 'x86_64' and platform_system == 'Linux' + cmake==3.28.4 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via triton . ; os_name == 'Linux' # via -r requirements.in @@ -8029,15 +8029,15 @@ fn universal_nested_overlapping_local_requirement() -> Result<()> { # triton fsspec==2024.3.1 ; platform_machine != 'x86_64' # via torch - intel-openmp==2021.4.0 ; platform_machine != 'x86_64' and platform_system == 'Windows' + intel-openmp==2021.4.0 ; platform_machine != 'x86_64' and sys_platform == 'win32' # via mkl jinja2==3.1.3 # via torch - lit==18.1.2 ; platform_machine == 'x86_64' and platform_system == 'Linux' + lit==18.1.2 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via triton markupsafe==2.1.5 # via jinja2 - mkl==2021.4.0 ; platform_machine != 'x86_64' and platform_system == 'Windows' + mkl==2021.4.0 ; platform_machine != 'x86_64' and sys_platform == 'win32' # via torch mpmath==1.3.0 # via sympy @@ -8047,7 +8047,7 @@ fn universal_nested_overlapping_local_requirement() -> Result<()> { # via torch sympy==1.12 # via torch - tbb==2021.11.0 ; platform_machine != 'x86_64' and platform_system == 'Windows' + tbb==2021.11.0 ; platform_machine != 'x86_64' and sys_platform == 'win32' # via mkl torch==2.0.0+cu118 ; platform_machine == 'x86_64' # via @@ -8056,7 +8056,7 @@ fn universal_nested_overlapping_local_requirement() -> Result<()> { # triton torch==2.3.0+rocm6.0 ; platform_machine != 'x86_64' # via -r requirements.in - triton==2.0.0 ; platform_machine == 'x86_64' and platform_system == 'Linux' + triton==2.0.0 ; platform_machine == 'x86_64' and sys_platform == 'linux' # via torch typing-extensions==4.10.0 # via torch @@ -8106,7 +8106,7 @@ fn universal_nested_disjoint_local_requirement() -> Result<()> { ----- stdout ----- # This file was autogenerated by uv via the following command: # uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal - cmake==3.28.4 ; os_name == 'Linux' and platform_machine == 'x86_64' and platform_system == 'Linux' + cmake==3.28.4 ; os_name == 'Linux' and platform_machine == 'x86_64' and sys_platform == 'linux' # via triton . ; os_name == 'Linux' # via -r requirements.in @@ -8117,15 +8117,15 @@ fn universal_nested_disjoint_local_requirement() -> Result<()> { # triton fsspec==2024.3.1 ; os_name != 'Linux' # via torch - intel-openmp==2021.4.0 ; os_name != 'Linux' and platform_system == 'Windows' + intel-openmp==2021.4.0 ; os_name != 'Linux' and sys_platform == 'win32' # via mkl jinja2==3.1.3 # via torch - lit==18.1.2 ; os_name == 'Linux' and platform_machine == 'x86_64' and platform_system == 'Linux' + lit==18.1.2 ; os_name == 'Linux' and platform_machine == 'x86_64' and sys_platform == 'linux' # via triton markupsafe==2.1.5 # via jinja2 - mkl==2021.4.0 ; os_name != 'Linux' and platform_system == 'Windows' + mkl==2021.4.0 ; os_name != 'Linux' and sys_platform == 'win32' # via torch mpmath==1.3.0 # via sympy @@ -8135,7 +8135,7 @@ fn universal_nested_disjoint_local_requirement() -> Result<()> { # via torch sympy==1.12 # via torch - tbb==2021.11.0 ; os_name != 'Linux' and platform_system == 'Windows' + tbb==2021.11.0 ; os_name != 'Linux' and sys_platform == 'win32' # via mkl torch==2.0.0+cpu ; os_name == 'Linux' and platform_machine != 'x86_64' # via @@ -8148,7 +8148,7 @@ fn universal_nested_disjoint_local_requirement() -> Result<()> { # triton torch==2.3.0+rocm6.0 ; os_name != 'Linux' # via -r requirements.in - triton==2.0.0 ; os_name == 'Linux' and platform_machine == 'x86_64' and platform_system == 'Linux' + triton==2.0.0 ; os_name == 'Linux' and platform_machine == 'x86_64' and sys_platform == 'linux' # via torch typing-extensions==4.10.0 # via torch @@ -9094,7 +9094,7 @@ fn universal_overlap_extra_base() -> Result<()> { # via flask click==8.1.7 # via flask - colorama==0.4.6 ; platform_system == 'Windows' and sys_platform != 'darwin' + colorama==0.4.6 ; sys_platform == 'win32' # via click flask==3.0.2 # via -r requirements.in @@ -9141,7 +9141,7 @@ fn universal_overlap_extra_base_no_strip() -> Result<()> { # via flask click==8.1.7 # via flask - colorama==0.4.6 ; platform_system == 'Windows' and sys_platform != 'darwin' + colorama==0.4.6 ; sys_platform == 'win32' # via click flask==3.0.2 # via -r requirements.in @@ -11110,7 +11110,7 @@ fn emit_marker_expression_exciting_linux() -> Result<()> { # This file was autogenerated by uv via the following command: # uv pip compile --cache-dir [CACHE_DIR] requirements.in --python-platform linux --emit-marker-expression # Pinned dependencies known to be valid for: - # python_full_version == '3.12.6' and platform_python_implementation == 'CPython' and platform_system == 'Linux' + # python_full_version == '3.12.6' and platform_python_implementation == 'CPython' and sys_platform == 'linux' anyio==4.3.0 # via -r requirements.in idna==3.6 @@ -11146,7 +11146,7 @@ fn emit_marker_expression_direct() -> Result<()> { # This file was autogenerated by uv via the following command: # uv pip compile --cache-dir [CACHE_DIR] requirements.in --python-platform linux --emit-marker-expression # Pinned dependencies known to be valid for: - # python_full_version == '3.12.6' and platform_python_implementation == 'CPython' and platform_system == 'Linux' and sys_platform == 'linux' + # python_full_version == '3.12.6' and platform_python_implementation == 'CPython' and sys_platform == 'linux' anyio==4.3.0 # via -r requirements.in idna==3.6 @@ -13089,17 +13089,17 @@ fn universal_constrained_environment() -> Result<()> { ----- stdout ----- # This file was autogenerated by uv via the following command: # uv pip compile --cache-dir [CACHE_DIR] pyproject.toml --universal - black==24.3.0 ; platform_system != 'Windows' + black==24.3.0 ; sys_platform != 'win32' # via project (pyproject.toml) - click==8.1.7 ; platform_system != 'Windows' + click==8.1.7 ; sys_platform != 'win32' # via black - mypy-extensions==1.0.0 ; platform_system != 'Windows' + mypy-extensions==1.0.0 ; sys_platform != 'win32' # via black - packaging==24.0 ; platform_system != 'Windows' + packaging==24.0 ; sys_platform != 'win32' # via black - pathspec==0.12.1 ; platform_system != 'Windows' + pathspec==0.12.1 ; sys_platform != 'win32' # via black - platformdirs==4.2.0 ; platform_system != 'Windows' + platformdirs==4.2.0 ; sys_platform != 'win32' # via black ----- stderr ----- diff --git a/crates/uv/tests/it/pip_sync.rs b/crates/uv/tests/it/pip_sync.rs index 9884ed116..690c0fdd9 100644 --- a/crates/uv/tests/it/pip_sync.rs +++ b/crates/uv/tests/it/pip_sync.rs @@ -1834,7 +1834,7 @@ fn install_url_built_dist_cached() -> Result<()> { requirements_txt.write_str("tqdm @ https://files.pythonhosted.org/packages/00/e5/f12a80907d0884e6dff9c16d0c0114d81b8cd07dc3ae54c5e962cc83037e/tqdm-4.66.1-py3-none-any.whl")?; let filters = if cfg!(windows) { - [("warning: The package `tqdm` requires `colorama ; platform_system == 'Windows'`, but it's not installed\n", "")] + [("warning: The package `tqdm` requires `colorama ; sys_platform == 'win32'`, but it's not installed\n", "")] .into_iter() .chain(context.filters()) .collect() diff --git a/crates/uv/tests/it/snapshots/it__ecosystem__black-lock-file.snap b/crates/uv/tests/it/snapshots/it__ecosystem__black-lock-file.snap index aea8afcc7..19f1f6611 100644 --- a/crates/uv/tests/it/snapshots/it__ecosystem__black-lock-file.snap +++ b/crates/uv/tests/it/snapshots/it__ecosystem__black-lock-file.snap @@ -230,7 +230,7 @@ name = "click" version = "8.1.7" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/96/d3/f04c7bfcf5c1862a2a5b845c6b2b360488cf47af55dfa79c98f6a6bf98b5/click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de", size = 336121 } wheels = [ diff --git a/crates/uv/tests/it/snapshots/it__ecosystem__github-wikidata-bot-lock-file.snap b/crates/uv/tests/it/snapshots/it__ecosystem__github-wikidata-bot-lock-file.snap index 5fb225ed6..63ab767b8 100644 --- a/crates/uv/tests/it/snapshots/it__ecosystem__github-wikidata-bot-lock-file.snap +++ b/crates/uv/tests/it/snapshots/it__ecosystem__github-wikidata-bot-lock-file.snap @@ -1,5 +1,5 @@ --- -source: crates/uv/tests/ecosystem.rs +source: crates/uv/tests/it/ecosystem.rs expression: lock --- version = 1 @@ -419,7 +419,7 @@ name = "tqdm" version = "4.66.5" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/58/83/6ba9844a41128c62e810fddddd72473201f3eacde02046066142a2d96cc5/tqdm-4.66.5.tar.gz", hash = "sha256:e1020aef2e5096702d8a025ac7d16b1577279c9d63f8375b63083e9a5f0fcbad", size = 169504 } wheels = [ diff --git a/crates/uv/tests/it/snapshots/it__ecosystem__home-assistant-core-lock-file.snap b/crates/uv/tests/it/snapshots/it__ecosystem__home-assistant-core-lock-file.snap index 0bb3a8abd..804d15848 100644 --- a/crates/uv/tests/it/snapshots/it__ecosystem__home-assistant-core-lock-file.snap +++ b/crates/uv/tests/it/snapshots/it__ecosystem__home-assistant-core-lock-file.snap @@ -242,18 +242,18 @@ name = "bleak" version = "0.22.2" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "dbus-fast", marker = "platform_system == 'Linux'" }, - { name = "pyobjc-core", marker = "platform_system == 'Darwin'" }, - { name = "pyobjc-framework-corebluetooth", marker = "platform_system == 'Darwin'" }, - { name = "pyobjc-framework-libdispatch", marker = "platform_system == 'Darwin'" }, - { name = "winrt-runtime", marker = "platform_system == 'Windows'" }, - { name = "winrt-windows-devices-bluetooth", marker = "platform_system == 'Windows'" }, - { name = "winrt-windows-devices-bluetooth-advertisement", marker = "platform_system == 'Windows'" }, - { name = "winrt-windows-devices-bluetooth-genericattributeprofile", marker = "platform_system == 'Windows'" }, - { name = "winrt-windows-devices-enumeration", marker = "platform_system == 'Windows'" }, - { name = "winrt-windows-foundation", marker = "platform_system == 'Windows'" }, - { name = "winrt-windows-foundation-collections", marker = "platform_system == 'Windows'" }, - { name = "winrt-windows-storage-streams", marker = "platform_system == 'Windows'" }, + { name = "dbus-fast", marker = "sys_platform == 'linux'" }, + { name = "pyobjc-core", marker = "sys_platform == 'darwin'" }, + { name = "pyobjc-framework-corebluetooth", marker = "sys_platform == 'darwin'" }, + { name = "pyobjc-framework-libdispatch", marker = "sys_platform == 'darwin'" }, + { name = "winrt-runtime", marker = "sys_platform == 'win32'" }, + { name = "winrt-windows-devices-bluetooth", marker = "sys_platform == 'win32'" }, + { name = "winrt-windows-devices-bluetooth-advertisement", marker = "sys_platform == 'win32'" }, + { name = "winrt-windows-devices-bluetooth-genericattributeprofile", marker = "sys_platform == 'win32'" }, + { name = "winrt-windows-devices-enumeration", marker = "sys_platform == 'win32'" }, + { name = "winrt-windows-foundation", marker = "sys_platform == 'win32'" }, + { name = "winrt-windows-foundation-collections", marker = "sys_platform == 'win32'" }, + { name = "winrt-windows-storage-streams", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/03/76/733131e2935f4fcdc7a0dd47cbc5090e12d578297804fb0482575db43f3c/bleak-0.22.2.tar.gz", hash = "sha256:09010c0f4bd843e7dcaa1652e1bfb2450ce690da08d4c6163f0723aaa986e9fe", size = 122229 } wheels = [ @@ -266,8 +266,8 @@ version = "3.5.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "bleak" }, - { name = "bluetooth-adapters", marker = "platform_system == 'Linux'" }, - { name = "dbus-fast", marker = "platform_system == 'Linux'" }, + { name = "bluetooth-adapters", marker = "sys_platform == 'linux'" }, + { name = "dbus-fast", marker = "sys_platform == 'linux'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/e6/f2/21af947a3b9f3f1bf0dbfe1dc7fb5ea6a7ef87dbf0bb7266a4d06d9c18e1/bleak_retry_connector-3.5.0.tar.gz", hash = "sha256:f616a25113ff7be05d95cbfbcd9b30e3762202521c4b3727bae5ebdb4cca3496", size = 15393 } wheels = [ diff --git a/crates/uv/tests/it/snapshots/it__ecosystem__saleor-lock-file.snap b/crates/uv/tests/it/snapshots/it__ecosystem__saleor-lock-file.snap index 8c79b4dce..e937950a4 100644 --- a/crates/uv/tests/it/snapshots/it__ecosystem__saleor-lock-file.snap +++ b/crates/uv/tests/it/snapshots/it__ecosystem__saleor-lock-file.snap @@ -336,7 +336,7 @@ name = "click" version = "8.1.7" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/96/d3/f04c7bfcf5c1862a2a5b845c6b2b360488cf47af55dfa79c98f6a6bf98b5/click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de", size = 336121 } wheels = [ diff --git a/crates/uv/tests/it/snapshots/it__ecosystem__transformers-lock-file.snap b/crates/uv/tests/it/snapshots/it__ecosystem__transformers-lock-file.snap index 8e22a4bdc..925bc19dc 100644 --- a/crates/uv/tests/it/snapshots/it__ecosystem__transformers-lock-file.snap +++ b/crates/uv/tests/it/snapshots/it__ecosystem__transformers-lock-file.snap @@ -5,21 +5,21 @@ expression: lock version = 1 requires-python = ">=3.9.0" resolution-markers = [ - "python_full_version < '3.10' and platform_machine == 'arm64' and platform_system == 'Darwin'", - "python_full_version < '3.10' and platform_machine == 'aarch64' and platform_system == 'Linux'", - "(python_full_version < '3.10' and platform_machine != 'arm64' and platform_system == 'Darwin') or (python_full_version < '3.10' and platform_machine != 'aarch64' and platform_system == 'Linux') or (python_full_version < '3.10' and platform_system != 'Darwin' and platform_system != 'Linux')", - "python_full_version == '3.10.*' and platform_system == 'Darwin'", - "python_full_version == '3.10.*' and platform_machine == 'aarch64' and platform_system == 'Linux'", - "(python_full_version == '3.10.*' and platform_machine != 'aarch64' and platform_system == 'Linux') or (python_full_version == '3.10.*' and platform_system != 'Darwin' and platform_system != 'Linux')", - "python_full_version == '3.11.*' and platform_system == 'Darwin'", - "python_full_version == '3.11.*' and platform_machine == 'aarch64' and platform_system == 'Linux'", - "(python_full_version == '3.11.*' and platform_machine != 'aarch64' and platform_system == 'Linux') or (python_full_version == '3.11.*' and platform_system != 'Darwin' and platform_system != 'Linux')", - "python_full_version == '3.12.*' and platform_system == 'Darwin'", - "python_full_version == '3.12.*' and platform_machine == 'aarch64' and platform_system == 'Linux'", - "(python_full_version == '3.12.*' and platform_machine != 'aarch64' and platform_system == 'Linux') or (python_full_version == '3.12.*' and platform_system != 'Darwin' and platform_system != 'Linux')", - "python_full_version >= '3.13' and platform_system == 'Darwin'", - "python_full_version >= '3.13' and platform_machine == 'aarch64' and platform_system == 'Linux'", - "(python_full_version >= '3.13' and platform_machine != 'aarch64' and platform_system == 'Linux') or (python_full_version >= '3.13' and platform_system != 'Darwin' and platform_system != 'Linux')", + "python_full_version < '3.10' and platform_machine == 'arm64' and sys_platform == 'darwin'", + "python_full_version < '3.10' and platform_machine == 'aarch64' and sys_platform == 'linux'", + "(python_full_version < '3.10' and platform_machine != 'arm64' and sys_platform == 'darwin') or (python_full_version < '3.10' and platform_machine != 'aarch64' and sys_platform == 'linux') or (python_full_version < '3.10' and sys_platform != 'darwin' and sys_platform != 'linux')", + "python_full_version == '3.10.*' and sys_platform == 'darwin'", + "python_full_version == '3.10.*' and platform_machine == 'aarch64' and sys_platform == 'linux'", + "(python_full_version == '3.10.*' and platform_machine != 'aarch64' and sys_platform == 'linux') or (python_full_version == '3.10.*' and sys_platform != 'darwin' and sys_platform != 'linux')", + "python_full_version == '3.11.*' and sys_platform == 'darwin'", + "python_full_version == '3.11.*' and platform_machine == 'aarch64' and sys_platform == 'linux'", + "(python_full_version == '3.11.*' and platform_machine != 'aarch64' and sys_platform == 'linux') or (python_full_version == '3.11.*' and sys_platform != 'darwin' and sys_platform != 'linux')", + "python_full_version == '3.12.*' and sys_platform == 'darwin'", + "python_full_version == '3.12.*' and platform_machine == 'aarch64' and sys_platform == 'linux'", + "(python_full_version == '3.12.*' and platform_machine != 'aarch64' and sys_platform == 'linux') or (python_full_version == '3.12.*' and sys_platform != 'darwin' and sys_platform != 'linux')", + "python_full_version >= '3.13' and sys_platform == 'darwin'", + "python_full_version >= '3.13' and platform_machine == 'aarch64' and sys_platform == 'linux'", + "(python_full_version >= '3.13' and platform_machine != 'aarch64' and sys_platform == 'linux') or (python_full_version >= '3.13' and sys_platform != 'darwin' and sys_platform != 'linux')", ] [options] @@ -580,7 +580,7 @@ name = "click" version = "8.1.7" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/96/d3/f04c7bfcf5c1862a2a5b845c6b2b360488cf47af55dfa79c98f6a6bf98b5/click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de", size = 336121 } wheels = [ @@ -660,7 +660,7 @@ name = "colorlog" version = "6.8.2" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "(python_full_version < '3.10' and platform_machine != 'arm64' and platform_system == 'Darwin' and sys_platform == 'win32') or (platform_machine != 'aarch64' and platform_system == 'Linux' and sys_platform == 'win32') or (platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform == 'win32')" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/db/38/2992ff192eaa7dd5a793f8b6570d6bbe887c4fbbf7e72702eb0a693a01c8/colorlog-6.8.2.tar.gz", hash = "sha256:3e3e079a41feb5a1b64f978b5ea4f46040a94f11f0e8bbb8261e3dbbeca64d44", size = 16529 } wheels = [ @@ -875,7 +875,7 @@ name = "docker" version = "7.1.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "pywin32", marker = "(python_full_version < '3.10' and platform_machine != 'arm64' and platform_system == 'Darwin' and sys_platform == 'win32') or (platform_machine != 'aarch64' and platform_system == 'Linux' and sys_platform == 'win32') or (platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform == 'win32')" }, + { name = "pywin32", marker = "sys_platform == 'win32'" }, { name = "requests" }, { name = "urllib3" }, ] @@ -1440,7 +1440,7 @@ name = "humanfriendly" version = "10.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "pyreadline3", marker = "(python_full_version < '3.10' and platform_machine != 'arm64' and platform_system == 'Darwin' and sys_platform == 'win32') or (platform_machine != 'aarch64' and platform_system == 'Linux' and sys_platform == 'win32') or (platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform == 'win32')" }, + { name = "pyreadline3", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/cc/3f/2c29224acb2e2df4d2046e4c73ee2662023c58ff5b113c4c1adac0886c43/humanfriendly-10.0.tar.gz", hash = "sha256:6b0b831ce8f15f7300721aa49829fc4e83921a9a301cc7f606be6686a2288ddc", size = 360702 } wheels = [ @@ -1652,7 +1652,7 @@ version = "5.7.2" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "platformdirs" }, - { name = "pywin32", marker = "(python_full_version < '3.10' and platform_machine != 'arm64' and platform_python_implementation != 'PyPy' and platform_system == 'Darwin' and sys_platform == 'win32') or (platform_machine != 'aarch64' and platform_python_implementation != 'PyPy' and platform_system == 'Linux' and sys_platform == 'win32') or (platform_python_implementation != 'PyPy' and platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform == 'win32')" }, + { name = "pywin32", marker = "platform_python_implementation != 'PyPy' and sys_platform == 'win32'" }, { name = "traitlets" }, ] sdist = { url = "https://files.pythonhosted.org/packages/00/11/b56381fa6c3f4cc5d2cf54a7dbf98ad9aa0b339ef7a601d6053538b079a7/jupyter_core-5.7.2.tar.gz", hash = "sha256:aa5f8d32bbf6b431ac830496da7392035d6f61b4f54872f15c4bd2a9c3f536d9", size = 87629 } @@ -1700,7 +1700,7 @@ dependencies = [ { name = "packaging" }, { name = "regex" }, { name = "rich" }, - { name = "tensorflow-text", marker = "platform_system != 'Darwin'" }, + { name = "tensorflow-text", marker = "sys_platform != 'darwin'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/da/bf/7f34bfd78555f8ce68f51f6583b4a91a279e34dee2013047e338529c3f8a/keras_nlp-0.14.4.tar.gz", hash = "sha256:abd5886efc60d52f0970ac43d3791c87624bfa8f7a7048a66f9dbcb2d1d28771", size = 331838 } wheels = [ @@ -2869,7 +2869,7 @@ name = "portalocker" version = "2.0.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "pywin32", marker = "platform_system == 'Windows'" }, + { name = "pywin32", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/df/48/62cf97ff7d2233e7db29dfb83f1584e26289e88af8af39de1a76629ac487/portalocker-2.0.0.tar.gz", hash = "sha256:14487eed81aa914127edf0284e29c7ca8842c05bb33d96dc7e4bdb47282d26e4", size = 15204 } wheels = [ @@ -3206,7 +3206,7 @@ name = "pytest" version = "7.4.4" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "(python_full_version < '3.10' and platform_machine != 'arm64' and platform_system == 'Darwin' and sys_platform == 'win32') or (platform_machine != 'aarch64' and platform_system == 'Linux' and sys_platform == 'win32') or (platform_system != 'Darwin' and platform_system != 'Linux' and sys_platform == 'win32')" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, { name = "iniconfig" }, { name = "packaging" }, @@ -4463,9 +4463,9 @@ name = "tensorflow-text" version = "2.15.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "tensorflow", marker = "platform_machine != 'arm64' or platform_system != 'Darwin'" }, + { name = "tensorflow", marker = "platform_machine != 'arm64' or sys_platform != 'darwin'" }, { name = "tensorflow-hub" }, - { name = "tensorflow-macos", marker = "platform_machine == 'arm64' and platform_system == 'Darwin'" }, + { name = "tensorflow-macos", marker = "platform_machine == 'arm64' and sys_platform == 'darwin'" }, ] wheels = [ { url = "https://files.pythonhosted.org/packages/63/0f/d260a5cc7d86d25eb67bb919f957106b76af4a039f064526290d9cf5d93e/tensorflow_text-2.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:db09ada839eb92aa23afc6c4e37257e6665d64ae048cfdce6374b5aa33f8f006", size = 6441513 }, @@ -4695,19 +4695,19 @@ dependencies = [ { name = "fsspec" }, { name = "jinja2" }, { name = "networkx" }, - { name = "nvidia-cublas-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" }, - { name = "nvidia-cuda-cupti-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" }, - { name = "nvidia-cuda-nvrtc-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" }, - { name = "nvidia-cuda-runtime-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" }, - { name = "nvidia-cudnn-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" }, - { name = "nvidia-cufft-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" }, - { name = "nvidia-curand-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" }, - { name = "nvidia-cusolver-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" }, - { name = "nvidia-cusparse-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" }, - { name = "nvidia-nccl-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" }, - { name = "nvidia-nvtx-cu12", marker = "platform_machine == 'x86_64' and platform_system == 'Linux'" }, + { name = "nvidia-cublas-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-cuda-cupti-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-cuda-nvrtc-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-cuda-runtime-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-cudnn-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-cufft-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-curand-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-cusolver-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-cusparse-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-nccl-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, + { name = "nvidia-nvtx-cu12", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'" }, { name = "sympy" }, - { name = "triton", marker = "python_full_version < '3.13' and platform_machine == 'x86_64' and platform_system == 'Linux'" }, + { name = "triton", marker = "python_full_version < '3.13' and platform_machine == 'x86_64' and sys_platform == 'linux'" }, { name = "typing-extensions" }, ] wheels = [ @@ -4792,7 +4792,7 @@ name = "tqdm" version = "4.66.5" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/58/83/6ba9844a41128c62e810fddddd72473201f3eacde02046066142a2d96cc5/tqdm-4.66.5.tar.gz", hash = "sha256:e1020aef2e5096702d8a025ac7d16b1577279c9d63f8375b63083e9a5f0fcbad", size = 169504 } wheels = [ @@ -5470,7 +5470,7 @@ name = "tzlocal" version = "5.2" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "tzdata", marker = "platform_system == 'Windows'" }, + { name = "tzdata", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/04/d3/c19d65ae67636fe63953b20c2e4a8ced4497ea232c43ff8d01db16de8dc0/tzlocal-5.2.tar.gz", hash = "sha256:8d399205578f1a9342816409cc1e46a93ebd5755e39ea2d85334bea911bf0e6e", size = 30201 } wheels = [ diff --git a/crates/uv/tests/it/snapshots/it__ecosystem__warehouse-lock-file.snap b/crates/uv/tests/it/snapshots/it__ecosystem__warehouse-lock-file.snap index 9f2c7526e..250e49b73 100644 --- a/crates/uv/tests/it/snapshots/it__ecosystem__warehouse-lock-file.snap +++ b/crates/uv/tests/it/snapshots/it__ecosystem__warehouse-lock-file.snap @@ -570,7 +570,7 @@ name = "click" version = "8.1.7" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/96/d3/f04c7bfcf5c1862a2a5b845c6b2b360488cf47af55dfa79c98f6a6bf98b5/click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de", size = 336121 } wheels = [ @@ -1706,7 +1706,7 @@ version = "1.6.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "click" }, - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, { name = "ghp-import" }, { name = "jinja2" }, { name = "markdown" }, diff --git a/scripts/benchmark/uv.lock b/scripts/benchmark/uv.lock index 66513074f..ded4d2344 100644 --- a/scripts/benchmark/uv.lock +++ b/scripts/benchmark/uv.lock @@ -200,7 +200,7 @@ name = "click" version = "8.1.7" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "platform_system == 'Windows'" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/96/d3/f04c7bfcf5c1862a2a5b845c6b2b360488cf47af55dfa79c98f6a6bf98b5/click-8.1.7.tar.gz", hash = "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de", size = 336121 } wheels = [