Use a mirror with upload timestamps for PyTorch (#11086)

## Summary

This PR migrates all of our PyTorch tests to use our own mirror, which
includes upload timestamps that we can use to enforce
`--excludes-newer`, making the tests far more stable over time. (Today,
if you checkout old versions of `uv`, many of the PyTorch tests will
fail, since the index contents drift over time.)

Some snapshots changed in this PR (see, e.g.,
`universal_nested_overlapping_local_requirement`). The underlying reason
is that I used the current timestamp when setting upload times in the
PyTorch mirror, but those tests read from both the PyTorch
`--find-links` index _and_ PyPI. I guess we don't omit `--find-links`
entries based on `--excludes-newer`? That might be a bug. But I had to
_increase_ the `--excludes-newer` to include the PyTorch mirror's
`--find-links`, which meant pulling in some newer packages from PyPI
too. This is fine: it's a one-time churn, and they'll be stable going
forward.
This commit is contained in:
Charlie Marsh 2025-01-29 20:02:30 -05:00 committed by GitHub
parent b871d2d102
commit 329de04758
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 450 additions and 364 deletions

View file

@ -1,5 +1,6 @@
use std::str::FromStr;
use jiff::Timestamp;
use tl::HTMLTag;
use tracing::{instrument, warn};
use url::Url;
@ -167,6 +168,28 @@ impl SimpleHtml {
None
};
// Extract the `size` field, which should be set on the `data-size` attribute. This isn't
// included in PEP 700, which omits the HTML API, but we respect it anyway. Since this
// field isn't standardized, we discard errors.
let size = link
.attributes()
.get("data-size")
.flatten()
.and_then(|size| std::str::from_utf8(size.as_bytes()).ok())
.map(|size| html_escape::decode_html_entities(size))
.and_then(|size| size.parse().ok());
// Extract the `upload-time` field, which should be set on the `data-upload-time` attribute. This isn't
// included in PEP 700, which omits the HTML API, but we respect it anyway. Since this
// field isn't standardized, we discard errors.
let upload_time = link
.attributes()
.get("data-upload-time")
.flatten()
.and_then(|upload_time| std::str::from_utf8(upload_time.as_bytes()).ok())
.map(|upload_time| html_escape::decode_html_entities(upload_time))
.and_then(|upload_time| Timestamp::from_str(&upload_time).ok());
Ok(Some(File {
core_metadata,
dist_info_metadata: None,
@ -176,8 +199,8 @@ impl SimpleHtml {
hashes,
filename: filename.to_string(),
url: decoded.to_string(),
size: None,
upload_time: None,
size,
upload_time,
}))
}
}

View file

