Add Python versions to markers implied from wheels (#14913)

Looking into  https://github.com/astral-sh/uv/issues/14836

This does resolve the issue, if the user adds `python_version ==
'3.8.*'` to the `required-environments`.
This commit is contained in:
Zanie Blue
2025-08-05 14:52:32 -05:00
committed by GitHub
parent b2e7b2b279
commit 1fb0fa045c
6 changed files with 447 additions and 270 deletions
@@ -5,7 +5,7 @@ use owo_colors::OwoColorize;
use tracing::debug;
use uv_distribution_filename::{BuildTag, WheelFilename};
use uv_pep440::VersionSpecifiers;
use uv_pep440::{Version, VersionSpecifier, VersionSpecifiers};
use uv_pep508::{MarkerExpression, MarkerOperator, MarkerTree, MarkerValueString};
use uv_platform_tags::{AbiTag, IncompatibleTag, LanguageTag, PlatformTag, TagPriority, Tags};
use uv_pypi_types::{HashDigest, Yanked};
@@ -804,11 +804,19 @@ impl IncompatibleWheel {
}
}
/// Given a wheel filename, determine the set of supported markers.
pub fn implied_markers(filename: &WheelFilename) -> MarkerTree {
let mut marker = implied_platform_markers(filename);
marker.and(implied_python_markers(filename));
marker
}
/// Given a wheel filename, determine the set of supported platforms, in terms of their markers.
///
/// This is roughly the inverse of platform tag generation: given a tag, we want to infer the
/// supported platforms (rather than generating the supported tags from a given platform).
pub fn implied_markers(filename: &WheelFilename) -> MarkerTree {
fn implied_platform_markers(filename: &WheelFilename) -> MarkerTree {
let mut marker = MarkerTree::FALSE;
for platform_tag in filename.platform_tags() {
match platform_tag {
@@ -904,6 +912,94 @@ pub fn implied_markers(filename: &WheelFilename) -> MarkerTree {
}
}
}
marker
}
/// Given a wheel filename, determine the set of supported Python versions, in terms of their markers.
///
/// This is roughly the inverse of Python tag generation: given a tag, we want to infer the
/// supported Python version (rather than generating the supported tags from a given Python version).
fn implied_python_markers(filename: &WheelFilename) -> MarkerTree {
let mut marker = MarkerTree::FALSE;
for python_tag in filename.python_tags() {
// First, construct the version marker based on the tag
let mut tree = match python_tag {
LanguageTag::None => {
// No Python tag means no Python version requirement.
return MarkerTree::TRUE;
}
LanguageTag::Python { major, minor: None } => {
MarkerTree::expression(MarkerExpression::Version {
key: uv_pep508::MarkerValueVersion::PythonVersion,
specifier: VersionSpecifier::equals_star_version(Version::new([u64::from(
*major,
)])),
})
}
LanguageTag::Python {
major,
minor: Some(minor),
}
| LanguageTag::CPython {
python_version: (major, minor),
}
| LanguageTag::PyPy {
python_version: (major, minor),
}
| LanguageTag::GraalPy {
python_version: (major, minor),
}
| LanguageTag::Pyston {
python_version: (major, minor),
} => MarkerTree::expression(MarkerExpression::Version {
key: uv_pep508::MarkerValueVersion::PythonVersion,
specifier: VersionSpecifier::equals_star_version(Version::new([
u64::from(*major),
u64::from(*minor),
])),
}),
};
// Then, add implementation markers for implementation-specific tags
match python_tag {
LanguageTag::None | LanguageTag::Python { .. } => {
// No implementation marker needed
}
LanguageTag::CPython { .. } => {
tree.and(MarkerTree::expression(MarkerExpression::String {
key: MarkerValueString::PlatformPythonImplementation,
operator: MarkerOperator::Equal,
value: arcstr::literal!("CPython"),
}));
}
LanguageTag::PyPy { .. } => {
tree.and(MarkerTree::expression(MarkerExpression::String {
key: MarkerValueString::PlatformPythonImplementation,
operator: MarkerOperator::Equal,
value: arcstr::literal!("PyPy"),
}));
}
LanguageTag::GraalPy { .. } => {
tree.and(MarkerTree::expression(MarkerExpression::String {
key: MarkerValueString::PlatformPythonImplementation,
operator: MarkerOperator::Equal,
value: arcstr::literal!("GraalPy"),
}));
}
LanguageTag::Pyston { .. } => {
tree.and(MarkerTree::expression(MarkerExpression::String {
key: MarkerValueString::PlatformPythonImplementation,
operator: MarkerOperator::Equal,
value: arcstr::literal!("Pyston"),
}));
}
}
marker.or(tree);
}
marker
}
@@ -914,7 +1010,25 @@ mod tests {
use super::*;
#[track_caller]
fn assert_markers(filename: &str, expected: &str) {
fn assert_platform_markers(filename: &str, expected: &str) {
let filename = WheelFilename::from_str(filename).unwrap();
assert_eq!(
implied_platform_markers(&filename),
expected.parse::<MarkerTree>().unwrap()
);
}
#[track_caller]
fn assert_python_markers(filename: &str, expected: &str) {
let filename = WheelFilename::from_str(filename).unwrap();
assert_eq!(
implied_python_markers(&filename),
expected.parse::<MarkerTree>().unwrap()
);
}
#[track_caller]
fn assert_implied_markers(filename: &str, expected: &str) {
let filename = WheelFilename::from_str(filename).unwrap();
assert_eq!(
implied_markers(&filename),
@@ -923,45 +1037,108 @@ mod tests {
}
#[test]
fn test_implied_markers() {
fn test_implied_platform_markers() {
let filename = WheelFilename::from_str("example-1.0-py3-none-any.whl").unwrap();
assert_eq!(implied_markers(&filename), MarkerTree::TRUE);
assert_eq!(implied_platform_markers(&filename), MarkerTree::TRUE);
assert_markers(
assert_platform_markers(
"example-1.0-cp310-cp310-win32.whl",
"sys_platform == 'win32' and platform_machine == 'x86'",
);
assert_markers(
assert_platform_markers(
"numpy-2.2.1-cp313-cp313t-win_amd64.whl",
"sys_platform == 'win32' and platform_machine == 'AMD64'",
);
assert_markers(
assert_platform_markers(
"numpy-2.2.1-cp313-cp313t-win_arm64.whl",
"sys_platform == 'win32' and platform_machine == 'arm64'",
);
assert_markers(
assert_platform_markers(
"numpy-2.2.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"sys_platform == 'linux' and platform_machine == 'aarch64'",
);
assert_markers(
assert_platform_markers(
"numpy-2.2.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"sys_platform == 'linux' and platform_machine == 'x86_64'",
);
assert_markers(
assert_platform_markers(
"numpy-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl",
"sys_platform == 'linux' and platform_machine == 'aarch64'",
);
assert_markers(
assert_platform_markers(
"numpy-2.2.1-cp310-cp310-macosx_14_0_x86_64.whl",
"sys_platform == 'darwin' and platform_machine == 'x86_64'",
);
assert_markers(
assert_platform_markers(
"numpy-2.2.1-cp310-cp310-macosx_10_9_x86_64.whl",
"sys_platform == 'darwin' and platform_machine == 'x86_64'",
);
assert_markers(
assert_platform_markers(
"numpy-2.2.1-cp310-cp310-macosx_11_0_arm64.whl",
"sys_platform == 'darwin' and platform_machine == 'arm64'",
);
}
#[test]
fn test_implied_python_markers() {
let filename = WheelFilename::from_str("example-1.0-none-none-any.whl").unwrap();
assert_eq!(implied_python_markers(&filename), MarkerTree::TRUE);
assert_python_markers(
"example-1.0-cp310-cp310-any.whl",
"python_full_version == '3.10.*' and platform_python_implementation == 'CPython'",
);
assert_python_markers(
"example-1.0-cp311-cp311-any.whl",
"python_full_version == '3.11.*' and platform_python_implementation == 'CPython'",
);
assert_python_markers(
"example-1.0-cp312-cp312-any.whl",
"python_full_version == '3.12.*' and platform_python_implementation == 'CPython'",
);
assert_python_markers(
"example-1.0-cp313-cp313-any.whl",
"python_full_version == '3.13.*' and platform_python_implementation == 'CPython'",
);
assert_python_markers(
"example-1.0-cp313-cp313t-any.whl",
"python_full_version == '3.13.*' and platform_python_implementation == 'CPython'",
);
assert_python_markers(
"example-1.0-pp310-pypy310_pp73-any.whl",
"python_full_version == '3.10.*' and platform_python_implementation == 'PyPy'",
);
assert_python_markers(
"example-1.0-py310-none-any.whl",
"python_full_version >= '3.10' and python_full_version < '3.11'",
);
assert_python_markers(
"example-1.0-py3-none-any.whl",
"python_full_version >= '3' and python_full_version < '4'",
);
assert_python_markers(
"example-1.0-py311.py312-none-any.whl",
"python_full_version >= '3.11' and python_full_version < '3.13'",
);
}
#[test]
fn test_implied_markers() {
assert_implied_markers(
"numpy-1.0-cp310-cp310-win32.whl",
"python_full_version == '3.10.*' and platform_python_implementation == 'CPython' and sys_platform == 'win32' and platform_machine == 'x86'",
);
assert_implied_markers(
"numpy-1.0-cp311-cp311-macosx_10_9_x86_64.whl",
"python_full_version == '3.11.*' and platform_python_implementation == 'CPython' and sys_platform == 'darwin' and platform_machine == 'x86_64'",
);
assert_implied_markers(
"numpy-1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"python_full_version == '3.12.*' and platform_python_implementation == 'CPython' and sys_platform == 'linux' and platform_machine == 'aarch64'",
);
assert_implied_markers(
"example-1.0-py3-none-any.whl",
"python_full_version >= '3' and python_full_version < '4'",
);
}
}
+2 -2
View File
@@ -6595,14 +6595,14 @@ fn add_remove_script_lock() -> Result<()> {
"#})?;
// Explicitly lock the script.
uv_snapshot!(context.filters(), context.lock().arg("--script").arg("script.py"), @r###"
uv_snapshot!(context.filters(), context.lock().arg("--script").arg("script.py"), @r"
success: true
exit_code: 0
----- stdout -----
----- stderr -----
Resolved 9 packages in [TIME]
"###);
");
let lock = context.read("script.py.lock");
+2 -2
View File
@@ -3224,9 +3224,9 @@ fn requirements_txt_complex_conflict_markers() -> Result<()> {
# via
# project
# torchvision
torchvision==0.21.0 ; (platform_machine == 'aarch64' and sys_platform == 'linux') or sys_platform == 'darwin'
torchvision==0.21.0 ; (python_full_version < '3.14' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux') or sys_platform == 'darwin'
# via project
torchvision==0.21.0+cpu ; (platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')
torchvision==0.21.0+cpu ; (python_full_version >= '3.14' and sys_platform == 'linux') or (platform_machine != 'aarch64' and sys_platform == 'linux') or (platform_python_implementation != 'CPython' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')
# via project
typing-extensions==4.12.2 \
--hash=sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d \
+209 -209
View File
File diff suppressed because it is too large Load Diff
+18 -18
View File
@@ -13659,8 +13659,8 @@ fn overlapping_resolution_markers() -> Result<()> {
resolution-markers = [
"sys_platform == 'linux' and extra != 'extra-14-ads-mega-model-cpu' and extra == 'extra-14-ads-mega-model-cu118'",
"sys_platform != 'linux' and extra != 'extra-14-ads-mega-model-cpu' and extra == 'extra-14-ads-mega-model-cu118'",
"platform_machine != 'aarch64' and sys_platform == 'linux' and extra == 'extra-14-ads-mega-model-cpu' and extra != 'extra-14-ads-mega-model-cu118'",
"platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'extra-14-ads-mega-model-cpu' and extra != 'extra-14-ads-mega-model-cu118'",
"(platform_machine != 'aarch64' and sys_platform == 'linux' and extra == 'extra-14-ads-mega-model-cpu' and extra != 'extra-14-ads-mega-model-cu118') or (platform_python_implementation != 'CPython' and sys_platform == 'linux' and extra == 'extra-14-ads-mega-model-cpu' and extra != 'extra-14-ads-mega-model-cu118')",
"platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux' and extra == 'extra-14-ads-mega-model-cpu' and extra != 'extra-14-ads-mega-model-cu118'",
"sys_platform != 'darwin' and sys_platform != 'linux' and extra == 'extra-14-ads-mega-model-cpu' and extra != 'extra-14-ads-mega-model-cu118'",
"sys_platform == 'darwin' and extra == 'extra-14-ads-mega-model-cpu' and extra != 'extra-14-ads-mega-model-cu118'",
"sys_platform == 'linux' and extra != 'extra-14-ads-mega-model-cpu' and extra != 'extra-14-ads-mega-model-cu118'",
@@ -13684,9 +13684,9 @@ fn overlapping_resolution_markers() -> Result<()> {
[package.optional-dependencies]
cpu = [
{ name = "torch", version = "2.2.2", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }, marker = "(platform_machine == 'aarch64' and sys_platform == 'linux' and extra == 'extra-14-ads-mega-model-cpu') or (platform_machine != 'aarch64' and extra == 'extra-14-ads-mega-model-cpu' and extra == 'extra-14-ads-mega-model-cu118') or (sys_platform != 'linux' and extra == 'extra-14-ads-mega-model-cpu' and extra == 'extra-14-ads-mega-model-cu118')" },
{ name = "torch", version = "2.2.2", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }, marker = "(platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux' and extra == 'extra-14-ads-mega-model-cpu') or (platform_machine != 'aarch64' and extra == 'extra-14-ads-mega-model-cpu' and extra == 'extra-14-ads-mega-model-cu118') or (platform_python_implementation != 'CPython' and extra == 'extra-14-ads-mega-model-cpu' and extra == 'extra-14-ads-mega-model-cu118') or (sys_platform != 'linux' and extra == 'extra-14-ads-mega-model-cpu' and extra == 'extra-14-ads-mega-model-cu118')" },
{ name = "torch", version = "2.2.2", source = { registry = "https://pypi.org/simple" }, marker = "(sys_platform == 'darwin' and extra == 'extra-14-ads-mega-model-cpu') or (extra == 'extra-14-ads-mega-model-cpu' and extra == 'extra-14-ads-mega-model-cu118')" },
{ name = "torch", version = "2.2.2+cpu", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }, marker = "(platform_machine != 'aarch64' and sys_platform == 'linux' and extra == 'extra-14-ads-mega-model-cpu') or (sys_platform != 'darwin' and sys_platform != 'linux' and extra == 'extra-14-ads-mega-model-cpu') or (sys_platform == 'darwin' and extra == 'extra-14-ads-mega-model-cpu' and extra == 'extra-14-ads-mega-model-cu118') or (sys_platform == 'linux' and extra == 'extra-14-ads-mega-model-cpu' and extra == 'extra-14-ads-mega-model-cu118')" },
{ name = "torch", version = "2.2.2+cpu", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }, marker = "(platform_machine != 'aarch64' and sys_platform == 'linux' and extra == 'extra-14-ads-mega-model-cpu') or (platform_python_implementation != 'CPython' and sys_platform == 'linux' and extra == 'extra-14-ads-mega-model-cpu') or (sys_platform != 'darwin' and sys_platform != 'linux' and extra == 'extra-14-ads-mega-model-cpu') or (sys_platform == 'darwin' and extra == 'extra-14-ads-mega-model-cpu' and extra == 'extra-14-ads-mega-model-cu118') or (sys_platform == 'linux' and extra == 'extra-14-ads-mega-model-cpu' and extra == 'extra-14-ads-mega-model-cu118')" },
]
cu118 = [
{ name = "torch", version = "2.2.2", source = { registry = "https://pypi.org/simple" } },
@@ -14133,15 +14133,15 @@ fn overlapping_resolution_markers() -> Result<()> {
version = "2.2.2"
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }
resolution-markers = [
"platform_machine == 'aarch64' and sys_platform == 'linux'",
"platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'",
]
dependencies = [
{ name = "filelock", marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "fsspec", marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "jinja2", marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "networkx", marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "sympy", marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "typing-extensions", marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "filelock", marker = "platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'" },
{ name = "fsspec", marker = "platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'" },
{ name = "jinja2", marker = "platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'" },
{ name = "networkx", marker = "platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'" },
{ name = "sympy", marker = "platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'" },
{ name = "typing-extensions", marker = "platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux'" },
]
wheels = [
{ url = "https://download.pytorch.org/whl/cpu/torch-2.2.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3a2c075218081ef9c7bf8c55c706f236daebb753da41de498aca7163257380bd", upload-time = "2025-01-29T22:50:59.083Z" },
@@ -14191,16 +14191,16 @@ fn overlapping_resolution_markers() -> Result<()> {
version = "2.2.2+cpu"
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }
resolution-markers = [
"platform_machine != 'aarch64' and sys_platform == 'linux'",
"(platform_machine != 'aarch64' and sys_platform == 'linux') or (platform_python_implementation != 'CPython' and sys_platform == 'linux')",
"sys_platform != 'darwin' and sys_platform != 'linux'",
]
dependencies = [
{ name = "filelock", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ name = "fsspec", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ name = "jinja2", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ name = "networkx", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ name = "sympy", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ name = "typing-extensions", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ name = "filelock", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (platform_python_implementation != 'CPython' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ name = "fsspec", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (platform_python_implementation != 'CPython' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ name = "jinja2", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (platform_python_implementation != 'CPython' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ name = "networkx", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (platform_python_implementation != 'CPython' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ name = "sympy", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (platform_python_implementation != 'CPython' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ name = "typing-extensions", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (platform_python_implementation != 'CPython' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
]
wheels = [
{ url = "https://download.pytorch.org/whl/cpu/torch-2.2.2%2Bcpu-cp310-cp310-linux_x86_64.whl", hash = "sha256:02c4fac3c964e73f5f49003e0060c697f73b67c10cc23f51c592facb29e1bd53", upload-time = "2025-01-29T22:50:59.083Z" },
+25 -25
View File
@@ -8122,7 +8122,7 @@ fn universal_platform_fork() -> Result<()> {
.arg("requirements.in")
.arg("--universal")
.arg("-c")
.arg("constraints.txt"), @r###"
.arg("constraints.txt"), @r"
success: true
exit_code: 0
----- stdout -----
@@ -8146,9 +8146,9 @@ fn universal_platform_fork() -> Result<()> {
# via torch
sympy==1.13.1
# via torch
torch==2.5.1 ; (platform_machine == 'aarch64' and sys_platform == 'linux') or sys_platform == 'darwin'
torch==2.5.1 ; (python_full_version < '3.13' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux') or sys_platform == 'darwin'
# via -r requirements.in
torch==2.5.1+cpu ; (platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')
torch==2.5.1+cpu ; (python_full_version >= '3.13' and sys_platform == 'linux') or (platform_machine != 'aarch64' and sys_platform == 'linux') or (platform_python_implementation != 'CPython' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')
# via -r requirements.in
typing-extensions==4.9.0
# via
@@ -8157,7 +8157,7 @@ fn universal_platform_fork() -> Result<()> {
----- stderr -----
Resolved 11 packages in [TIME]
"###
"
);
Ok(())
@@ -8552,7 +8552,7 @@ fn universal_disjoint_base_or_local_requirement() -> Result<()> {
.arg("requirements.in")
.arg("--universal")
.arg("--find-links")
.arg("https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html"), @r###"
.arg("https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html"), @r"
success: true
exit_code: 0
----- stdout -----
@@ -8578,7 +8578,7 @@ fn universal_disjoint_base_or_local_requirement() -> Result<()> {
# via torch
sympy==1.13.3
# via torch
torch==2.0.0 ; (python_full_version < '3.11' and platform_machine == 'aarch64' and sys_platform == 'linux') or (python_full_version < '3.11' and sys_platform == 'darwin')
torch==2.0.0 ; (python_full_version < '3.11' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux') or (python_full_version < '3.11' and sys_platform == 'darwin')
# via
# -r requirements.in
# example
@@ -8586,7 +8586,7 @@ fn universal_disjoint_base_or_local_requirement() -> Result<()> {
# via
# -r requirements.in
# example
torch==2.0.0+cu118 ; (python_full_version >= '3.11' and python_full_version < '3.13' and sys_platform == 'darwin') or (python_full_version >= '3.11' and python_full_version < '3.13' and sys_platform == 'linux') or (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')
torch==2.0.0+cu118 ; (python_full_version >= '3.11' and python_full_version < '3.13' and sys_platform == 'darwin') or (python_full_version >= '3.11' and python_full_version < '3.13' and sys_platform == 'linux') or (python_full_version < '3.13' and platform_machine != 'aarch64' and sys_platform == 'linux') or (python_full_version < '3.13' and platform_python_implementation != 'CPython' and sys_platform == 'linux') or (python_full_version < '3.13' and sys_platform != 'darwin' and sys_platform != 'linux')
# via
# -r requirements.in
# example
@@ -8598,7 +8598,7 @@ fn universal_disjoint_base_or_local_requirement() -> Result<()> {
----- stderr -----
Resolved 14 packages in [TIME]
"###
"
);
Ok(())
@@ -8633,7 +8633,7 @@ fn universal_nested_overlapping_local_requirement() -> Result<()> {
.arg("requirements.in")
.arg("--universal")
.arg("--find-links")
.arg("https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html"), @r###"
.arg("https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html"), @r"
success: true
exit_code: 0
----- stdout -----
@@ -8664,7 +8664,7 @@ fn universal_nested_overlapping_local_requirement() -> Result<()> {
# via sympy
networkx==3.4.2
# via torch
pytorch-triton-rocm==2.3.0 ; (implementation_name != 'cpython' and platform_machine != 'aarch64' and sys_platform == 'linux') or (implementation_name != 'cpython' and sys_platform != 'darwin' and sys_platform != 'linux' and sys_platform != 'win32')
pytorch-triton-rocm==2.3.0 ; (python_full_version >= '3.13' and implementation_name != 'cpython' and sys_platform == 'linux') or (implementation_name != 'cpython' and platform_machine != 'aarch64' and sys_platform == 'linux') or (implementation_name != 'cpython' and platform_python_implementation != 'CPython' and sys_platform == 'linux') or (implementation_name != 'cpython' and sys_platform != 'darwin' and sys_platform != 'linux' and sys_platform != 'win32')
# via torch
sympy==1.13.3
# via torch
@@ -8675,9 +8675,9 @@ fn universal_nested_overlapping_local_requirement() -> Result<()> {
# -r requirements.in
# example
# triton
torch==2.3.0 ; (implementation_name != 'cpython' and platform_machine == 'aarch64' and sys_platform == 'linux') or (implementation_name != 'cpython' and sys_platform == 'darwin') or (implementation_name != 'cpython' and sys_platform == 'win32')
torch==2.3.0 ; (python_full_version < '3.13' and implementation_name != 'cpython' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux') or (implementation_name != 'cpython' and sys_platform == 'darwin') or (implementation_name != 'cpython' and sys_platform == 'win32')
# via -r requirements.in
torch==2.3.0+rocm6.0 ; (implementation_name != 'cpython' and platform_machine != 'aarch64' and sys_platform == 'linux') or (implementation_name != 'cpython' and sys_platform != 'darwin' and sys_platform != 'linux' and sys_platform != 'win32')
torch==2.3.0+rocm6.0 ; (python_full_version >= '3.13' and implementation_name != 'cpython' and sys_platform == 'linux') or (implementation_name != 'cpython' and platform_machine != 'aarch64' and sys_platform == 'linux') or (implementation_name != 'cpython' and platform_python_implementation != 'CPython' and sys_platform == 'linux') or (implementation_name != 'cpython' and sys_platform != 'darwin' and sys_platform != 'linux' and sys_platform != 'win32')
# via -r requirements.in
triton==2.0.0 ; implementation_name == 'cpython' and platform_machine == 'x86_64' and sys_platform == 'linux'
# via torch
@@ -8686,7 +8686,7 @@ fn universal_nested_overlapping_local_requirement() -> Result<()> {
----- stderr -----
Resolved 19 packages in [TIME]
"###
"
);
// A similar case, except the nested marker is now on the path requirement.
@@ -8797,7 +8797,7 @@ fn universal_nested_disjoint_local_requirement() -> Result<()> {
.arg("requirements.in")
.arg("--universal")
.arg("--find-links")
.arg("https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html"), @r###"
.arg("https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html"), @r"
success: true
exit_code: 0
----- stdout -----
@@ -8828,7 +8828,7 @@ fn universal_nested_disjoint_local_requirement() -> Result<()> {
# via sympy
networkx==3.4.2
# via torch
pytorch-triton-rocm==2.3.0 ; (os_name != 'Linux' and platform_machine != 'aarch64' and sys_platform == 'linux') or (os_name != 'Linux' and sys_platform != 'darwin' and sys_platform != 'linux' and sys_platform != 'win32')
pytorch-triton-rocm==2.3.0 ; (python_full_version >= '3.13' and os_name != 'Linux' and sys_platform == 'linux') or (os_name != 'Linux' and platform_machine != 'aarch64' and sys_platform == 'linux') or (os_name != 'Linux' and platform_python_implementation != 'CPython' and sys_platform == 'linux') or (os_name != 'Linux' and sys_platform != 'darwin' and sys_platform != 'linux' and sys_platform != 'win32')
# via torch
sympy==1.13.3
# via torch
@@ -8843,9 +8843,9 @@ fn universal_nested_disjoint_local_requirement() -> Result<()> {
# -r requirements.in
# example
# triton
torch==2.3.0 ; (os_name != 'Linux' and platform_machine == 'aarch64' and sys_platform == 'linux') or (os_name != 'Linux' and sys_platform == 'darwin') or (os_name != 'Linux' and sys_platform == 'win32')
torch==2.3.0 ; (python_full_version < '3.13' and os_name != 'Linux' and platform_machine == 'aarch64' and platform_python_implementation == 'CPython' and sys_platform == 'linux') or (os_name != 'Linux' and sys_platform == 'darwin') or (os_name != 'Linux' and sys_platform == 'win32')
# via -r requirements.in
torch==2.3.0+rocm6.0 ; (os_name != 'Linux' and platform_machine != 'aarch64' and sys_platform == 'linux') or (os_name != 'Linux' and sys_platform != 'darwin' and sys_platform != 'linux' and sys_platform != 'win32')
torch==2.3.0+rocm6.0 ; (python_full_version >= '3.13' and os_name != 'Linux' and sys_platform == 'linux') or (os_name != 'Linux' and platform_machine != 'aarch64' and sys_platform == 'linux') or (os_name != 'Linux' and platform_python_implementation != 'CPython' and sys_platform == 'linux') or (os_name != 'Linux' and sys_platform != 'darwin' and sys_platform != 'linux' and sys_platform != 'win32')
# via -r requirements.in
triton==2.0.0 ; implementation_name == 'cpython' and os_name == 'Linux' and platform_machine == 'x86_64' and sys_platform == 'linux'
# via torch
@@ -8854,7 +8854,7 @@ fn universal_nested_disjoint_local_requirement() -> Result<()> {
----- stderr -----
Resolved 20 packages in [TIME]
"###
"
);
Ok(())
@@ -9587,7 +9587,7 @@ fn universal_marker_propagation() -> Result<()> {
# via requests
charset-normalizer==3.3.2
# via requests
cmake==3.28.4 ; platform_machine == 'x86_64' and sys_platform != 'darwin' and sys_platform != 'win32'
cmake==3.28.4 ; (python_full_version != '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and platform_python_implementation != 'CPython' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform != 'darwin' and sys_platform != 'linux' and sys_platform != 'win32')
# via pytorch-triton-rocm
filelock==3.13.1
# via
@@ -9599,7 +9599,7 @@ fn universal_marker_propagation() -> Result<()> {
# via requests
jinja2==3.1.3
# via torch
lit==18.1.2 ; platform_machine == 'x86_64' and sys_platform != 'darwin' and sys_platform != 'win32'
lit==18.1.2 ; (python_full_version != '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and platform_python_implementation != 'CPython' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform != 'darwin' and sys_platform != 'linux' and sys_platform != 'win32')
# via pytorch-triton-rocm
markupsafe==2.1.5
# via jinja2
@@ -9615,17 +9615,17 @@ fn universal_marker_propagation() -> Result<()> {
# via torchvision
pillow==10.2.0
# via torchvision
pytorch-triton-rocm==2.0.2 ; platform_machine == 'x86_64' and sys_platform != 'darwin' and sys_platform != 'win32'
pytorch-triton-rocm==2.0.2 ; (python_full_version != '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and platform_python_implementation != 'CPython' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform != 'darwin' and sys_platform != 'linux' and sys_platform != 'win32')
# via torch
requests==2.31.0
# via torchvision
sympy==1.12
# via torch
torch==2.0.0 ; (platform_machine == 'x86_64' and sys_platform == 'darwin') or (platform_machine == 'x86_64' and sys_platform == 'win32')
torch==2.0.0 ; (python_full_version == '3.11.*' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'darwin') or (platform_machine == 'x86_64' and sys_platform == 'win32')
# via
# -r requirements.in
# torchvision
torch==2.0.0+rocm5.4.2 ; platform_machine == 'x86_64' and sys_platform != 'darwin' and sys_platform != 'win32'
torch==2.0.0+rocm5.4.2 ; (python_full_version != '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and platform_python_implementation != 'CPython' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform != 'darwin' and sys_platform != 'linux' and sys_platform != 'win32')
# via
# -r requirements.in
# pytorch-triton-rocm
@@ -9634,9 +9634,9 @@ fn universal_marker_propagation() -> Result<()> {
# via
# -r requirements.in
# torchvision
torchvision==0.15.1 ; (platform_machine == 'x86_64' and sys_platform == 'darwin') or (platform_machine == 'x86_64' and sys_platform == 'win32')
torchvision==0.15.1 ; (python_full_version == '3.11.*' and platform_machine == 'x86_64' and platform_python_implementation == 'CPython' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'darwin') or (platform_machine == 'x86_64' and sys_platform == 'win32')
# via -r requirements.in
torchvision==0.15.1+rocm5.4.2 ; platform_machine == 'x86_64' and sys_platform != 'darwin' and sys_platform != 'win32'
torchvision==0.15.1+rocm5.4.2 ; (python_full_version != '3.11.*' and platform_machine == 'x86_64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and platform_python_implementation != 'CPython' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform != 'darwin' and sys_platform != 'linux' and sys_platform != 'win32')
# via -r requirements.in
torchvision==0.17.0 ; platform_machine != 'x86_64'
# via -r requirements.in