mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
![]() ## Summary It turns out that `Topo` only works on graphs without cycles. If a graph has a cycle, it seems to bail early. So we were losing markers for trees that contain cycles (like Poetry, which depends on `poetry-plugin-export`, which depends on Poetry). Now, we remove cycles beforehand and re-add those edges afterwards. It's a bit hard for me to reason about the implications of this. The way that marker propagation works is that we do visit the nodes in-order and propagate the markers from any incoming to any outgoing edges. We only do this at a single depth (rather than recursively) because we visit the nodes in-order anyway. But if you have a cycle... then in theory you might need to propagate the markers recursively? Or maybe not? As an example: `A -> B -> C -> D -> B` If `A -> B` has `sys_platform == 'darwin'`, and then `D -> B` has `python_version >= '3.7`... then we don't need to propagate `python_version >= '3.7'` back to `B` or any of its dependencies, because the condition would be `(sys_platform == 'darwin' or python_version >= '3.7) or sys_platform == 'darwin'`, which is equivalent to `sys_platform == 'darwin'`. Closes #4584. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |