Skip to content

Commit

Permalink
Simple fix
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Aug 14, 2024
1 parent 29a3b36 commit fbefe60
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 602 deletions.
Empty file removed bar/README.md
Empty file.
19 changes: 0 additions & 19 deletions bar/pyproject.toml

This file was deleted.

2 changes: 0 additions & 2 deletions bar/src/bar/__init__.py

This file was deleted.

18 changes: 14 additions & 4 deletions crates/uv-resolver/src/resolution/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ impl ResolutionGraph {

let mut seen = FxHashSet::default();
for resolution in resolutions {
let marker = resolution.markers.fork_markers().cloned().unwrap_or_default();
let marker = resolution
.markers
.fork_markers()
.cloned()
.unwrap_or_default();

// Add every edge to the graph, propagating the marker for the current fork, if
// necessary.
Expand All @@ -151,7 +155,13 @@ impl ResolutionGraph {
continue;
}

Self::add_edge(&mut petgraph, &mut inverse, root_index, edge, marker.clone());
Self::add_edge(
&mut petgraph,
&mut inverse,
root_index,
edge,
marker.clone(),
);
}
}

Expand Down Expand Up @@ -240,9 +250,9 @@ impl ResolutionGraph {
{
// If either the existing marker or new marker is `true`, then the dependency is
// included unconditionally, and so the combined marker is `true`.
marker.or(edge_marker.clone());
marker.or(edge_marker);
} else {
petgraph.update_edge(from_index, to_index, edge_marker.clone());
petgraph.update_edge(from_index, to_index, edge_marker);
}
}