@ -6930,7 +6930,7 @@ fn add_no_warn_index_url() -> Result<()> {
/// Add an index provided via `--index`.
#[test]
fn add_index() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(indoc! {r#"
@ -6944,7 +6944,7 @@ fn add_index() -> Result<()> {
constraint-dependencies = ["markupsafe<3"]
"#})?;
uv_snapshot!(context.filters(), context.add().arg("iniconfig==2.0.0").arg("--index").arg("https://pypi.org/simple").env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.add().arg("iniconfig==2.0.0").arg("--index").arg("https://pypi.org/simple"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -6990,6 +6990,9 @@ fn add_index() -> Result<()> {
version = 1
requires-python = ">=3.12"
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[manifest]
constraints = [{ name = "markupsafe", specifier = "<3" }]
@ -7017,7 +7020,7 @@ fn add_index() -> Result<()> {
});
// Adding a subsequent index should put it _above_ the existing index.
uv_snapshot!(context.filters(), context.add().arg("jinja2").arg("--index").arg("pytorch=https://download.pytorch.org/whl/cu121").env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.add().arg("jinja2").arg("--index").arg("pytorch=https://astral-sh.github.io/pytorch-mirror/whl/cu121"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -7051,7 +7054,7 @@ fn add_index() -> Result<()> {
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu121"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu121"
[tool.uv.sources]
jinja2 = { index = "pytorch" }
@ -7072,6 +7075,9 @@ fn add_index() -> Result<()> {
version = 1
requires-python = ">=3.12"
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[manifest]
constraints = [{ name = "markupsafe", specifier = "<3" }]
@ -7087,7 +7093,7 @@ fn add_index() -> Result<()> {
[[package]]
name = "jinja2"
version = "3.1.4"
source = { registry = "https://download.pytorch.org/whl/cu121" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu121" }
dependencies = [
{ name = "markupsafe" },
]
@ -7098,7 +7104,7 @@ fn add_index() -> Result<()> {
[[package]]
name = "markupsafe"
version = "2.1.5"
source = { registry = "https://download.pytorch.org/whl/cu121" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu121" }
sdist = { url = "https://download.pytorch.org/whl/MarkupSafe-2.1.5.tar.gz" }
wheels = [
{ url = "https://download.pytorch.org/whl/MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1" },
@ -7121,14 +7127,14 @@ fn add_index() -> Result<()> {
[package.metadata]
requires-dist = [
{ name = "iniconfig", specifier = "==2.0.0" },
{ name = "jinja2", specifier = ">=3.1.4", index = "https://download.pytorch.org/whl/cu121" },
{ name = "jinja2", specifier = ">=3.1.4", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu121" },
]
"###
);
});
// Adding a subsequent index with the same name should replace it.
uv_snapshot!(context.filters(), context.add().arg("jinja2").arg("--index").arg("pytorch=https://test.pypi.org/simple").env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.add().arg("jinja2").arg("--index").arg("pytorch=https://test.pypi.org/simple"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -7180,6 +7186,9 @@ fn add_index() -> Result<()> {
version = 1
requires-python = ">=3.12"
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[manifest]
constraints = [{ name = "markupsafe", specifier = "<3" }]
@ -7241,7 +7250,7 @@ fn add_index() -> Result<()> {
});
// Adding a subsequent index with the same URL should bump it to the top.
uv_snapshot!(context.filters(), context.add().arg("typing-extensions").arg("--index").arg("https://pypi.org/simple").env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.add().arg("typing-extensions").arg("--index").arg("https://pypi.org/simple"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -7296,6 +7305,9 @@ fn add_index() -> Result<()> {
version = 1
requires-python = ">=3.12"
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[manifest]
constraints = [{ name = "markupsafe", specifier = "<3" }]
@ -7368,7 +7380,7 @@ fn add_index() -> Result<()> {
});
// Adding a subsequent index with the same URL should bump it to the top, but retain the name.
uv_snapshot!(context.filters(), context.add().arg("typing-extensions").arg("--index").arg("https://test.pypi.org/simple").env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.add().arg("typing-extensions").arg("--index").arg("https://test.pypi.org/simple"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -7421,6 +7433,9 @@ fn add_index() -> Result<()> {
version = 1
requires-python = ">=3.12"
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[manifest]
constraints = [{ name = "markupsafe", specifier = "<3" }]

View file

@ -14723,7 +14723,7 @@ fn lock_named_index() -> Result<()> {
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu121"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu121"
explicit = true
[[tool.uv.index]]
@ -14800,7 +14800,7 @@ fn lock_default_index() -> Result<()> {
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu121"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu121"
"#,
)?;
@ -14860,7 +14860,7 @@ fn lock_default_index() -> Result<()> {
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu121"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu121"
default = true
"#,
)?;
@ -14916,7 +14916,7 @@ fn lock_default_index() -> Result<()> {
#[test]
fn lock_named_index_cli() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -14933,7 +14933,7 @@ fn lock_named_index_cli() -> Result<()> {
)?;
// The package references a non-existent index.
uv_snapshot!(context.filters(), context.lock().env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock(), @r###"
success: false
exit_code: 1
----- stdout -----
@ -14945,7 +14945,7 @@ fn lock_named_index_cli() -> Result<()> {
"###);
// But it's fine if it comes from the CLI.
uv_snapshot!(context.filters(), context.lock().arg("--index").arg("pytorch=https://download.pytorch.org/whl/cu121").env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock().arg("--index").arg("pytorch=https://astral-sh.github.io/pytorch-mirror/whl/cu121"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -14964,10 +14964,13 @@ fn lock_named_index_cli() -> Result<()> {
version = 1
requires-python = ">=3.12"
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[[package]]
name = "jinja2"
version = "3.1.2"
source = { registry = "https://download.pytorch.org/whl/cu121" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu121" }
dependencies = [
{ name = "markupsafe" },
]
@ -14978,7 +14981,7 @@ fn lock_named_index_cli() -> Result<()> {
[[package]]
name = "markupsafe"
version = "3.0.2"
source = { registry = "https://download.pytorch.org/whl/cu121" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu121" }
wheels = [
{ url = "https://download.pytorch.org/whl/MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15ab75ef81add55874e7ab7055e9c397312385bd9ced94920f2802310c930396" },
]
@ -14992,7 +14995,7 @@ fn lock_named_index_cli() -> Result<()> {
]
[package.metadata]
requires-dist = [{ name = "jinja2", specifier = "==3.1.2", index = "https://download.pytorch.org/whl/cu121" }]
requires-dist = [{ name = "jinja2", specifier = "==3.1.2", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu121" }]
"###
);
});
@ -15020,7 +15023,7 @@ fn lock_repeat_named_index() -> Result<()> {
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu121"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu121"
[[tool.uv.index]]
name = "pytorch"
@ -15081,7 +15084,7 @@ fn lock_repeat_named_index() -> Result<()> {
/// This includes names passed in via the CLI.
#[test]
fn lock_repeat_named_index_cli() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -15097,12 +15100,12 @@ fn lock_repeat_named_index_cli() -> Result<()> {
[[tool.uv.index]]
name = "pytorch"
url = "https://download.pytorch.org/whl/cu121"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu121"
"#,
)?;
// Resolve to the PyTorch index.
uv_snapshot!(context.filters(), context.lock().env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock(), @r###"
success: true
exit_code: 0
----- stdout -----
@ -15121,13 +15124,16 @@ fn lock_repeat_named_index_cli() -> Result<()> {
version = 1
requires-python = ">=3.12"
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[manifest]
constraints = [{ name = "markupsafe", specifier = "<3" }]
[[package]]
name = "jinja2"
version = "3.1.2"
source = { registry = "https://download.pytorch.org/whl/cu121" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu121" }
dependencies = [
{ name = "markupsafe" },
]
@ -15138,7 +15144,7 @@ fn lock_repeat_named_index_cli() -> Result<()> {
[[package]]
name = "markupsafe"
version = "2.1.5"
source = { registry = "https://download.pytorch.org/whl/cu121" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu121" }
sdist = { url = "https://download.pytorch.org/whl/MarkupSafe-2.1.5.tar.gz" }
wheels = [
{ url = "https://download.pytorch.org/whl/MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1" },
@ -15165,7 +15171,7 @@ fn lock_repeat_named_index_cli() -> Result<()> {
// Resolve to PyPI, since the PyTorch index is replaced by the Packse index, which doesn't
// include `jinja2`.
uv_snapshot!(context.filters(), context.lock().arg("--index").arg(format!("pytorch={}", packse_index_url())).env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock().arg("--index").arg(format!("pytorch={}", packse_index_url())), @r###"
success: true
exit_code: 0
----- stdout -----
@ -15184,6 +15190,9 @@ fn lock_repeat_named_index_cli() -> Result<()> {
version = 1
requires-python = ">=3.12"
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[manifest]
constraints = [{ name = "markupsafe", specifier = "<3" }]
@ -17671,7 +17680,7 @@ fn lock_multiple_sources_no_marker() -> Result<()> {
#[test]
fn lock_multiple_sources_index_disjoint_markers() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -17693,15 +17702,15 @@ fn lock_multiple_sources_index_disjoint_markers() -> Result<()> {
[[tool.uv.index]]
name = "torch-cu118"
url = "https://download.pytorch.org/whl/cu118"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu118"
[[tool.uv.index]]
name = "torch-cu124"
url = "https://download.pytorch.org/whl/cu124"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu124"
"#,
)?;
uv_snapshot!(context.filters(), context.lock().env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock(), @r###"
success: true
exit_code: 0
----- stdout -----
@ -17724,13 +17733,16 @@ fn lock_multiple_sources_index_disjoint_markers() -> Result<()> {
"sys_platform != 'win32'",
]
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[manifest]
constraints = [{ name = "markupsafe", specifier = "<3" }]
[[package]]
name = "jinja2"
version = "3.1.3"
source = { registry = "https://download.pytorch.org/whl/cu118" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }
resolution-markers = [
"sys_platform == 'win32'",
]
@ -17744,7 +17756,7 @@ fn lock_multiple_sources_index_disjoint_markers() -> Result<()> {
[[package]]
name = "jinja2"
version = "3.1.3"
source = { registry = "https://download.pytorch.org/whl/cu124" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }
resolution-markers = [
"sys_platform != 'win32'",
]
@ -17758,7 +17770,7 @@ fn lock_multiple_sources_index_disjoint_markers() -> Result<()> {
[[package]]
name = "markupsafe"
version = "2.1.5"
source = { registry = "https://download.pytorch.org/whl/cu118" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }
sdist = { url = "https://download.pytorch.org/whl/MarkupSafe-2.1.5.tar.gz" }
wheels = [
{ url = "https://download.pytorch.org/whl/MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1" },
@ -17774,21 +17786,21 @@ fn lock_multiple_sources_index_disjoint_markers() -> Result<()> {
version = "0.1.0"
source = { virtual = "." }
dependencies = [
{ name = "jinja2", version = "3.1.3", source = { registry = "https://download.pytorch.org/whl/cu118" }, marker = "sys_platform == 'win32'" },
{ name = "jinja2", version = "3.1.3", source = { registry = "https://download.pytorch.org/whl/cu124" }, marker = "sys_platform != 'win32'" },
{ name = "jinja2", version = "3.1.3", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }, marker = "sys_platform == 'win32'" },
{ name = "jinja2", version = "3.1.3", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }, marker = "sys_platform != 'win32'" },
]
[package.metadata]
requires-dist = [
{ name = "jinja2", marker = "sys_platform != 'win32'", specifier = ">=3,<3.1.4", index = "https://download.pytorch.org/whl/cu124" },
{ name = "jinja2", marker = "sys_platform == 'win32'", specifier = ">=3,<3.1.4", index = "https://download.pytorch.org/whl/cu118" },
{ name = "jinja2", marker = "sys_platform != 'win32'", specifier = ">=3,<3.1.4", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" },
{ name = "jinja2", marker = "sys_platform == 'win32'", specifier = ">=3,<3.1.4", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" },
]
"###
);
});
// Re-run with `--locked`.
uv_snapshot!(context.filters(), context.lock().arg("--locked").env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -17802,7 +17814,7 @@ fn lock_multiple_sources_index_disjoint_markers() -> Result<()> {
#[test]
fn lock_multiple_sources_index_mixed() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -17824,11 +17836,11 @@ fn lock_multiple_sources_index_mixed() -> Result<()> {
[[tool.uv.index]]
name = "torch-cu118"
url = "https://download.pytorch.org/whl/cu118"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu118"
"#,
)?;
uv_snapshot!(context.filters(), context.lock().env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock(), @r###"
success: true
exit_code: 0
----- stdout -----
@ -17851,13 +17863,16 @@ fn lock_multiple_sources_index_mixed() -> Result<()> {
"sys_platform != 'win32'",
]
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[manifest]
constraints = [{ name = "markupsafe", specifier = "<3" }]
[[package]]
name = "jinja2"
version = "3.1.3"
source = { registry = "https://download.pytorch.org/whl/cu118" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }
resolution-markers = [
"sys_platform == 'win32'",
]
@ -17891,7 +17906,7 @@ fn lock_multiple_sources_index_mixed() -> Result<()> {
[[package]]
name = "markupsafe"
version = "2.1.5"
source = { registry = "https://download.pytorch.org/whl/cu118" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }
sdist = { url = "https://download.pytorch.org/whl/MarkupSafe-2.1.5.tar.gz" }
wheels = [
{ url = "https://download.pytorch.org/whl/MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1" },
@ -17907,21 +17922,21 @@ fn lock_multiple_sources_index_mixed() -> Result<()> {
version = "0.1.0"
source = { virtual = "." }
dependencies = [
{ name = "jinja2", version = "3.1.3", source = { registry = "https://download.pytorch.org/whl/cu118" }, marker = "sys_platform == 'win32'" },
{ name = "jinja2", version = "3.1.3", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }, marker = "sys_platform == 'win32'" },
{ name = "jinja2", version = "3.1.4", source = { url = "https://files.pythonhosted.org/packages/31/80/3a54838c3fb461f6fec263ebf3a3a41771bd05190238de3486aae8540c36/jinja2-3.1.4-py3-none-any.whl" }, marker = "sys_platform != 'win32'" },
]
[package.metadata]
requires-dist = [
{ name = "jinja2", marker = "sys_platform != 'win32'", url = "https://files.pythonhosted.org/packages/31/80/3a54838c3fb461f6fec263ebf3a3a41771bd05190238de3486aae8540c36/jinja2-3.1.4-py3-none-any.whl" },
{ name = "jinja2", marker = "sys_platform == 'win32'", specifier = ">=3,<3.1.4", index = "https://download.pytorch.org/whl/cu118" },
{ name = "jinja2", marker = "sys_platform == 'win32'", specifier = ">=3,<3.1.4", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" },
]
"###
);
});
// Re-run with `--locked`.
uv_snapshot!(context.filters(), context.lock().arg("--locked").env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -17935,7 +17950,7 @@ fn lock_multiple_sources_index_mixed() -> Result<()> {
#[test]
fn lock_multiple_sources_index_non_total() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -17953,18 +17968,18 @@ fn lock_multiple_sources_index_non_total() -> Result<()> {
[[tool.uv.index]]
name = "torch-cu118"
url = "https://download.pytorch.org/whl/cu118"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu118"
"#,
)?;
uv_snapshot!(context.filters(), context.lock().env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock(), @r###"
success: false
exit_code: 2
----- stdout -----
----- stderr -----
Resolved 4 packages in [TIME]
error: Found duplicate package `jinja2==3.1.3 @ registry+https://download.pytorch.org/whl/cu118`
error: Found duplicate package `jinja2==3.1.3 @ registry+https://astral-sh.github.io/pytorch-mirror/whl/cu118`
"###);
Ok(())
@ -17972,7 +17987,7 @@ fn lock_multiple_sources_index_non_total() -> Result<()> {
#[test]
fn lock_multiple_sources_index_explicit() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -18019,11 +18034,11 @@ fn lock_multiple_sources_index_explicit() -> Result<()> {
]
[options]
exclude-newer = "2024-03-25T00:00:00Z"
exclude-newer = "2025-01-30T00:00:00Z"
[[package]]
name = "jinja2"
version = "3.1.3"
version = "3.1.4"
source = { registry = "https://pypi.org/simple" }
resolution-markers = [
"sys_platform != 'win32'",
@ -18031,14 +18046,14 @@ fn lock_multiple_sources_index_explicit() -> Result<()> {
dependencies = [
{ name = "markupsafe", marker = "sys_platform != 'win32'" },
]
sdist = { url = "https://files.pythonhosted.org/packages/b2/5e/3a21abf3cd467d7876045335e681d276ac32492febe6d98ad89562d1a7e1/Jinja2-3.1.3.tar.gz", hash = "sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90", size = 268261 }
sdist = { url = "https://files.pythonhosted.org/packages/ed/55/39036716d19cab0747a5020fc7e907f362fbf48c984b14e62127f7e68e5d/jinja2-3.1.4.tar.gz", hash = "sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369", size = 240245 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/30/6d/6de6be2d02603ab56e72997708809e8a5b0fbfee080735109b40a3564843/Jinja2-3.1.3-py3-none-any.whl", hash = "sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa", size = 133236 },
{ url = "https://files.pythonhosted.org/packages/31/80/3a54838c3fb461f6fec263ebf3a3a41771bd05190238de3486aae8540c36/jinja2-3.1.4-py3-none-any.whl", hash = "sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d", size = 133271 },
]
[[package]]
name = "jinja2"
version = "3.1.3"
version = "3.1.4"
source = { registry = "https://test.pypi.org/simple" }
resolution-markers = [
"sys_platform == 'win32'",
@ -18046,27 +18061,47 @@ fn lock_multiple_sources_index_explicit() -> Result<()> {
dependencies = [
{ name = "markupsafe", marker = "sys_platform == 'win32'" },
]
sdist = { url = "https://test-files.pythonhosted.org/packages/3e/f0/69ae37cced6b277dc0419dbb1c6e4fb259e5e319a1a971061a2776316bec/Jinja2-3.1.3.tar.gz", hash = "sha256:27fb536952e578492fa66d8681d8967d8bdf1eb36368b1f842b53251c9f0bfe1", size = 268254 }
sdist = { url = "https://test-files.pythonhosted.org/packages/ed/55/39036716d19cab0747a5020fc7e907f362fbf48c984b14e62127f7e68e5d/jinja2-3.1.4.tar.gz", hash = "sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369", size = 240245 }
wheels = [
{ url = "https://test-files.pythonhosted.org/packages/47/dc/9d1c0f1ddbedb1e67f7d00e91819b5a9157056ad83bfa64c12ecef8a4f4e/Jinja2-3.1.3-py3-none-any.whl", hash = "sha256:ddd11470e8a1dc4c30e3146400f0130fed7d85886c5f8082f309355b4b0c1128", size = 133236 },
{ url = "https://test-files.pythonhosted.org/packages/31/80/3a54838c3fb461f6fec263ebf3a3a41771bd05190238de3486aae8540c36/jinja2-3.1.4-py3-none-any.whl", hash = "sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d", size = 133271 },
]
[[package]]
name = "markupsafe"
version = "2.1.5"
version = "3.0.2"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/87/5b/aae44c6655f3801e81aa3eef09dbbf012431987ba564d7231722f68df02d/MarkupSafe-2.1.5.tar.gz", hash = "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b", size = 19384 }
sdist = { url = "https://files.pythonhosted.org/packages/b2/97/5d42485e71dfc078108a86d6de8fa46db44a1a9295e89c5d6d4a06e23a62/markupsafe-3.0.2.tar.gz", hash = "sha256:ee55d3edf80167e48ea11a923c7386f4669df67d7994554387f84e7d8b0a2bf0", size = 20537 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/53/bd/583bf3e4c8d6a321938c13f49d44024dbe5ed63e0a7ba127e454a66da974/MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1", size = 18215 },
{ url = "https://files.pythonhosted.org/packages/48/d6/e7cd795fc710292c3af3a06d80868ce4b02bfbbf370b7cee11d282815a2a/MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:3c6b973f22eb18a789b1460b4b91bf04ae3f0c4234a0a6aa6b0a92f6f7b951d4", size = 14069 },
{ url = "https://files.pythonhosted.org/packages/51/b5/5d8ec796e2a08fc814a2c7d2584b55f889a55cf17dd1a90f2beb70744e5c/MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac07bad82163452a6884fe8fa0963fb98c2346ba78d779ec06bd7a6262132aee", size = 29452 },
{ url = "https://files.pythonhosted.org/packages/0a/0d/2454f072fae3b5a137c119abf15465d1771319dfe9e4acbb31722a0fff91/MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f5dfb42c4604dddc8e4305050aa6deb084540643ed5804d7455b5df8fe16f5e5", size = 28462 },
{ url = "https://files.pythonhosted.org/packages/2d/75/fd6cb2e68780f72d47e6671840ca517bda5ef663d30ada7616b0462ad1e3/MarkupSafe-2.1.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ea3d8a3d18833cf4304cd2fc9cbb1efe188ca9b5efef2bdac7adc20594a0e46b", size = 27869 },
{ url = "https://files.pythonhosted.org/packages/b0/81/147c477391c2750e8fc7705829f7351cf1cd3be64406edcf900dc633feb2/MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:d050b3361367a06d752db6ead6e7edeb0009be66bc3bae0ee9d97fb326badc2a", size = 33906 },
{ url = "https://files.pythonhosted.org/packages/8b/ff/9a52b71839d7a256b563e85d11050e307121000dcebc97df120176b3ad93/MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:bec0a414d016ac1a18862a519e54b2fd0fc8bbfd6890376898a6c0891dd82e9f", size = 32296 },
{ url = "https://files.pythonhosted.org/packages/88/07/2dc76aa51b481eb96a4c3198894f38b480490e834479611a4053fbf08623/MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:58c98fee265677f63a4385256a6d7683ab1832f3ddd1e66fe948d5880c21a169", size = 33038 },
{ url = "https://files.pythonhosted.org/packages/96/0c/620c1fb3661858c0e37eb3cbffd8c6f732a67cd97296f725789679801b31/MarkupSafe-2.1.5-cp312-cp312-win32.whl", hash = "sha256:8590b4ae07a35970728874632fed7bd57b26b0102df2d2b233b6d9d82f6c62ad", size = 16572 },
{ url = "https://files.pythonhosted.org/packages/3f/14/c3554d512d5f9100a95e737502f4a2323a1959f6d0d01e0d0997b35f7b10/MarkupSafe-2.1.5-cp312-cp312-win_amd64.whl", hash = "sha256:823b65d8706e32ad2df51ed89496147a42a2a6e01c13cfb6ffb8b1e92bc910bb", size = 17127 },
{ url = "https://files.pythonhosted.org/packages/22/09/d1f21434c97fc42f09d290cbb6350d44eb12f09cc62c9476effdb33a18aa/MarkupSafe-3.0.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:9778bd8ab0a994ebf6f84c2b949e65736d5575320a17ae8984a77fab08db94cf", size = 14274 },
{ url = "https://files.pythonhosted.org/packages/6b/b0/18f76bba336fa5aecf79d45dcd6c806c280ec44538b3c13671d49099fdd0/MarkupSafe-3.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:846ade7b71e3536c4e56b386c2a47adf5741d2d8b94ec9dc3e92e5e1ee1e2225", size = 12348 },
{ url = "https://files.pythonhosted.org/packages/e0/25/dd5c0f6ac1311e9b40f4af06c78efde0f3b5cbf02502f8ef9501294c425b/MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1c99d261bd2d5f6b59325c92c73df481e05e57f19837bdca8413b9eac4bd8028", size = 24149 },
{ url = "https://files.pythonhosted.org/packages/f3/f0/89e7aadfb3749d0f52234a0c8c7867877876e0a20b60e2188e9850794c17/MarkupSafe-3.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e17c96c14e19278594aa4841ec148115f9c7615a47382ecb6b82bd8fea3ab0c8", size = 23118 },
{ url = "https://files.pythonhosted.org/packages/d5/da/f2eeb64c723f5e3777bc081da884b414671982008c47dcc1873d81f625b6/MarkupSafe-3.0.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:88416bd1e65dcea10bc7569faacb2c20ce071dd1f87539ca2ab364bf6231393c", size = 22993 },
{ url = "https://files.pythonhosted.org/packages/da/0e/1f32af846df486dce7c227fe0f2398dc7e2e51d4a370508281f3c1c5cddc/MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2181e67807fc2fa785d0592dc2d6206c019b9502410671cc905d132a92866557", size = 24178 },
{ url = "https://files.pythonhosted.org/packages/c4/f6/bb3ca0532de8086cbff5f06d137064c8410d10779c4c127e0e47d17c0b71/MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:52305740fe773d09cffb16f8ed0427942901f00adedac82ec8b67752f58a1b22", size = 23319 },
{ url = "https://files.pythonhosted.org/packages/a2/82/8be4c96ffee03c5b4a034e60a31294daf481e12c7c43ab8e34a1453ee48b/MarkupSafe-3.0.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ad10d3ded218f1039f11a75f8091880239651b52e9bb592ca27de44eed242a48", size = 23352 },
{ url = "https://files.pythonhosted.org/packages/51/ae/97827349d3fcffee7e184bdf7f41cd6b88d9919c80f0263ba7acd1bbcb18/MarkupSafe-3.0.2-cp312-cp312-win32.whl", hash = "sha256:0f4ca02bea9a23221c0182836703cbf8930c5e9454bacce27e767509fa286a30", size = 15097 },
{ url = "https://files.pythonhosted.org/packages/c1/80/a61f99dc3a936413c3ee4e1eecac96c0da5ed07ad56fd975f1a9da5bc630/MarkupSafe-3.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:8e06879fc22a25ca47312fbe7c8264eb0b662f6db27cb2d3bbbc74b1df4b9b87", size = 15601 },
{ url = "https://files.pythonhosted.org/packages/83/0e/67eb10a7ecc77a0c2bbe2b0235765b98d164d81600746914bebada795e97/MarkupSafe-3.0.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ba9527cdd4c926ed0760bc301f6728ef34d841f405abf9d4f959c478421e4efd", size = 14274 },
{ url = "https://files.pythonhosted.org/packages/2b/6d/9409f3684d3335375d04e5f05744dfe7e9f120062c9857df4ab490a1031a/MarkupSafe-3.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f8b3d067f2e40fe93e1ccdd6b2e1d16c43140e76f02fb1319a05cf2b79d99430", size = 12352 },
{ url = "https://files.pythonhosted.org/packages/d2/f5/6eadfcd3885ea85fe2a7c128315cc1bb7241e1987443d78c8fe712d03091/MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:569511d3b58c8791ab4c2e1285575265991e6d8f8700c7be0e88f86cb0672094", size = 24122 },
{ url = "https://files.pythonhosted.org/packages/0c/91/96cf928db8236f1bfab6ce15ad070dfdd02ed88261c2afafd4b43575e9e9/MarkupSafe-3.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:15ab75ef81add55874e7ab7055e9c397312385bd9ced94920f2802310c930396", size = 23085 },
{ url = "https://files.pythonhosted.org/packages/c2/cf/c9d56af24d56ea04daae7ac0940232d31d5a8354f2b457c6d856b2057d69/MarkupSafe-3.0.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f3818cb119498c0678015754eba762e0d61e5b52d34c8b13d770f0719f7b1d79", size = 22978 },
{ url = "https://files.pythonhosted.org/packages/2a/9f/8619835cd6a711d6272d62abb78c033bda638fdc54c4e7f4272cf1c0962b/MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:cdb82a876c47801bb54a690c5ae105a46b392ac6099881cdfb9f6e95e4014c6a", size = 24208 },
{ url = "https://files.pythonhosted.org/packages/f9/bf/176950a1792b2cd2102b8ffeb5133e1ed984547b75db47c25a67d3359f77/MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:cabc348d87e913db6ab4aa100f01b08f481097838bdddf7c7a84b7575b7309ca", size = 23357 },
{ url = "https://files.pythonhosted.org/packages/ce/4f/9a02c1d335caabe5c4efb90e1b6e8ee944aa245c1aaaab8e8a618987d816/MarkupSafe-3.0.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:444dcda765c8a838eaae23112db52f1efaf750daddb2d9ca300bcae1039adc5c", size = 23344 },
{ url = "https://files.pythonhosted.org/packages/ee/55/c271b57db36f748f0e04a759ace9f8f759ccf22b4960c270c78a394f58be/MarkupSafe-3.0.2-cp313-cp313-win32.whl", hash = "sha256:bcf3e58998965654fdaff38e58584d8937aa3096ab5354d493c77d1fdd66d7a1", size = 15101 },
{ url = "https://files.pythonhosted.org/packages/29/88/07df22d2dd4df40aba9f3e402e6dc1b8ee86297dddbad4872bd5e7b0094f/MarkupSafe-3.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:e6a2a455bd412959b57a172ce6328d2dd1f01cb2135efda2e4576e8a23fa3b0f", size = 15603 },
{ url = "https://files.pythonhosted.org/packages/62/6a/8b89d24db2d32d433dffcd6a8779159da109842434f1dd2f6e71f32f738c/MarkupSafe-3.0.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:b5a6b3ada725cea8a5e634536b1b01c30bcdcd7f9c6fff4151548d5bf6b3a36c", size = 14510 },
{ url = "https://files.pythonhosted.org/packages/7a/06/a10f955f70a2e5a9bf78d11a161029d278eeacbd35ef806c3fd17b13060d/MarkupSafe-3.0.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:a904af0a6162c73e3edcb969eeeb53a63ceeb5d8cf642fade7d39e7963a22ddb", size = 12486 },
{ url = "https://files.pythonhosted.org/packages/34/cf/65d4a571869a1a9078198ca28f39fba5fbb910f952f9dbc5220afff9f5e6/MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4aa4e5faecf353ed117801a068ebab7b7e09ffb6e1d5e412dc852e0da018126c", size = 25480 },
{ url = "https://files.pythonhosted.org/packages/0c/e3/90e9651924c430b885468b56b3d597cabf6d72be4b24a0acd1fa0e12af67/MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0ef13eaeee5b615fb07c9a7dadb38eac06a0608b41570d8ade51c56539e509d", size = 23914 },
{ url = "https://files.pythonhosted.org/packages/66/8c/6c7cf61f95d63bb866db39085150df1f2a5bd3335298f14a66b48e92659c/MarkupSafe-3.0.2-cp313-cp313t-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d16a81a06776313e817c951135cf7340a3e91e8c1ff2fac444cfd75fffa04afe", size = 23796 },
{ url = "https://files.pythonhosted.org/packages/bb/35/cbe9238ec3f47ac9a7c8b3df7a808e7cb50fe149dc7039f5f454b3fba218/MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:6381026f158fdb7c72a168278597a5e3a5222e83ea18f543112b2662a9b699c5", size = 25473 },
{ url = "https://files.pythonhosted.org/packages/e6/32/7621a4382488aa283cc05e8984a9c219abad3bca087be9ec77e89939ded9/MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:3d79d162e7be8f996986c064d1c7c817f6df3a77fe3d6859f6f9e7be4b8c213a", size = 24114 },
{ url = "https://files.pythonhosted.org/packages/0d/80/0985960e4b89922cb5a0bac0ed39c5b96cbc1a536a99f30e8c220a996ed9/MarkupSafe-3.0.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:131a3c7689c85f5ad20f9f6fb1b866f402c445b220c19fe4308c0b147ccd2ad9", size = 24098 },
{ url = "https://files.pythonhosted.org/packages/82/78/fedb03c7d5380df2427038ec8d973587e90561b2d90cd472ce9254cf348b/MarkupSafe-3.0.2-cp313-cp313t-win32.whl", hash = "sha256:ba8062ed2cf21c07a9e295d5b8a2a5ce678b913b45fdf68c32d95d6c1291e0b6", size = 15208 },
{ url = "https://files.pythonhosted.org/packages/4f/65/6079a46068dfceaeabb5dcad6d674f5f5c61a6fa5673746f42a9f4c233b3/MarkupSafe-3.0.2-cp313-cp313t-win_amd64.whl", hash = "sha256:e444a31f8db13eb18ada366ab3cf45fd4b31e4db1236a4448f68778c1d1a5a2f", size = 15739 },
]
[[package]]
@ -18074,8 +18109,8 @@ fn lock_multiple_sources_index_explicit() -> Result<()> {
version = "0.1.0"
source = { virtual = "." }
dependencies = [
{ name = "jinja2", version = "3.1.3", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform != 'win32'" },
{ name = "jinja2", version = "3.1.3", source = { registry = "https://test.pypi.org/simple" }, marker = "sys_platform == 'win32'" },
{ name = "jinja2", version = "3.1.4", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform != 'win32'" },
{ name = "jinja2", version = "3.1.4", source = { registry = "https://test.pypi.org/simple" }, marker = "sys_platform == 'win32'" },
]
[package.metadata]
@ -18365,7 +18400,7 @@ fn lock_multiple_sources_extra() -> Result<()> {
#[test]
fn lock_multiple_sources_index_overlapping_extras() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -18391,25 +18426,25 @@ fn lock_multiple_sources_index_overlapping_extras() -> Result<()> {
[[tool.uv.index]]
name = "torch-cu118"
url = "https://download.pytorch.org/whl/cu118"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu118"
explicit = true
[[tool.uv.index]]
name = "torch-cu124"
url = "https://download.pytorch.org/whl/cu124"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu124"
explicit = true
"#,
)?;
uv_snapshot!(context.filters(), context.lock().env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock(), @r###"
success: false
exit_code: 2
----- stdout -----
----- stderr -----
error: Requirements contain conflicting indexes for package `jinja2` in all marker environments:
- https://download.pytorch.org/whl/cu118
- https://download.pytorch.org/whl/cu124
- https://astral-sh.github.io/pytorch-mirror/whl/cu118
- https://astral-sh.github.io/pytorch-mirror/whl/cu124
"###);
Ok(())
@ -18418,7 +18453,7 @@ fn lock_multiple_sources_index_overlapping_extras() -> Result<()> {
/// Sources will be ignored when an `extra` is applied, but references a non-existent extra.
#[test]
fn lock_multiple_index_with_missing_extra() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -18436,12 +18471,12 @@ fn lock_multiple_index_with_missing_extra() -> Result<()> {
[[tool.uv.index]]
name = "torch-cu118"
url = "https://download.pytorch.org/whl/cu118"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu118"
explicit = true
"#,
)?;
uv_snapshot!(context.filters(), context.lock().env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock(), @r###"
success: false
exit_code: 1
----- stdout -----
@ -18458,7 +18493,7 @@ fn lock_multiple_index_with_missing_extra() -> Result<()> {
/// group.
#[test]
fn lock_multiple_index_with_absent_extra() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -18479,12 +18514,12 @@ fn lock_multiple_index_with_absent_extra() -> Result<()> {
[[tool.uv.index]]
name = "torch-cu118"
url = "https://download.pytorch.org/whl/cu118"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu118"
explicit = true
"#,
)?;
uv_snapshot!(context.filters(), context.lock().env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock(), @r###"
success: false
exit_code: 1
----- stdout -----
@ -18500,7 +18535,7 @@ fn lock_multiple_index_with_absent_extra() -> Result<()> {
/// Sources will be ignored when a `group` is applied, but references a non-existent group.
#[test]
fn lock_multiple_index_with_missing_group() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -18518,12 +18553,12 @@ fn lock_multiple_index_with_missing_group() -> Result<()> {
[[tool.uv.index]]
name = "torch-cu118"
url = "https://download.pytorch.org/whl/cu118"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu118"
explicit = true
"#,
)?;
uv_snapshot!(context.filters(), context.lock().env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock(), @r###"
success: false
exit_code: 1
----- stdout -----
@ -18540,7 +18575,7 @@ fn lock_multiple_index_with_missing_group() -> Result<()> {
/// group.
#[test]
fn lock_multiple_index_with_absent_group() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -18561,12 +18596,12 @@ fn lock_multiple_index_with_absent_group() -> Result<()> {
[[tool.uv.index]]
name = "torch-cu118"
url = "https://download.pytorch.org/whl/cu118"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu118"
explicit = true
"#,
)?;
uv_snapshot!(context.filters(), context.lock().env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock(), @r###"
success: false
exit_code: 1
----- stdout -----
@ -23059,7 +23094,7 @@ fn lock_script_path() -> Result<()> {
#[test]
fn lock_pytorch_cpu() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -23126,17 +23161,17 @@ fn lock_pytorch_cpu() -> Result<()> {
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cpu"
explicit = true
[[tool.uv.index]]
name = "pytorch-cu124"
url = "https://download.pytorch.org/whl/cu124"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu124"
explicit = true
"#,
)?;
uv_snapshot!(context.filters(), context.lock().env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock(), @r###"
success: true
exit_code: 0
----- stdout -----
@ -23166,6 +23201,9 @@ fn lock_pytorch_cpu() -> Result<()> {
{ package = "project", extra = "cu124" },
]]
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[manifest]
constraints = [
{ name = "filelock", specifier = "<=3.16.1" },
@ -23498,26 +23536,26 @@ fn lock_pytorch_cpu() -> Result<()> {
[package.optional-dependencies]
cpu = [
{ name = "torch", version = "2.5.1", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or sys_platform == 'darwin'" },
{ name = "torch", version = "2.5.1+cpu", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ name = "torchvision", version = "0.20.1", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or sys_platform == 'darwin'" },
{ name = "torchvision", version = "0.20.1+cpu", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ name = "torch", version = "2.5.1", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }, marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or sys_platform == 'darwin'" },
{ name = "torch", version = "2.5.1+cpu", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }, marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ name = "torchvision", version = "0.20.1", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }, marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or sys_platform == 'darwin'" },
{ name = "torchvision", version = "0.20.1+cpu", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }, marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
]
cu124 = [
{ name = "torch", version = "2.5.1", source = { registry = "https://download.pytorch.org/whl/cu124" }, marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "torch", version = "2.5.1+cu124", source = { registry = "https://download.pytorch.org/whl/cu124" }, marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
{ name = "torchvision", version = "0.20.1", source = { registry = "https://download.pytorch.org/whl/cu124" }, marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "torchvision", version = "0.20.1+cu124", source = { registry = "https://download.pytorch.org/whl/cu124" }, marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
{ name = "torch", version = "2.5.1", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }, marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "torch", version = "2.5.1+cu124", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }, marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
{ name = "torchvision", version = "0.20.1", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }, marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "torchvision", version = "0.20.1+cu124", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }, marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
]
[package.metadata]
requires-dist = [
{ name = "jinja2", specifier = "<=3.1.4" },
{ name = "numpy", specifier = "<=2.2.0" },
{ name = "torch", marker = "extra == 'cpu'", specifier = ">=2.5.1,<2.5.2", index = "https://download.pytorch.org/whl/cpu", conflict = { package = "project", extra = "cpu" } },
{ name = "torch", marker = "extra == 'cu124'", specifier = ">=2.5.1,<2.5.2", index = "https://download.pytorch.org/whl/cu124", conflict = { package = "project", extra = "cu124" } },
{ name = "torchvision", marker = "extra == 'cpu'", specifier = ">=0.20.1,<0.20.2", index = "https://download.pytorch.org/whl/cpu", conflict = { package = "project", extra = "cpu" } },
{ name = "torchvision", marker = "extra == 'cu124'", specifier = ">=0.20.1,<0.20.2", index = "https://download.pytorch.org/whl/cu124", conflict = { package = "project", extra = "cu124" } },
{ name = "torch", marker = "extra == 'cpu'", specifier = ">=2.5.1,<2.5.2", index = "https://astral-sh.github.io/pytorch-mirror/whl/cpu", conflict = { package = "project", extra = "cpu" } },
{ name = "torch", marker = "extra == 'cu124'", specifier = ">=2.5.1,<2.5.2", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu124", conflict = { package = "project", extra = "cu124" } },
{ name = "torchvision", marker = "extra == 'cpu'", specifier = ">=0.20.1,<0.20.2", index = "https://astral-sh.github.io/pytorch-mirror/whl/cpu", conflict = { package = "project", extra = "cpu" } },
{ name = "torchvision", marker = "extra == 'cu124'", specifier = ">=0.20.1,<0.20.2", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu124", conflict = { package = "project", extra = "cu124" } },
]
[[package]]
@ -23544,7 +23582,7 @@ fn lock_pytorch_cpu() -> Result<()> {
[[package]]
name = "torch"
version = "2.5.1"
source = { registry = "https://download.pytorch.org/whl/cpu" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }
resolution-markers = [
"(platform_machine == 'aarch64' and sys_platform == 'linux') or sys_platform == 'darwin'",
]
@ -23565,7 +23603,7 @@ fn lock_pytorch_cpu() -> Result<()> {
[[package]]
name = "torch"
version = "2.5.1"
source = { registry = "https://download.pytorch.org/whl/cu124" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }
resolution-markers = [
"platform_machine == 'aarch64' and sys_platform == 'linux'",
]
@ -23585,7 +23623,7 @@ fn lock_pytorch_cpu() -> Result<()> {
[[package]]
name = "torch"
version = "2.5.1+cpu"
source = { registry = "https://download.pytorch.org/whl/cpu" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }
resolution-markers = [
"(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')",
]
@ -23607,7 +23645,7 @@ fn lock_pytorch_cpu() -> Result<()> {
[[package]]
name = "torch"
version = "2.5.1+cu124"
source = { registry = "https://download.pytorch.org/whl/cu124" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }
resolution-markers = [
"platform_machine != 'aarch64' or sys_platform != 'linux'",
]
@ -23642,14 +23680,14 @@ fn lock_pytorch_cpu() -> Result<()> {
[[package]]
name = "torchvision"
version = "0.20.1"
source = { registry = "https://download.pytorch.org/whl/cpu" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }
resolution-markers = [
"(platform_machine == 'aarch64' and sys_platform == 'linux') or sys_platform == 'darwin'",
]
dependencies = [
{ name = "numpy", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or sys_platform == 'darwin'" },
{ name = "pillow", marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or sys_platform == 'darwin'" },
{ name = "torch", version = "2.5.1", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or sys_platform == 'darwin'" },
{ name = "torch", version = "2.5.1", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }, marker = "(platform_machine == 'aarch64' and sys_platform == 'linux') or sys_platform == 'darwin'" },
]
wheels = [
{ url = "https://download.pytorch.org/whl/cpu/torchvision-0.20.1-cp312-cp312-linux_aarch64.whl", hash = "sha256:9f853ba4497ac4691815ad41b523ee23cf5ba4f87b1ce869d704052e233ca8b7" },
@ -23659,14 +23697,14 @@ fn lock_pytorch_cpu() -> Result<()> {
[[package]]
name = "torchvision"
version = "0.20.1"
source = { registry = "https://download.pytorch.org/whl/cu124" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }
resolution-markers = [
"platform_machine == 'aarch64' and sys_platform == 'linux'",
]
dependencies = [
{ name = "numpy", marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "pillow", marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "torch", version = "2.5.1", source = { registry = "https://download.pytorch.org/whl/cu124" }, marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ name = "torch", version = "2.5.1", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }, marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
]
wheels = [
{ url = "https://download.pytorch.org/whl/cu124/torchvision-0.20.1-cp312-cp312-linux_aarch64.whl", hash = "sha256:3e3289e53d0cb5d1b7f55b3f5912f46a08293c6791585ba2fc32c12cded9f9af" },
@ -23675,14 +23713,14 @@ fn lock_pytorch_cpu() -> Result<()> {
[[package]]
name = "torchvision"
version = "0.20.1+cpu"
source = { registry = "https://download.pytorch.org/whl/cpu" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }
resolution-markers = [
"(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')",
]
dependencies = [
{ name = "numpy", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ name = "pillow", marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ name = "torch", version = "2.5.1+cpu", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ name = "torch", version = "2.5.1+cpu", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }, marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
]
wheels = [
{ url = "https://download.pytorch.org/whl/cpu/torchvision-0.20.1%2Bcpu-cp312-cp312-linux_x86_64.whl", hash = "sha256:5f46c7ac7f00a065cb40bfb1e1bfc4ba16a35f5d46b3fe70cca6b3cea7f822f7" },
@ -23692,14 +23730,14 @@ fn lock_pytorch_cpu() -> Result<()> {
[[package]]
name = "torchvision"
version = "0.20.1+cu124"
source = { registry = "https://download.pytorch.org/whl/cu124" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }
resolution-markers = [
"platform_machine != 'aarch64' or sys_platform != 'linux'",
]
dependencies = [
{ name = "numpy", marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
{ name = "pillow", marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
{ name = "torch", version = "2.5.1+cu124", source = { registry = "https://download.pytorch.org/whl/cu124" }, marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
{ name = "torch", version = "2.5.1+cu124", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }, marker = "platform_machine != 'aarch64' or sys_platform != 'linux'" },
]
wheels = [
{ url = "https://download.pytorch.org/whl/cu124/torchvision-0.20.1%2Bcu124-cp312-cp312-linux_x86_64.whl", hash = "sha256:d1053ec5054549e7dac2613b151bffe323f3c924939d296df4d7d34925aaf3ad" },
@ -23739,7 +23777,7 @@ fn lock_pytorch_cpu() -> Result<()> {
/// Regression test for: <https://github.com/astral-sh/uv/issues/10772>
#[test]
fn lock_pytorch_preferences() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -23774,17 +23812,17 @@ fn lock_pytorch_preferences() -> Result<()> {
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cpu"
explicit = true
[[tool.uv.index]]
name = "pytorch-cu118"
url = "https://download.pytorch.org/whl/cu118"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu118"
explicit = true
"#,
)?;
uv_snapshot!(context.filters(), context.lock().env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock(), @r###"
success: true
exit_code: 0
----- stdout -----
@ -23815,6 +23853,9 @@ fn lock_pytorch_preferences() -> Result<()> {
{ package = "project", extra = "cu118" },
]]
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[[package]]
name = "filelock"
version = "3.17.0"
@ -24049,21 +24090,21 @@ fn lock_pytorch_preferences() -> Result<()> {
[package.optional-dependencies]
cpu = [
{ name = "torch", version = "2.2.2", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ 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'" },
{ name = "torch", version = "2.2.2", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'darwin'" },
{ name = "torch", version = "2.2.2+cpu", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ 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') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
]
cu118 = [
{ name = "torch", version = "2.2.2", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'darwin'" },
{ name = "torch", version = "2.2.2+cu118", source = { registry = "https://download.pytorch.org/whl/cu118" }, marker = "sys_platform != 'darwin'" },
{ name = "torch", version = "2.2.2+cu118", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }, marker = "sys_platform != 'darwin'" },
]
[package.metadata]
requires-dist = [
{ name = "torch", marker = "sys_platform == 'darwin' and extra == 'cpu'", specifier = "==2.2.2" },
{ name = "torch", marker = "sys_platform == 'darwin' and extra == 'cu118'", specifier = "==2.2.2" },
{ name = "torch", marker = "sys_platform != 'darwin' and extra == 'cpu'", specifier = "==2.2.2", index = "https://download.pytorch.org/whl/cpu", conflict = { package = "project", extra = "cpu" } },
{ name = "torch", marker = "sys_platform != 'darwin' and extra == 'cu118'", specifier = "==2.2.2", index = "https://download.pytorch.org/whl/cu118", conflict = { package = "project", extra = "cu118" } },
{ name = "torch", marker = "sys_platform != 'darwin' and extra == 'cpu'", specifier = "==2.2.2", index = "https://astral-sh.github.io/pytorch-mirror/whl/cpu", conflict = { package = "project", extra = "cpu" } },
{ name = "torch", marker = "sys_platform != 'darwin' and extra == 'cu118'", specifier = "==2.2.2", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu118", conflict = { package = "project", extra = "cu118" } },
]
[[package]]
@ -24081,7 +24122,7 @@ fn lock_pytorch_preferences() -> Result<()> {
[[package]]
name = "torch"
version = "2.2.2"
source = { registry = "https://download.pytorch.org/whl/cpu" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }
resolution-markers = [
"platform_machine == 'aarch64' and sys_platform == 'linux'",
]
@ -24141,7 +24182,7 @@ fn lock_pytorch_preferences() -> Result<()> {
[[package]]
name = "torch"
version = "2.2.2+cpu"
source = { registry = "https://download.pytorch.org/whl/cpu" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }
resolution-markers = [
"(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')",
]
@ -24165,7 +24206,7 @@ fn lock_pytorch_preferences() -> Result<()> {
[[package]]
name = "torch"
version = "2.2.2+cu118"
source = { registry = "https://download.pytorch.org/whl/cu118" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }
resolution-markers = [
"sys_platform != 'darwin'",
]

View file

@ -3,7 +3,6 @@ use assert_fs::prelude::*;
use insta::assert_snapshot;
use crate::common::{uv_snapshot, TestContext};
use uv_static::EnvVars;
// All of the tests in this file should use `tool.uv.conflicts` in some way.
//
@ -2192,7 +2191,7 @@ fn mixed() -> Result<()> {
#[test]
fn multiple_sources_index_disjoint_extras() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -2224,17 +2223,17 @@ fn multiple_sources_index_disjoint_extras() -> Result<()> {
[[tool.uv.index]]
name = "torch-cu118"
url = "https://download.pytorch.org/whl/cu118"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu118"
explicit = true
[[tool.uv.index]]
name = "torch-cu124"
url = "https://download.pytorch.org/whl/cu124"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu124"
explicit = true
"#,
)?;
uv_snapshot!(context.filters(), context.lock().env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock(), @r###"
success: true
exit_code: 0
----- stdout -----
@ -2257,13 +2256,16 @@ fn multiple_sources_index_disjoint_extras() -> Result<()> {
{ package = "project", extra = "cu124" },
]]
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[manifest]
constraints = [{ name = "markupsafe", specifier = "<3" }]
[[package]]
name = "jinja2"
version = "3.1.2"
source = { registry = "https://download.pytorch.org/whl/cu118" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }
dependencies = [
{ name = "markupsafe" },
]
@ -2274,7 +2276,7 @@ fn multiple_sources_index_disjoint_extras() -> Result<()> {
[[package]]
name = "jinja2"
version = "3.1.3"
source = { registry = "https://download.pytorch.org/whl/cu124" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }
dependencies = [
{ name = "markupsafe" },
]
@ -2307,23 +2309,23 @@ fn multiple_sources_index_disjoint_extras() -> Result<()> {
[package.optional-dependencies]
cu118 = [
{ name = "jinja2", version = "3.1.2", source = { registry = "https://download.pytorch.org/whl/cu118" } },
{ name = "jinja2", version = "3.1.2", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" } },
]
cu124 = [
{ name = "jinja2", version = "3.1.3", source = { registry = "https://download.pytorch.org/whl/cu124" } },
{ name = "jinja2", version = "3.1.3", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" } },
]
[package.metadata]
requires-dist = [
{ name = "jinja2", marker = "extra == 'cu118'", specifier = "==3.1.2", index = "https://download.pytorch.org/whl/cu118", conflict = { package = "project", extra = "cu118" } },
{ name = "jinja2", marker = "extra == 'cu124'", specifier = "==3.1.3", index = "https://download.pytorch.org/whl/cu124", conflict = { package = "project", extra = "cu124" } },
{ name = "jinja2", marker = "extra == 'cu118'", specifier = "==3.1.2", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu118", conflict = { package = "project", extra = "cu118" } },
{ name = "jinja2", marker = "extra == 'cu124'", specifier = "==3.1.3", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu124", conflict = { package = "project", extra = "cu124" } },
]
"###
);
});
// Re-run with `--locked`.
uv_snapshot!(context.filters(), context.lock().arg("--locked").env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -2337,7 +2339,7 @@ fn multiple_sources_index_disjoint_extras() -> Result<()> {
#[test]
fn multiple_sources_index_disjoint_groups() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -2369,17 +2371,17 @@ fn multiple_sources_index_disjoint_groups() -> Result<()> {
[[tool.uv.index]]
name = "torch-cu118"
url = "https://download.pytorch.org/whl/cu118"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu118"
explicit = true
[[tool.uv.index]]
name = "torch-cu124"
url = "https://download.pytorch.org/whl/cu124"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu124"
explicit = true
"#,
)?;
uv_snapshot!(context.filters(), context.lock().env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock(), @r###"
success: true
exit_code: 0
----- stdout -----
@ -2402,13 +2404,16 @@ fn multiple_sources_index_disjoint_groups() -> Result<()> {
{ package = "project", group = "cu124" },
]]
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[manifest]
constraints = [{ name = "markupsafe", specifier = "<3" }]
[[package]]
name = "jinja2"
version = "3.1.2"
source = { registry = "https://download.pytorch.org/whl/cu118" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }
dependencies = [
{ name = "markupsafe" },
]
@ -2419,7 +2424,7 @@ fn multiple_sources_index_disjoint_groups() -> Result<()> {
[[package]]
name = "jinja2"
version = "3.1.3"
source = { registry = "https://download.pytorch.org/whl/cu124" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }
dependencies = [
{ name = "markupsafe" },
]
@ -2452,23 +2457,23 @@ fn multiple_sources_index_disjoint_groups() -> Result<()> {
[package.dev-dependencies]
cu118 = [
{ name = "jinja2", version = "3.1.2", source = { registry = "https://download.pytorch.org/whl/cu118" } },
{ name = "jinja2", version = "3.1.2", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" } },
]
cu124 = [
{ name = "jinja2", version = "3.1.3", source = { registry = "https://download.pytorch.org/whl/cu124" } },
{ name = "jinja2", version = "3.1.3", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" } },
]
[package.metadata]
[package.metadata.requires-dev]
cu118 = [{ name = "jinja2", specifier = "==3.1.2", index = "https://download.pytorch.org/whl/cu118", conflict = { package = "project", group = "cu118" } }]
cu124 = [{ name = "jinja2", specifier = "==3.1.3", index = "https://download.pytorch.org/whl/cu124", conflict = { package = "project", group = "cu124" } }]
cu118 = [{ name = "jinja2", specifier = "==3.1.2", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu118", conflict = { package = "project", group = "cu118" } }]
cu124 = [{ name = "jinja2", specifier = "==3.1.3", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu124", conflict = { package = "project", group = "cu124" } }]
"###
);
});
// Re-run with `--locked`.
uv_snapshot!(context.filters(), context.lock().arg("--locked").env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -2482,7 +2487,7 @@ fn multiple_sources_index_disjoint_groups() -> Result<()> {
#[test]
fn multiple_sources_index_disjoint_extras_with_extra() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -2514,17 +2519,17 @@ fn multiple_sources_index_disjoint_extras_with_extra() -> Result<()> {
[[tool.uv.index]]
name = "torch-cu118"
url = "https://download.pytorch.org/whl/cu118"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu118"
explicit = true
[[tool.uv.index]]
name = "torch-cu124"
url = "https://download.pytorch.org/whl/cu124"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu124"
explicit = true
"#,
)?;
uv_snapshot!(context.filters(), context.lock().env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock(), @r###"
success: true
exit_code: 0
----- stdout -----
@ -2547,6 +2552,9 @@ fn multiple_sources_index_disjoint_extras_with_extra() -> Result<()> {
{ package = "project", extra = "cu124" },
]]
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[manifest]
constraints = [{ name = "markupsafe", specifier = "<3" }]
@ -2562,7 +2570,7 @@ fn multiple_sources_index_disjoint_extras_with_extra() -> Result<()> {
[[package]]
name = "jinja2"
version = "3.1.2"
source = { registry = "https://download.pytorch.org/whl/cu118" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }
dependencies = [
{ name = "markupsafe" },
]
@ -2578,7 +2586,7 @@ fn multiple_sources_index_disjoint_extras_with_extra() -> Result<()> {
[[package]]
name = "jinja2"
version = "3.1.3"
source = { registry = "https://download.pytorch.org/whl/cu124" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }
dependencies = [
{ name = "markupsafe" },
]
@ -2616,23 +2624,23 @@ fn multiple_sources_index_disjoint_extras_with_extra() -> Result<()> {
[package.optional-dependencies]
cu118 = [
{ name = "jinja2", version = "3.1.2", source = { registry = "https://download.pytorch.org/whl/cu118" }, extra = ["i18n"] },
{ name = "jinja2", version = "3.1.2", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }, extra = ["i18n"] },
]
cu124 = [
{ name = "jinja2", version = "3.1.3", source = { registry = "https://download.pytorch.org/whl/cu124" }, extra = ["i18n"] },
{ name = "jinja2", version = "3.1.3", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }, extra = ["i18n"] },
]
[package.metadata]
requires-dist = [
{ name = "jinja2", extras = ["i18n"], marker = "extra == 'cu118'", specifier = "==3.1.2", index = "https://download.pytorch.org/whl/cu118", conflict = { package = "project", extra = "cu118" } },
{ name = "jinja2", extras = ["i18n"], marker = "extra == 'cu124'", specifier = "==3.1.3", index = "https://download.pytorch.org/whl/cu124", conflict = { package = "project", extra = "cu124" } },
{ name = "jinja2", extras = ["i18n"], marker = "extra == 'cu118'", specifier = "==3.1.2", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu118", conflict = { package = "project", extra = "cu118" } },
{ name = "jinja2", extras = ["i18n"], marker = "extra == 'cu124'", specifier = "==3.1.3", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu124", conflict = { package = "project", extra = "cu124" } },
]
"###
);
});
// Re-run with `--locked`.
uv_snapshot!(context.filters(), context.lock().arg("--locked").env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -2646,7 +2654,7 @@ fn multiple_sources_index_disjoint_extras_with_extra() -> Result<()> {
#[test]
fn multiple_sources_index_disjoint_extras_with_marker() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -2678,17 +2686,17 @@ fn multiple_sources_index_disjoint_extras_with_marker() -> Result<()> {
[[tool.uv.index]]
name = "torch-cu118"
url = "https://download.pytorch.org/whl/cu118"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu118"
explicit = true
[[tool.uv.index]]
name = "torch-cu124"
url = "https://download.pytorch.org/whl/cu124"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu124"
explicit = true
"#,
)?;
uv_snapshot!(context.filters(), context.lock().env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock(), @r###"
success: true
exit_code: 0
----- stdout -----
@ -2717,13 +2725,16 @@ fn multiple_sources_index_disjoint_extras_with_marker() -> Result<()> {
{ package = "project", extra = "cu124" },
]]
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[manifest]
constraints = [{ name = "markupsafe", specifier = "<3" }]
[[package]]
name = "jinja2"
version = "3.1.2"
source = { registry = "https://download.pytorch.org/whl/cu118" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }
resolution-markers = [
"sys_platform == 'darwin'",
]
@ -2752,7 +2763,7 @@ fn multiple_sources_index_disjoint_extras_with_marker() -> Result<()> {
[[package]]
name = "jinja2"
version = "3.1.3"
source = { registry = "https://download.pytorch.org/whl/cu124" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }
dependencies = [
{ name = "markupsafe" },
]
@ -2785,25 +2796,25 @@ fn multiple_sources_index_disjoint_extras_with_marker() -> Result<()> {
[package.optional-dependencies]
cu118 = [
{ name = "jinja2", version = "3.1.2", source = { registry = "https://download.pytorch.org/whl/cu118" }, marker = "sys_platform == 'darwin'" },
{ name = "jinja2", version = "3.1.2", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }, marker = "sys_platform == 'darwin'" },
{ name = "jinja2", version = "3.1.2", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform != 'darwin'" },
]
cu124 = [
{ name = "jinja2", version = "3.1.3", source = { registry = "https://download.pytorch.org/whl/cu124" } },
{ name = "jinja2", version = "3.1.3", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" } },
]
[package.metadata]
requires-dist = [
{ name = "jinja2", marker = "sys_platform == 'darwin' and extra == 'cu118'", specifier = "==3.1.2", index = "https://download.pytorch.org/whl/cu118", conflict = { package = "project", extra = "cu118" } },
{ name = "jinja2", marker = "sys_platform == 'darwin' and extra == 'cu118'", specifier = "==3.1.2", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu118", conflict = { package = "project", extra = "cu118" } },
{ name = "jinja2", marker = "sys_platform != 'darwin' and extra == 'cu118'", specifier = "==3.1.2" },
{ name = "jinja2", marker = "extra == 'cu124'", specifier = "==3.1.3", index = "https://download.pytorch.org/whl/cu124", conflict = { package = "project", extra = "cu124" } },
{ name = "jinja2", marker = "extra == 'cu124'", specifier = "==3.1.3", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu124", conflict = { package = "project", extra = "cu124" } },
]
"###
);
});
// Re-run with `--locked`.
uv_snapshot!(context.filters(), context.lock().arg("--locked").env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock().arg("--locked"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -4553,7 +4564,7 @@ conflicts = [
/// [1]: <https://github.com/astral-sh/uv/issues/9289>
#[test]
fn jinja_no_conflict_markers1() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -4585,22 +4596,17 @@ fn jinja_no_conflict_markers1() -> Result<()> {
[[tool.uv.index]]
name = "torch-cu118"
url = "https://download.pytorch.org/whl/cu118"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu118"
explicit = true
[[tool.uv.index]]
name = "torch-cu124"
url = "https://download.pytorch.org/whl/cu124"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu124"
explicit = true
"#,
)?;
let mut cmd = context.sync();
// I guess --exclude-newer doesn't work with the torch indices?
// That's because the Torch indices are missing the upload date
// metadata. We pin our versions anyway, so this should be fine.
cmd.env_remove(EnvVars::UV_EXCLUDE_NEWER);
uv_snapshot!(context.filters(), cmd, @r###"
uv_snapshot!(context.filters(), context.sync(), @r###"
success: true
exit_code: 0
----- stdout -----
@ -4623,6 +4629,9 @@ fn jinja_no_conflict_markers1() -> Result<()> {
{ package = "project", extra = "cu124" },
]]
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[manifest]
constraints = [{ name = "markupsafe", specifier = "<3" }]
@ -4638,7 +4647,7 @@ fn jinja_no_conflict_markers1() -> Result<()> {
[[package]]
name = "jinja2"
version = "3.1.2"
source = { registry = "https://download.pytorch.org/whl/cu118" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }
dependencies = [
{ name = "markupsafe" },
]
@ -4654,7 +4663,7 @@ fn jinja_no_conflict_markers1() -> Result<()> {
[[package]]
name = "jinja2"
version = "3.1.3"
source = { registry = "https://download.pytorch.org/whl/cu124" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }
dependencies = [
{ name = "markupsafe" },
]
@ -4692,16 +4701,16 @@ fn jinja_no_conflict_markers1() -> Result<()> {
[package.optional-dependencies]
cu118 = [
{ name = "jinja2", version = "3.1.2", source = { registry = "https://download.pytorch.org/whl/cu118" }, extra = ["i18n"] },
{ name = "jinja2", version = "3.1.2", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }, extra = ["i18n"] },
]
cu124 = [
{ name = "jinja2", version = "3.1.3", source = { registry = "https://download.pytorch.org/whl/cu124" }, extra = ["i18n"] },
{ name = "jinja2", version = "3.1.3", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }, extra = ["i18n"] },
]
[package.metadata]
requires-dist = [
{ name = "jinja2", extras = ["i18n"], marker = "extra == 'cu118'", specifier = "==3.1.2", index = "https://download.pytorch.org/whl/cu118", conflict = { package = "project", extra = "cu118" } },
{ name = "jinja2", extras = ["i18n"], marker = "extra == 'cu124'", specifier = "==3.1.3", index = "https://download.pytorch.org/whl/cu124", conflict = { package = "project", extra = "cu124" } },
{ name = "jinja2", extras = ["i18n"], marker = "extra == 'cu118'", specifier = "==3.1.2", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu118", conflict = { package = "project", extra = "cu118" } },
{ name = "jinja2", extras = ["i18n"], marker = "extra == 'cu124'", specifier = "==3.1.3", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu124", conflict = { package = "project", extra = "cu124" } },
]
"###
);
@ -4715,7 +4724,7 @@ fn jinja_no_conflict_markers1() -> Result<()> {
/// shouldn't see any conflict markers in the lock file here.
#[test]
fn jinja_no_conflict_markers2() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -4747,22 +4756,17 @@ fn jinja_no_conflict_markers2() -> Result<()> {
[[tool.uv.index]]
name = "torch-cu118"
url = "https://download.pytorch.org/whl/cu118"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu118"
explicit = true
[[tool.uv.index]]
name = "torch-cu124"
url = "https://download.pytorch.org/whl/cu124"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu124"
explicit = true
"#,
)?;
let mut cmd = context.sync();
// I guess --exclude-newer doesn't work with the torch indices?
// That's because the Torch indices are missing the upload date
// metadata. We pin our versions anyway, so this should be fine.
cmd.env_remove(EnvVars::UV_EXCLUDE_NEWER);
uv_snapshot!(context.filters(), cmd, @r###"
uv_snapshot!(context.filters(), context.sync(), @r###"
success: true
exit_code: 0
----- stdout -----
@ -4791,13 +4795,16 @@ fn jinja_no_conflict_markers2() -> Result<()> {
{ package = "project", extra = "cu124" },
]]
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[manifest]
constraints = [{ name = "markupsafe", specifier = "<3" }]
[[package]]
name = "jinja2"
version = "3.1.2"
source = { registry = "https://download.pytorch.org/whl/cu118" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }
resolution-markers = [
"sys_platform == 'darwin'",
]
@ -4826,7 +4833,7 @@ fn jinja_no_conflict_markers2() -> Result<()> {
[[package]]
name = "jinja2"
version = "3.1.3"
source = { registry = "https://download.pytorch.org/whl/cu124" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" }
dependencies = [
{ name = "markupsafe" },
]
@ -4859,18 +4866,18 @@ fn jinja_no_conflict_markers2() -> Result<()> {
[package.optional-dependencies]
cu118 = [
{ name = "jinja2", version = "3.1.2", source = { registry = "https://download.pytorch.org/whl/cu118" }, marker = "sys_platform == 'darwin'" },
{ name = "jinja2", version = "3.1.2", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu118" }, marker = "sys_platform == 'darwin'" },
{ name = "jinja2", version = "3.1.2", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform != 'darwin'" },
]
cu124 = [
{ name = "jinja2", version = "3.1.3", source = { registry = "https://download.pytorch.org/whl/cu124" } },
{ name = "jinja2", version = "3.1.3", source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cu124" } },
]
[package.metadata]
requires-dist = [
{ name = "jinja2", marker = "sys_platform == 'darwin' and extra == 'cu118'", specifier = "==3.1.2", index = "https://download.pytorch.org/whl/cu118", conflict = { package = "project", extra = "cu118" } },
{ name = "jinja2", marker = "sys_platform == 'darwin' and extra == 'cu118'", specifier = "==3.1.2", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu118", conflict = { package = "project", extra = "cu118" } },
{ name = "jinja2", marker = "sys_platform != 'darwin' and extra == 'cu118'", specifier = "==3.1.2" },
{ name = "jinja2", marker = "extra == 'cu124'", specifier = "==3.1.3", index = "https://download.pytorch.org/whl/cu124", conflict = { package = "project", extra = "cu124" } },
{ name = "jinja2", marker = "extra == 'cu124'", specifier = "==3.1.3", index = "https://astral-sh.github.io/pytorch-mirror/whl/cu124", conflict = { package = "project", extra = "cu124" } },
]
"###
);
@ -7285,7 +7292,7 @@ fn deduplicate_resolution_markers() -> Result<()> {
#[test]
fn overlapping_resolution_markers() -> Result<()> {
let context = TestContext::new("3.10");
let context = TestContext::new("3.10").with_exclude_newer("2025-01-30T00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -7321,12 +7328,12 @@ fn overlapping_resolution_markers() -> Result<()> {
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cpu"
explicit = true
"#,
)?;
uv_snapshot!(context.filters(), context.lock().env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.lock(), @r###"
success: true
exit_code: 0
----- stdout -----
@ -7359,6 +7366,9 @@ fn overlapping_resolution_markers() -> Result<()> {
{ package = "ads-mega-model", extra = "cu118" },
]]
[options]
exclude-newer = "2025-01-30T00:00:00Z"
[[package]]
name = "ads-mega-model"
version = "0.1.0"
@ -7369,9 +7379,9 @@ fn overlapping_resolution_markers() -> Result<()> {
[package.optional-dependencies]
cpu = [
{ name = "torch", version = "2.2.2", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
{ 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'" },
{ name = "torch", version = "2.2.2", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform == 'darwin'" },
{ name = "torch", version = "2.2.2+cpu", source = { registry = "https://download.pytorch.org/whl/cpu" }, marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
{ 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') or (sys_platform != 'darwin' and sys_platform != 'linux')" },
]
cu118 = [
{ name = "torch", version = "2.2.2", source = { registry = "https://pypi.org/simple" } },
@ -7380,7 +7390,7 @@ fn overlapping_resolution_markers() -> Result<()> {
[package.metadata]
requires-dist = [
{ name = "torch", marker = "sys_platform == 'darwin' and extra == 'cpu'", specifier = "==2.2.2" },
{ name = "torch", marker = "sys_platform != 'darwin' and extra == 'cpu'", specifier = "==2.2.2", index = "https://download.pytorch.org/whl/cpu", conflict = { package = "ads-mega-model", extra = "cpu" } },
{ name = "torch", marker = "sys_platform != 'darwin' and extra == 'cpu'", specifier = "==2.2.2", index = "https://astral-sh.github.io/pytorch-mirror/whl/cpu", conflict = { package = "ads-mega-model", extra = "cpu" } },
{ name = "torch", marker = "extra == 'cu118'", specifier = "==2.2.2" },
{ name = "wandb", specifier = "==0.17.6" },
]
@ -7815,7 +7825,7 @@ fn overlapping_resolution_markers() -> Result<()> {
[[package]]
name = "torch"
version = "2.2.2"
source = { registry = "https://download.pytorch.org/whl/cpu" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }
resolution-markers = [
"platform_machine == 'aarch64' and sys_platform == 'linux'",
]
@ -7873,7 +7883,7 @@ fn overlapping_resolution_markers() -> Result<()> {
[[package]]
name = "torch"
version = "2.2.2+cpu"
source = { registry = "https://download.pytorch.org/whl/cpu" }
source = { registry = "https://astral-sh.github.io/pytorch-mirror/whl/cpu" }
resolution-markers = [
"platform_machine != 'aarch64' and sys_platform == 'linux'",
"sys_platform != 'darwin' and sys_platform != 'linux'",

View file

@ -4416,15 +4416,14 @@ fn cache_errors_are_non_fatal() -> Result<()> {
#[test]
#[cfg(not(target_env = "musl"))] // No musllinux wheels in the torch index
fn compile_html() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str("jinja2<=3.1.2")?;
uv_snapshot!(context.filters(), context.pip_compile()
.env_remove(EnvVars::UV_EXCLUDE_NEWER)
.arg("requirements.in")
.arg("--index-url")
.arg("https://download.pytorch.org/whl"), @r###"
.arg("https://astral-sh.github.io/pytorch-mirror/whl/cpu"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -4816,7 +4815,7 @@ fn generate_hashes_find_links_directory() -> Result<()> {
/// Include hashes from a `--find-links` index in the generated output.
#[test]
fn generate_hashes_find_links_url() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str("tqdm")?;
@ -4825,7 +4824,7 @@ fn generate_hashes_find_links_url() -> Result<()> {
.arg("--generate-hashes")
.arg("--no-index")
.arg("--find-links")
.arg("https://download.pytorch.org/whl/torch_stable.html"), @r###"
.arg("https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -4882,7 +4881,7 @@ fn find_links_directory() -> Result<()> {
/// Compile using `--find-links` with a URL by resolving `tqdm` from the `PyTorch` wheels index.
#[test]
fn find_links_url() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str("tqdm")?;
@ -4890,7 +4889,7 @@ fn find_links_url() -> Result<()> {
.arg("requirements.in")
.arg("--no-index")
.arg("--find-links")
.arg("https://download.pytorch.org/whl/torch_stable.html"), @r###"
.arg("https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -4917,7 +4916,7 @@ fn find_links_env_var() -> Result<()> {
uv_snapshot!(context.filters(), context.pip_compile()
.arg("requirements.in")
.arg("--no-index")
.env(EnvVars::URL, "https://download.pytorch.org/whl/torch_stable.html"), @r###"
.env(EnvVars::URL, "https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -4940,7 +4939,8 @@ fn find_links_env_var() -> Result<()> {
fn find_links_requirements_txt() -> Result<()> {
let context = TestContext::new("3.12");
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str("-f https://download.pytorch.org/whl/torch_stable.html\ntqdm")?;
requirements_in
.write_str("-f https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html\ntqdm")?;
uv_snapshot!(context.filters(), context.pip_compile()
.arg("requirements.in")
@ -4951,7 +4951,7 @@ fn find_links_requirements_txt() -> Result<()> {
----- stdout -----
# This file was autogenerated by uv via the following command:
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --no-index --emit-find-links
--find-links https://download.pytorch.org/whl/torch_stable.html
--find-links https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html
tqdm==4.64.1
# via -r requirements.in
@ -4974,7 +4974,7 @@ fn find_links_uv_env_var() -> Result<()> {
uv_snapshot!(context.filters(), context.pip_compile()
.arg("requirements.in")
.arg("--no-index")
.env(EnvVars::UV_FIND_LINKS, "https://download.pytorch.org/whl/torch_stable.html"), @r###"
.env(EnvVars::UV_FIND_LINKS, "https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -6352,7 +6352,7 @@ fn offline_registry_backtrack() -> Result<()> {
/// HTML registry.
#[test]
fn offline_find_links() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str("tqdm")?;
@ -6362,7 +6362,7 @@ fn offline_find_links() -> Result<()> {
uv_snapshot!(context.filters(), context.pip_compile()
.arg("requirements.in")
.arg("--find-links")
.arg("https://download.pytorch.org/whl/torch_stable.html")
.arg("https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html")
.arg("--offline"), @r###"
success: false
exit_code: 1
@ -6380,7 +6380,7 @@ fn offline_find_links() -> Result<()> {
uv_snapshot!(context.filters(), context.pip_compile()
.arg("requirements.in")
.arg("--find-links")
.arg("https://download.pytorch.org/whl/torch_stable.html")
.arg("https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html")
.arg("--no-index")
.arg("--offline"), @r###"
success: false
@ -6788,7 +6788,8 @@ fn compile_constraints_incompatible_url() -> Result<()> {
fn index_url_in_requirements() -> Result<()> {
let context = TestContext::new("3.12");
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str("--index-url https://download.pytorch.org/whl\nanyio<4")?;
requirements_in
.write_str("--index-url https://astral-sh.github.io/pytorch-mirror/whl\nanyio<4")?;
uv_snapshot!(context.filters(), context.pip_compile()
.arg("requirements.in"), @r###"
@ -6811,7 +6812,8 @@ fn index_url_in_requirements() -> Result<()> {
fn index_url_from_command_line() -> Result<()> {
let context = TestContext::new("3.12");
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str("--index-url https://download.pytorch.org/whl\nanyio<4")?;
requirements_in
.write_str("--index-url https://astral-sh.github.io/pytorch-mirror/whl\nanyio<4")?;
uv_snapshot!(context.filters(), context.pip_compile()
.arg("requirements.in")
@ -7557,10 +7559,10 @@ fn universal_multi_version() -> Result<()> {
#[test]
fn universal_platform_fork() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str(indoc::indoc! {r"
--index-url https://download.pytorch.org/whl/cpu
--index-url https://astral-sh.github.io/pytorch-mirror/whl/cpu
torch==2.5.1
"})?;
@ -7575,8 +7577,7 @@ fn universal_platform_fork() -> Result<()> {
.arg("requirements.in")
.arg("--universal")
.arg("-c")
.arg("constraints.txt")
.env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
.arg("constraints.txt"), @r###"
success: true
exit_code: 0
----- stdout -----
@ -7617,13 +7618,13 @@ fn universal_platform_fork() -> Result<()> {
Ok(())
}
// Requested distinct local versions with disjoint markers.
/// Requested distinct local versions with disjoint markers.
#[test]
fn universal_disjoint_locals() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str(indoc::indoc! {r"
--find-links https://download.pytorch.org/whl/torch_stable.html
--find-links https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html
torch==2.0.0+cu118 ; platform_machine == 'x86_64'
torch==2.0.0+cpu ; platform_machine != 'x86_64'
@ -7637,23 +7638,23 @@ 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 sys_platform == 'linux'
cmake==3.31.4 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
filelock==3.13.1
filelock==3.17.0
# via
# torch
# triton
jinja2==3.1.3
jinja2==3.1.5
# via torch
lit==18.1.2 ; platform_machine == 'x86_64' and sys_platform == 'linux'
lit==18.1.8 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
markupsafe==2.1.5
markupsafe==3.0.2
# via jinja2
mpmath==1.3.0
# via sympy
networkx==3.2.1
networkx==3.4.2
# via torch
sympy==1.12
sympy==1.13.3
# via torch
torch==2.0.0+cpu ; platform_machine != 'x86_64'
# via -r requirements.in
@ -7663,7 +7664,7 @@ fn universal_disjoint_locals() -> Result<()> {
# triton
triton==2.0.0 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via torch
typing-extensions==4.10.0
typing-extensions==4.12.2
# via torch
----- stderr -----
@ -7674,14 +7675,14 @@ fn universal_disjoint_locals() -> Result<()> {
Ok(())
}
// Requested distinct local versions with disjoint markers of a package
// that is also present as a transitive dependency.
/// Requested distinct local versions with disjoint markers of a package
/// that is also present as a transitive dependency.
#[test]
fn universal_transitive_disjoint_locals() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str(indoc::indoc! {r"
--find-links https://download.pytorch.org/whl/torch_stable.html
--find-links https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html
torch==2.0.0+cu118 ; platform_machine == 'x86_64'
torch==2.0.0+cpu ; platform_machine != 'x86_64'
@ -7698,35 +7699,35 @@ fn universal_transitive_disjoint_locals() -> Result<()> {
----- stdout -----
# This file was autogenerated by uv via the following command:
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal
certifi==2024.2.2
certifi==2024.12.14
# via requests
charset-normalizer==3.3.2
charset-normalizer==3.4.1
# via requests
cmake==3.28.4 ; platform_machine == 'x86_64' and sys_platform == 'linux'
cmake==3.31.4 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
filelock==3.13.1
filelock==3.17.0
# via
# torch
# triton
idna==3.6
idna==3.10
# via requests
jinja2==3.1.3
jinja2==3.1.5
# via torch
lit==18.1.2 ; platform_machine == 'x86_64' and sys_platform == 'linux'
lit==18.1.8 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
markupsafe==2.1.5
markupsafe==3.0.2
# via jinja2
mpmath==1.3.0
# via sympy
networkx==3.2.1
networkx==3.4.2
# via torch
numpy==1.26.4
numpy==2.2.2
# via torchvision
pillow==10.2.0
pillow==11.1.0
# via torchvision
requests==2.31.0
requests==2.32.3
# via torchvision
sympy==1.12
sympy==1.13.3
# via torch
torch==2.0.0+cpu ; platform_machine != 'x86_64'
# via
@ -7743,9 +7744,9 @@ fn universal_transitive_disjoint_locals() -> Result<()> {
# via -r requirements.in
triton==2.0.0 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via torch
typing-extensions==4.10.0
typing-extensions==4.12.2
# via torch
urllib3==2.2.1
urllib3==2.3.0
# via requests
----- stderr -----
@ -7759,7 +7760,7 @@ fn universal_transitive_disjoint_locals() -> Result<()> {
/// Prefer local versions for dependencies of path requirements.
#[test]
fn universal_local_path_requirement() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(indoc! {r#"
@ -7782,31 +7783,31 @@ fn universal_local_path_requirement() -> Result<()> {
.arg("requirements.in")
.arg("--universal")
.arg("--find-links")
.arg("https://download.pytorch.org/whl/torch_stable.html"), @r###"
.arg("https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html"), @r###"
success: true
exit_code: 0
----- stdout -----
# This file was autogenerated by uv via the following command:
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal
cmake==3.28.4 ; platform_machine == 'x86_64' and sys_platform == 'linux'
cmake==3.31.4 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
.
# via -r requirements.in
filelock==3.13.1
filelock==3.17.0
# via
# torch
# triton
jinja2==3.1.3
jinja2==3.1.5
# via torch
lit==18.1.2 ; platform_machine == 'x86_64' and sys_platform == 'linux'
lit==18.1.8 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
markupsafe==2.1.5
markupsafe==3.0.2
# via jinja2
mpmath==1.3.0
# via sympy
networkx==3.2.1
networkx==3.4.2
# via torch
sympy==1.12
sympy==1.13.3
# via torch
torch==2.0.0+cu118
# via
@ -7815,7 +7816,7 @@ fn universal_local_path_requirement() -> Result<()> {
# triton
triton==2.0.0 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via torch
typing-extensions==4.10.0
typing-extensions==4.12.2
# via torch
----- stderr -----
@ -7830,7 +7831,7 @@ fn universal_local_path_requirement() -> Result<()> {
/// we should prefer the local in both forks.
#[test]
fn universal_overlapping_local_requirement() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(indoc! {r#"
@ -7853,31 +7854,31 @@ fn universal_overlapping_local_requirement() -> Result<()> {
.arg("requirements.in")
.arg("--universal")
.arg("--find-links")
.arg("https://download.pytorch.org/whl/torch_stable.html"), @r###"
.arg("https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html"), @r###"
success: true
exit_code: 0
----- stdout -----
# This file was autogenerated by uv via the following command:
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal
cmake==3.28.4 ; platform_machine == 'x86_64' and sys_platform == 'linux'
cmake==3.31.4 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
.
# via -r requirements.in
filelock==3.13.1
filelock==3.17.0
# via
# torch
# triton
jinja2==3.1.3
jinja2==3.1.5
# via torch
lit==18.1.2 ; platform_machine == 'x86_64' and sys_platform == 'linux'
lit==18.1.8 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
markupsafe==2.1.5
markupsafe==3.0.2
# via jinja2
mpmath==1.3.0
# via sympy
networkx==3.2.1
networkx==3.4.2
# via torch
sympy==1.12
sympy==1.13.3
# via torch
torch==2.0.0+cu118
# via
@ -7886,7 +7887,7 @@ fn universal_overlapping_local_requirement() -> Result<()> {
# triton
triton==2.0.0 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via torch
typing-extensions==4.10.0
typing-extensions==4.12.2
# via torch
----- stderr -----
@ -7901,7 +7902,7 @@ fn universal_overlapping_local_requirement() -> Result<()> {
/// we should fork the root requirement.
#[test]
fn universal_disjoint_local_requirement() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(indoc! {r#"
@ -7927,31 +7928,31 @@ fn universal_disjoint_local_requirement() -> Result<()> {
.arg("requirements.in")
.arg("--universal")
.arg("--find-links")
.arg("https://download.pytorch.org/whl/torch_stable.html"), @r###"
.arg("https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html"), @r###"
success: true
exit_code: 0
----- stdout -----
# This file was autogenerated by uv via the following command:
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal
cmake==3.28.4 ; platform_machine == 'x86_64' and sys_platform == 'linux'
cmake==3.31.4 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
.
# via -r requirements.in
filelock==3.13.1
filelock==3.17.0
# via
# torch
# triton
jinja2==3.1.3
jinja2==3.1.5
# via torch
lit==18.1.2 ; platform_machine == 'x86_64' and sys_platform == 'linux'
lit==18.1.8 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
markupsafe==2.1.5
markupsafe==3.0.2
# via jinja2
mpmath==1.3.0
# via sympy
networkx==3.2.1
networkx==3.4.2
# via torch
sympy==1.12
sympy==1.13.3
# via torch
torch==2.0.0+cpu ; platform_machine != 'x86_64'
# via
@ -7964,7 +7965,7 @@ fn universal_disjoint_local_requirement() -> Result<()> {
# triton
triton==2.0.0 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via torch
typing-extensions==4.10.0
typing-extensions==4.12.2
# via torch
----- stderr -----
@ -7979,7 +7980,7 @@ fn universal_disjoint_local_requirement() -> Result<()> {
/// expressions, we should fork the root requirement.
#[test]
fn universal_disjoint_base_or_local_requirement() -> Result<()> {
let context = TestContext::new("3.10");
let context = TestContext::new("3.10").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(indoc! {r#"
@ -8006,31 +8007,31 @@ fn universal_disjoint_base_or_local_requirement() -> Result<()> {
.arg("requirements.in")
.arg("--universal")
.arg("--find-links")
.arg("https://download.pytorch.org/whl/torch_stable.html"), @r###"
.arg("https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html"), @r###"
success: true
exit_code: 0
----- stdout -----
# This file was autogenerated by uv via the following command:
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal
cmake==3.28.4 ; python_full_version < '3.13' and platform_machine == 'x86_64' and sys_platform == 'linux'
cmake==3.31.4 ; python_full_version < '3.13' and platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
.
# via -r requirements.in
filelock==3.13.1
filelock==3.17.0
# via
# torch
# triton
jinja2==3.1.3
jinja2==3.1.5
# via torch
lit==18.1.2 ; python_full_version < '3.13' and platform_machine == 'x86_64' and sys_platform == 'linux'
lit==18.1.8 ; python_full_version < '3.13' and platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
markupsafe==2.1.5
markupsafe==3.0.2
# via jinja2
mpmath==1.3.0
# via sympy
networkx==3.2.1
networkx==3.4.2
# via torch
sympy==1.12
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')
# via
@ -8047,7 +8048,7 @@ fn universal_disjoint_base_or_local_requirement() -> Result<()> {
# triton
triton==2.0.0 ; python_full_version < '3.13' and platform_machine == 'x86_64' and sys_platform == 'linux'
# via torch
typing-extensions==4.10.0
typing-extensions==4.12.2
# via torch
----- stderr -----
@ -8063,7 +8064,7 @@ fn universal_disjoint_base_or_local_requirement() -> Result<()> {
/// fork.
#[test]
fn universal_nested_overlapping_local_requirement() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(indoc! {r#"
@ -8087,55 +8088,55 @@ fn universal_nested_overlapping_local_requirement() -> Result<()> {
.arg("requirements.in")
.arg("--universal")
.arg("--find-links")
.arg("https://download.pytorch.org/whl/torch_stable.html"), @r###"
.arg("https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html"), @r###"
success: true
exit_code: 0
----- stdout -----
# This file was autogenerated by uv via the following command:
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal
cmake==3.28.4 ; implementation_name == 'cpython' and platform_machine == 'x86_64' and sys_platform == 'linux'
cmake==3.31.4 ; implementation_name == 'cpython' and platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
.
# via -r requirements.in
filelock==3.13.1
filelock==3.17.0
# via
# pytorch-triton-rocm
# torch
# triton
fsspec==2024.3.1 ; implementation_name != 'cpython'
fsspec==2024.12.0 ; implementation_name != 'cpython'
# via torch
intel-openmp==2021.4.0 ; implementation_name != 'cpython' and sys_platform == 'win32'
# via mkl
jinja2==3.1.3
jinja2==3.1.5
# via torch
lit==18.1.2 ; implementation_name == 'cpython' and platform_machine == 'x86_64' and sys_platform == 'linux'
lit==18.1.8 ; implementation_name == 'cpython' and platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
markupsafe==2.1.5
markupsafe==3.0.2
# via jinja2
mkl==2021.4.0 ; implementation_name != 'cpython' and sys_platform == 'win32'
# via torch
mpmath==1.3.0
# via sympy
networkx==3.2.1
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')
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')
# via torch
sympy==1.12
sympy==1.13.3
# via torch
tbb==2021.11.0 ; implementation_name != 'cpython' and sys_platform == 'win32'
tbb==2021.13.1 ; implementation_name != 'cpython' and sys_platform == 'win32'
# via mkl
torch==2.0.0+cu118 ; implementation_name == 'cpython'
# via
# -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')
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')
# 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')
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')
# via -r requirements.in
triton==2.0.0 ; implementation_name == 'cpython' and platform_machine == 'x86_64' and sys_platform == 'linux'
# via torch
typing-extensions==4.10.0
typing-extensions==4.12.2
# via torch
----- stderr -----
@ -8166,39 +8167,39 @@ fn universal_nested_overlapping_local_requirement() -> Result<()> {
.arg("requirements.in")
.arg("--universal")
.arg("--find-links")
.arg("https://download.pytorch.org/whl/torch_stable.html"), @r###"
.arg("https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html"), @r###"
success: true
exit_code: 0
----- stdout -----
# This file was autogenerated by uv via the following command:
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal
cmake==3.28.4 ; platform_machine == 'x86_64' and sys_platform == 'linux'
cmake==3.31.4 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
. ; os_name == 'Linux'
# via -r requirements.in
filelock==3.13.1
filelock==3.17.0
# via
# torch
# triton
fsspec==2024.3.1 ; platform_machine != 'x86_64'
fsspec==2024.12.0 ; platform_machine != 'x86_64'
# via torch
intel-openmp==2021.4.0 ; platform_machine != 'x86_64' and sys_platform == 'win32'
# via mkl
jinja2==3.1.3
jinja2==3.1.5
# via torch
lit==18.1.2 ; platform_machine == 'x86_64' and sys_platform == 'linux'
lit==18.1.8 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
markupsafe==2.1.5
markupsafe==3.0.2
# via jinja2
mkl==2021.4.0 ; platform_machine != 'x86_64' and sys_platform == 'win32'
# via torch
mpmath==1.3.0
# via sympy
networkx==3.2.1
networkx==3.4.2
# via torch
sympy==1.12
sympy==1.13.3
# via torch
tbb==2021.11.0 ; platform_machine != 'x86_64' and sys_platform == 'win32'
tbb==2021.13.1 ; platform_machine != 'x86_64' and sys_platform == 'win32'
# via mkl
torch==2.0.0+cu118 ; platform_machine == 'x86_64'
# via
@ -8209,7 +8210,7 @@ fn universal_nested_overlapping_local_requirement() -> Result<()> {
# via -r requirements.in
triton==2.0.0 ; platform_machine == 'x86_64' and sys_platform == 'linux'
# via torch
typing-extensions==4.10.0
typing-extensions==4.12.2
# via torch
----- stderr -----
@ -8224,7 +8225,7 @@ fn universal_nested_overlapping_local_requirement() -> Result<()> {
/// that form a nested fork, we should create a nested fork.
#[test]
fn universal_nested_disjoint_local_requirement() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(indoc! {r#"
@ -8251,42 +8252,42 @@ fn universal_nested_disjoint_local_requirement() -> Result<()> {
.arg("requirements.in")
.arg("--universal")
.arg("--find-links")
.arg("https://download.pytorch.org/whl/torch_stable.html"), @r###"
.arg("https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html"), @r###"
success: true
exit_code: 0
----- stdout -----
# This file was autogenerated by uv via the following command:
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --universal
cmake==3.28.4 ; implementation_name == 'cpython' and os_name == 'Linux' and platform_machine == 'x86_64' and sys_platform == 'linux'
cmake==3.31.4 ; implementation_name == 'cpython' and os_name == 'Linux' and platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
. ; os_name == 'Linux'
# via -r requirements.in
filelock==3.13.1
filelock==3.17.0
# via
# pytorch-triton-rocm
# torch
# triton
fsspec==2024.3.1 ; os_name != 'Linux'
fsspec==2024.12.0 ; os_name != 'Linux'
# via torch
intel-openmp==2021.4.0 ; os_name != 'Linux' and sys_platform == 'win32'
# via mkl
jinja2==3.1.3
jinja2==3.1.5
# via torch
lit==18.1.2 ; implementation_name == 'cpython' and os_name == 'Linux' and platform_machine == 'x86_64' and sys_platform == 'linux'
lit==18.1.8 ; implementation_name == 'cpython' and os_name == 'Linux' and platform_machine == 'x86_64' and sys_platform == 'linux'
# via triton
markupsafe==2.1.5
markupsafe==3.0.2
# via jinja2
mkl==2021.4.0 ; os_name != 'Linux' and sys_platform == 'win32'
# via torch
mpmath==1.3.0
# via sympy
networkx==3.2.1
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')
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')
# via torch
sympy==1.12
sympy==1.13.3
# via torch
tbb==2021.11.0 ; os_name != 'Linux' and sys_platform == 'win32'
tbb==2021.13.1 ; os_name != 'Linux' and sys_platform == 'win32'
# via mkl
torch==2.0.0+cpu ; implementation_name != 'cpython' and os_name == 'Linux'
# via
@ -8297,13 +8298,13 @@ 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')
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')
# 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')
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')
# 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
typing-extensions==4.10.0
typing-extensions==4.12.2
# via torch
----- stderr -----
@ -9020,7 +9021,7 @@ fn universal_marker_propagation() -> Result<()> {
let context = TestContext::new("3.12");
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str(indoc::indoc! {r"
--find-links https://download.pytorch.org/whl/torch_stable.html
--find-links https://astral-sh.github.io/pytorch-mirror/whl/torch_stable.html
torch==2.0.0 ; platform_machine == 'x86_64'
torch==2.2.0 ; platform_machine != 'x86_64'
@ -11901,7 +11902,7 @@ requires-python = ">3.8"
/// should fail by default (even though a compatible version exists on the "primary" index).
#[test]
fn compile_index_url_first_match_base() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str("jinja2==3.1.0")?;
@ -11910,7 +11911,7 @@ fn compile_index_url_first_match_base() -> Result<()> {
.arg("--index-url")
.arg("https://pypi.org/simple")
.arg("--extra-index-url")
.arg("https://download.pytorch.org/whl/cpu")
.arg("https://astral-sh.github.io/pytorch-mirror/whl/cpu")
.arg("requirements.in")
.arg("--no-deps"), @r###"
success: false
@ -11921,7 +11922,7 @@ fn compile_index_url_first_match_base() -> Result<()> {
× No solution found when resolving dependencies:
Because there is no version of jinja2==3.1.0 and you require jinja2==3.1.0, we can conclude that your requirements are unsatisfiable.
hint: `jinja2` was found on https://download.pytorch.org/whl/cpu, but not at the requested version (jinja2==3.1.0). A compatible version may be available on a subsequent index (e.g., https://pypi.org/simple). By default, uv will only consider versions that are published on the first index that contains a given package, to avoid dependency confusion attacks. If all indexes are equally trusted, use `--index-strategy unsafe-best-match` to consider all versions from all indexes, regardless of the order in which they were defined.
hint: `jinja2` was found on https://astral-sh.github.io/pytorch-mirror/whl/cpu, but not at the requested version (jinja2==3.1.0). A compatible version may be available on a subsequent index (e.g., https://pypi.org/simple). By default, uv will only consider versions that are published on the first index that contains a given package, to avoid dependency confusion attacks. If all indexes are equally trusted, use `--index-strategy unsafe-best-match` to consider all versions from all indexes, regardless of the order in which they were defined.
"###
);
@ -11934,7 +11935,7 @@ fn compile_index_url_first_match_base() -> Result<()> {
/// should fail by default (even though a compatible version exists on the "primary" index).
#[test]
fn compile_index_url_first_match_marker() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str("jinja2==3.1.0 ; sys_platform == 'linux'")?;
@ -11944,7 +11945,7 @@ fn compile_index_url_first_match_marker() -> Result<()> {
.arg("--index-url")
.arg("https://pypi.org/simple")
.arg("--extra-index-url")
.arg("https://download.pytorch.org/whl/cpu")
.arg("https://astral-sh.github.io/pytorch-mirror/whl/cpu")
.arg("requirements.in")
.arg("--no-deps"), @r###"
success: false
@ -11955,7 +11956,7 @@ fn compile_index_url_first_match_marker() -> Result<()> {
× No solution found when resolving dependencies:
Because there is no version of jinja2{sys_platform == 'linux'}==3.1.0 and you require jinja2{sys_platform == 'linux'}==3.1.0, we can conclude that your requirements are unsatisfiable.
hint: `jinja2` was found on https://download.pytorch.org/whl/cpu, but not at the requested version (jinja2==3.1.0). A compatible version may be available on a subsequent index (e.g., https://pypi.org/simple). By default, uv will only consider versions that are published on the first index that contains a given package, to avoid dependency confusion attacks. If all indexes are equally trusted, use `--index-strategy unsafe-best-match` to consider all versions from all indexes, regardless of the order in which they were defined.
hint: `jinja2` was found on https://astral-sh.github.io/pytorch-mirror/whl/cpu, but not at the requested version (jinja2==3.1.0). A compatible version may be available on a subsequent index (e.g., https://pypi.org/simple). By default, uv will only consider versions that are published on the first index that contains a given package, to avoid dependency confusion attacks. If all indexes are equally trusted, use `--index-strategy unsafe-best-match` to consider all versions from all indexes, regardless of the order in which they were defined.
"###
);
@ -11969,7 +11970,7 @@ fn compile_index_url_first_match_marker() -> Result<()> {
/// is provided.
#[test]
fn compile_index_url_fallback() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00:00Z");
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str("jinja2==3.1.0")?;
@ -11980,7 +11981,7 @@ fn compile_index_url_fallback() -> Result<()> {
.arg("--index-url")
.arg("https://pypi.org/simple")
.arg("--extra-index-url")
.arg("https://download.pytorch.org/whl/cpu")
.arg("https://astral-sh.github.io/pytorch-mirror/whl/cpu")
.arg("requirements.in")
.arg("--no-deps"), @r###"
success: true

View file

@ -5011,7 +5011,7 @@ fn sync_all_groups() -> Result<()> {
#[test]
fn sync_multiple_sources_index_disjoint_extras() -> Result<()> {
let context = TestContext::new("3.12");
let context = TestContext::new("3.12").with_exclude_newer("2025-01-30T00:00Z");
let pyproject_toml = context.temp_dir.child("pyproject.toml");
pyproject_toml.write_str(
@ -5043,24 +5043,20 @@ fn sync_multiple_sources_index_disjoint_extras() -> Result<()> {
[[tool.uv.index]]
name = "torch-cu118"
url = "https://download.pytorch.org/whl/cu118"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu118"
explicit = true
[[tool.uv.index]]
name = "torch-cu124"
url = "https://download.pytorch.org/whl/cu124"
url = "https://astral-sh.github.io/pytorch-mirror/whl/cu124"
explicit = true
"#,
)?;
// Generate a lockfile.
context
.lock()
.env_remove(EnvVars::UV_EXCLUDE_NEWER)
.assert()
.success();
context.lock().assert().success();
uv_snapshot!(context.filters(), context.sync().arg("--extra").arg("cu124").env_remove(EnvVars::UV_EXCLUDE_NEWER), @r###"
uv_snapshot!(context.filters(), context.sync().arg("--extra").arg("cu124"), @r###"
success: true
exit_code: 0
----- stdout -----