You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Using a relative path in tool.uv.sources add the absolute path in pixi.lock #4680
I created a dummy repository to reproduce the bug, hopefully it will help.
Note that uv doesn't have this behavior, so it's fine to reference python packages present in subdirectories with uv.
Expected behavior
Like uv, when referencing a relative path in the pyproject.toml, an absolute path should never go in the pixi.lock, otherwise it's impossible to re-use it on another computer.
Okay, so I checked how uv does it. If you use tool.uv.sources. In this example I had a package called 'a', that I overrode with a local click version, then you get something like:
[[package]]
name = "click"
version = "8.3.dev0"
source = { directory = "click" }
dependencies = [
{ name = "colorama", marker = "sys_platform == 'win32'" },
]
[package.metadata]
requires-dist = [{ name = "colorama", marker = "sys_platform == 'win32'" }]
[package.metadata.requires-dev]
dev = [
{ name = "ruff" },
{ name = "tox" },
{ name = "tox-uv" },
]
docs = [
{ name = "myst-parser" },
{ name = "pallets-sphinx-themes" },
{ name = "sphinx" },
{ name = "sphinx-tabs" },
{ name = "sphinxcontrib-log-cabinet" },
]
docs-auto = [{ name = "sphinx-autobuild" }]
gha-update = [{ name = "gha-update", marker = "python_full_version >= '3.12'" }]
pre-commit = [
{ name = "pre-commit" },
{ name = "pre-commit-uv" },
]
tests = [{ name = "pytest" }]
typing = [
{ name = "mypy" },
{ name = "pyright" },
{ name = "pytest" },
]
[[package]]
name = "package-a"
version = "0.1.0"
source = { editable = "package-a" }
dependencies = [
{ name = "click" },
]
[package.metadata]
requires-dist = [{ name = "click", directory = "click" }]
So no absolute paths :)
The main problem is that rattler_lock uses pep508_rs requirements directly in the PyPI requires_dist section, this by default does not allow relative paths. My assumption is that this causes us to default to absolute paths. Because in the uv -> open-souce conversion code, these will probably be converted. There are specific extensions though that do allow this with the open-source crates.
So my goal here is minimal lock-file changes, keep that in mind. So for @baszalmstra I propose we:
Try to enable these extensions for pixi and rattler_lock. (uv has them on by default).
Refactor code in rattler_lock to allow for this, should not be much, some tests would be nice.
Refactor code in pixi to allow for this as well, this is going to be a lot more code that will be touched.
If this does not yield the results that we want (there is a reason why uv did not go for this probably). We need to change the required_dists types.
Activity
tdejager commentedon Oct 6, 2025
Yes I've actually seen this in another issue as well: #4573
tdejager commentedon Oct 6, 2025
Sounds like something we should fix.
tdejager commentedon Oct 8, 2025
Okay, so I checked how
uvdoes it. If you usetool.uv.sources. In this example I had a package called 'a', that I overrode with a local click version, then you get something like:So no absolute paths :)
The main problem is that
rattler_lockusespep508_rsrequirements directly in the PyPIrequires_distsection, this by default does not allow relative paths. My assumption is that this causes us to default to absolute paths. Because in the uv -> open-souce conversion code, these will probably be converted. There are specific extensions though that do allow this with the open-source crates.So my goal here is minimal lock-file changes, keep that in mind. So for @baszalmstra I propose we:
pixiandrattler_lock. (uv has them on by default).rattler_lockto allow for this, should not be much, some tests would be nice.required_diststypes.feat: Relative path support in `LockFile` (#1760)
feat: Relative path support in `LockFile` (conda#1760)
feat: Relative path support for pypi deps in Lockfile
29 remaining items
feat: Relative path support in `LockFile` (#1760)
feat: list data for pypi packages from cached index data
feat: list data for pypi packages from cached index data
fix: Do not drop verbatim urls unnecessarily
fix: Do not drop verbatim urls unnecessarily
feat: Relative path support in `LockFile` (#1760)
feat: list data for pypi packages from cached index data
fix: Do not drop verbatim urls unnecessarily
fix(uv_conversions): preserve relative paths in lockfile (issue prefi…
fix(uv_conversions): preserve relative paths in lockfile (issue prefi…