Expand Down
6 changes: 3 additions & 3 deletions crates/uv-resolver/src/resolver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2366,7 +2366,7 @@ impl ForkState {
to_url: to_url.cloned(),
to_extra: dependency_extra.clone(),
to_dev: dependency_dev.clone(),
marker: MarkerTree::TRUE
marker: MarkerTree::TRUE,
};
edges.insert(edge);
}
Expand Down Expand Up @@ -2417,7 +2417,7 @@ impl ForkState {
to_url: to_url.cloned(),
to_extra: Some(dependency_extra.clone()),
to_dev: None,
marker: MarkerTree::from(dependency_marker.clone())
marker: MarkerTree::from(dependency_marker.clone()),
};
edges.insert(edge);
}
Expand All @@ -2443,7 +2443,7 @@ impl ForkState {
to_url: to_url.cloned(),
to_extra: None,
to_dev: Some(dependency_dev.clone()),
marker: MarkerTree::from(dependency_marker.clone())
marker: MarkerTree::from(dependency_marker.clone()),
};
edges.insert(edge);
}
Expand Down
18 changes: 9 additions & 9 deletions crates/uv/tests/lock_scenarios.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1237,8 +1237,8 @@ fn fork_marker_inherit_combined_allowed() -> Result<()> {
"implementation_name != 'cpython' and implementation_name != 'pypy' and sys_platform == 'darwin'",
]
dependencies = [
{ name = "package-b", version = "1.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "implementation_name == 'pypy'" },
{ name = "package-b", version = "2.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "implementation_name == 'cpython'" },
{ name = "package-b", version = "1.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "implementation_name == 'pypy' and sys_platform == 'darwin'" },
{ name = "package-b", version = "2.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "implementation_name == 'cpython' and sys_platform == 'darwin'" },
]
sdist = { url = "https://astral-sh.github.io/packse/PACKSE_VERSION/files/fork_marker_inherit_combined_allowed_a-1.0.0.tar.gz", hash = "sha256:c7232306e8597d46c3fe53a3b1472f99b8ff36b3169f335ba0a5b625e193f7d4" }
wheels = [
Expand All @@ -1265,7 +1265,7 @@ fn fork_marker_inherit_combined_allowed() -> Result<()> {
"implementation_name == 'pypy' and sys_platform == 'darwin'",
]
dependencies = [
{ name = "package-c", marker = "sys_platform == 'linux' or implementation_name == 'pypy'" },
{ name = "package-c", marker = "implementation_name == 'pypy' and sys_platform == 'darwin'" },
]
sdist = { url = "https://astral-sh.github.io/packse/PACKSE_VERSION/files/fork_marker_inherit_combined_allowed_b-1.0.0.tar.gz", hash = "sha256:d6bd196a0a152c1b32e09f08e554d22ae6a6b3b916e39ad4552572afae5f5492" }
wheels = [
Expand Down Expand Up @@ -1413,8 +1413,8 @@ fn fork_marker_inherit_combined_disallowed() -> Result<()> {
"implementation_name != 'cpython' and implementation_name != 'pypy' and sys_platform == 'darwin'",
]
dependencies = [
{ name = "package-b", version = "1.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "implementation_name == 'pypy'" },
{ name = "package-b", version = "2.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "implementation_name == 'cpython'" },
{ name = "package-b", version = "1.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "implementation_name == 'pypy' and sys_platform == 'darwin'" },
{ name = "package-b", version = "2.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "implementation_name == 'cpython' and sys_platform == 'darwin'" },
]
sdist = { url = "https://astral-sh.github.io/packse/PACKSE_VERSION/files/fork_marker_inherit_combined_disallowed_a-1.0.0.tar.gz", hash = "sha256:92081d91570582f3a94ed156f203de53baca5b3fdc350aa1c831c7c42723e798" }
wheels = [
Expand Down Expand Up @@ -1578,8 +1578,8 @@ fn fork_marker_inherit_combined() -> Result<()> {
"implementation_name != 'cpython' and implementation_name != 'pypy' and sys_platform == 'darwin'",
]
dependencies = [
{ name = "package-b", version = "1.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "implementation_name == 'pypy'" },
{ name = "package-b", version = "2.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "implementation_name == 'cpython'" },
{ name = "package-b", version = "1.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "implementation_name == 'pypy' and sys_platform == 'darwin'" },
{ name = "package-b", version = "2.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "implementation_name == 'cpython' and sys_platform == 'darwin'" },
]
sdist = { url = "https://astral-sh.github.io/packse/PACKSE_VERSION/files/fork_marker_inherit_combined_a-1.0.0.tar.gz", hash = "sha256:2ec4c9dbb7078227d996c344b9e0c1b365ed0000de9527b2ba5b616233636f07" }
wheels = [
Expand Down Expand Up @@ -3899,8 +3899,8 @@ fn fork_remaining_universe_partitioning() -> Result<()> {
"os_name != 'darwin' and os_name != 'linux' and sys_platform == 'illumos'",
]
dependencies = [
{ name = "package-b", version = "1.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "os_name == 'darwin'" },
{ name = "package-b", version = "2.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "os_name == 'linux'" },
{ name = "package-b", version = "1.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "os_name == 'darwin' and sys_platform == 'illumos'" },
{ name = "package-b", version = "2.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "os_name == 'linux' and sys_platform == 'illumos'" },
]
sdist = { url = "https://astral-sh.github.io/packse/PACKSE_VERSION/files/fork_remaining_universe_partitioning_a-1.0.0.tar.gz", hash = "sha256:d5be0af9a1958ec08ca2827b47bfd507efc26cab03ecf7ddf204e18e8a3a18ae" }
wheels = [
Expand Down
26 changes: 11 additions & 15 deletions crates/uv/tests/snapshots/ecosystem__transformers-lock-file.snap
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,7 @@ environment-markers = [
dependencies = [
{ name = "aiohttp", marker = "python_version < '3.10' and platform_machine == 'aarch64' and platform_system == 'Linux'" },
{ name = "dill", marker = "python_version < '3.10' and platform_machine == 'aarch64' and platform_system == 'Linux'" },
{ name = "fsspec", version = "2024.6.1", source = { registry = "https://pypi.org/simple" }, marker = "python_version < '3.10' and platform_machine == 'aarch64' and platform_system == 'Linux'" },
{ name = "fsspec", version = "2024.6.1", source = { registry = "https://pypi.org/simple" }, extra = ["http"] },
{ name = "fsspec", version = "2024.6.1", source = { registry = "https://pypi.org/simple" }, extra = ["http"], marker = "python_version < '3.10' and platform_machine == 'aarch64' and platform_system == 'Linux'" },
{ name = "huggingface-hub", marker = "python_version < '3.10' and platform_machine == 'aarch64' and platform_system == 'Linux'" },
{ name = "multiprocess", marker = "python_version < '3.10' and platform_machine == 'aarch64' and platform_system == 'Linux'" },
{ name = "numpy", marker = "python_version < '3.10' and platform_machine == 'aarch64' and platform_system == 'Linux'" },
Expand Down Expand Up @@ -822,8 +821,7 @@ dependencies = [
{ name = "aiohttp", marker = "platform_machine != 'aarch64' or platform_system != 'Linux' or python_version >= '3.10'" },
{ name = "dill", marker = "platform_machine != 'aarch64' or platform_system != 'Linux' or python_version >= '3.10'" },
{ name = "filelock", marker = "platform_machine != 'aarch64' or platform_system != 'Linux' or python_version >= '3.10'" },
{ name = "fsspec", version = "2024.5.0", source = { registry = "https://pypi.org/simple" }, marker = "platform_machine != 'aarch64' or platform_system != 'Linux' or python_version >= '3.10'" },
{ name = "fsspec", version = "2024.5.0", source = { registry = "https://pypi.org/simple" }, extra = ["http"] },
{ name = "fsspec", version = "2024.5.0", source = { registry = "https://pypi.org/simple" }, extra = ["http"], marker = "platform_machine != 'aarch64' or platform_system != 'Linux' or python_version >= '3.10'" },
{ name = "huggingface-hub", marker = "platform_machine != 'aarch64' or platform_system != 'Linux' or python_version >= '3.10'" },
{ name = "multiprocess", marker = "platform_machine != 'aarch64' or platform_system != 'Linux' or python_version >= '3.10'" },
{ name = "numpy", marker = "platform_machine != 'aarch64' or platform_system != 'Linux' or python_version >= '3.10'" },
Expand Down Expand Up @@ -960,10 +958,8 @@ dependencies = [
{ name = "datasets", version = "2.14.4", source = { registry = "https://pypi.org/simple" }, marker = "python_version < '3.10' and platform_machine == 'aarch64' and platform_system == 'Linux'" },
{ name = "datasets", version = "2.20.0", source = { registry = "https://pypi.org/simple" }, marker = "platform_machine != 'aarch64' or platform_system != 'Linux' or python_version >= '3.10'" },
{ name = "dill" },
{ name = "fsspec", version = "2024.5.0", source = { registry = "https://pypi.org/simple" }, marker = "platform_machine != 'aarch64' or platform_system != 'Linux' or python_version >= '3.10'" },
{ name = "fsspec", version = "2024.5.0", source = { registry = "https://pypi.org/simple" }, extra = ["http"] },
{ name = "fsspec", version = "2024.6.1", source = { registry = "https://pypi.org/simple" }, marker = "python_version < '3.10' and platform_machine == 'aarch64' and platform_system == 'Linux'" },
{ name = "fsspec", version = "2024.6.1", source = { registry = "https://pypi.org/simple" }, extra = ["http"] },
{ name = "fsspec", version = "2024.5.0", source = { registry = "https://pypi.org/simple" }, extra = ["http"], marker = "platform_machine != 'aarch64' or platform_system != 'Linux' or python_version >= '3.10'" },
{ name = "fsspec", version = "2024.6.1", source = { registry = "https://pypi.org/simple" }, extra = ["http"], marker = "python_version < '3.10' and platform_machine == 'aarch64' and platform_system == 'Linux'" },
{ name = "huggingface-hub" },
{ name = "multiprocess" },
{ name = "numpy" },
Expand Down Expand Up @@ -1871,8 +1867,8 @@ dependencies = [
{ name = "packaging" },
{ name = "regex" },
{ name = "rich" },
{ name = "tensorflow-text", version = "2.7.3", source = { registry = "https://pypi.org/simple" }, marker = "platform_system != 'Darwin'" },
{ name = "tensorflow-text", version = "2.15.0", source = { registry = "https://pypi.org/simple" }, marker = "platform_system != 'Darwin'" },
{ name = "tensorflow-text", version = "2.7.3", source = { registry = "https://pypi.org/simple" }, marker = "(python_version == '3.9' and platform_machine != 'aarch64' and platform_system != 'Darwin') or (python_version == '3.9' and platform_system != 'Darwin' and platform_system != 'Linux') or (python_version > '3.9' and python_version < '3.10' and platform_machine != 'aarch64' and platform_system != 'Darwin') or (python_version > '3.9' and python_version < '3.10' and platform_system != 'Darwin' and platform_system != 'Linux') or (python_version >= '3.10' and python_version < '3.13' and platform_system != 'Darwin')" },
{ name = "tensorflow-text", version = "2.15.0", source = { registry = "https://pypi.org/simple" }, marker = "(python_version < '3.10' and platform_machine == 'aarch64' and platform_system == 'Linux') or (python_version >= '3.13' and platform_system != 'Darwin')" },
]
sdist = { url = "https://files.pythonhosted.org/packages/da/bf/7f34bfd78555f8ce68f51f6583b4a91a279e34dee2013047e338529c3f8a/keras_nlp-0.14.4.tar.gz", hash = "sha256:abd5886efc60d52f0970ac43d3791c87624bfa8f7a7048a66f9dbcb2d1d28771", size = 331838 }
wheels = [
Expand Down Expand Up @@ -2230,7 +2226,7 @@ environment-markers = [
"(python_version >= '3.12' and python_version < '3.13' and platform_machine != 'aarch64' and platform_system != 'Darwin') or (python_version >= '3.12' and python_version < '3.13' and platform_system != 'Darwin' and platform_system != 'Linux')",
]
dependencies = [
{ name = "numpy", marker = "platform_machine != 'aarch64' or platform_system != 'Linux' or python_version >= '3.10'" },
{ name = "numpy", marker = "(python_version < '3.10' and platform_machine != 'aarch64') or (python_version < '3.10' and platform_system != 'Linux') or (python_version >= '3.10' and python_version < '3.13')" },
]
sdist = { url = "https://files.pythonhosted.org/packages/dd/50/17ab8a66d66bdf55ff6dea6fe2df424061cee65c6d772abc871bb563f91b/ml_dtypes-0.4.0.tar.gz", hash = "sha256:eaf197e72f4f7176a19fe3cb8b61846b38c6757607e7bf9cd4b1d84cd3e74deb", size = 692650 }
wheels = [
Expand Down Expand Up @@ -4942,8 +4938,8 @@ name = "tensorflow-macos"
version = "2.15.1"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "tensorflow-cpu-aws", marker = "(platform_machine == 'aarch64' and platform_system == 'Linux') or (platform_machine == 'arm64' and platform_system == 'Linux')" },
{ name = "tensorflow-intel", marker = "platform_system == 'Windows'" },
{ name = "tensorflow-cpu-aws", marker = "(python_version < '3.10' and platform_machine == 'aarch64' and platform_system == 'Linux') or (python_version >= '3.13' and platform_machine == 'aarch64' and platform_system == 'Linux') or (python_version >= '3.13' and platform_machine == 'arm64' and platform_system == 'Linux')" },
{ name = "tensorflow-intel", marker = "python_version >= '3.13' and platform_system == 'Windows'" },
]
wheels = [
{ url = "https://files.pythonhosted.org/packages/b3/c8/b90dc41b1eefc2894801a120cf268b1f25440981fcf966fb055febce8348/tensorflow_macos-2.15.1-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:b8f01d7615fe4ff3b15a12f84471bd5344fed187543c4a091da3ddca51b6dc26", size = 2158 },
Expand Down Expand Up @@ -4989,9 +4985,9 @@ environment-markers = [
"(python_version >= '3.13' and platform_machine != 'aarch64' and platform_system != 'Darwin') or (python_version >= '3.13' and platform_system != 'Darwin' and platform_system != 'Linux')",
]
dependencies = [
{ name = "tensorflow", version = "2.15.1", source = { registry = "https://pypi.org/simple" }, marker = "platform_machine != 'arm64' or platform_system != 'Darwin'" },
{ name = "tensorflow", version = "2.15.1", source = { registry = "https://pypi.org/simple" }, marker = "(python_version < '3.10' and platform_machine == 'aarch64' and platform_system == 'Linux') or (python_version >= '3.13' and platform_machine != 'arm64') or (python_version >= '3.13' and platform_system != 'Darwin')" },
{ name = "tensorflow-hub", marker = "(python_version < '3.10' and platform_machine == 'aarch64' and platform_system == 'Linux') or python_version >= '3.13'" },
{ name = "tensorflow-macos", marker = "platform_machine == 'arm64' and platform_system == 'Darwin'" },
{ name = "tensorflow-macos", marker = "python_version >= '3.13' and platform_machine == 'arm64' and platform_system == 'Darwin'" },
]
wheels = [
{ url = "https://files.pythonhosted.org/packages/63/0f/d260a5cc7d86d25eb67bb919f957106b76af4a039f064526290d9cf5d93e/tensorflow_text-2.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:db09ada839eb92aa23afc6c4e37257e6665d64ae048cfdce6374b5aa33f8f006", size = 6441513 },
Expand Down
4 changes: 2 additions & 2 deletions crates/uv/tests/snapshots/ecosystem__warehouse-lock-file.snap
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ dependencies = [
{ name = "envier" },
{ name = "opentelemetry-api" },
{ name = "protobuf" },
{ name = "setuptools", marker = "python_version >= '3.12'" },
{ name = "setuptools" },
{ name = "six" },
{ name = "sqlparse" },
{ name = "typing-extensions" },
Expand Down Expand Up @@ -3143,7 +3143,7 @@ name = "redis"
version = "5.0.8"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "async-timeout", marker = "python_full_version < '3.11.[X]'" },
{ name = "async-timeout", marker = "python_full_version < '3.11.[X]' and python_version < '3.12'" },
]
sdist = { url = "https://files.pythonhosted.org/packages/48/10/defc227d65ea9c2ff5244645870859865cba34da7373477c8376629746ec/redis-5.0.8.tar.gz", hash = "sha256:0c5b10d387568dfe0698c6fad6615750c24170e548ca2deac10c649d463e9870", size = 4595651 }
wheels = [
Expand Down
Empty file removed foo/README.md
Empty file.
14 changes: 0 additions & 14 deletions foo/pyproject.toml

This file was deleted.

2 changes: 0 additions & 2 deletions foo/src/foo/__init__.py

This file was deleted.

Loading

0 comments on commit fbefe60

Please sign in to comment.