Conversation
Rattler removed this, so it needs to go here as well.
This PR replaces prefix-dev#4788! Make pixi handle relative paths to pypi dependencies in the LockFile. This helps when checking in pixi.lock files that reference local python packages. Instead of ending up with a machine specific path in the lock file we have relative path that should work for all developers. This depends on the rattler part which is here: conda/rattler#1760 -- as seen in the feature/lockfile-v7 branch in the `conda/rattler` repository! The PR consists of several changes: - Update to the rattler_lock API changes made in feat: Relative path support in LockFile conda/rattler#1760 - Make sure the non-pep508-extensions are enabled in pixi as well Convert between uv relative paths and pixi relative paths - It adapts pyproject.toml parsing to preserve relative path in python requirements and in the `tool.pixi.pypi-dependencies` section The last is the big improvement over prefix-dev#4788. Relates to: prefix-dev#4680
Simplistic approach: It just creates platforms based on conda's `Platform` without any virtual packages.
6f8a811 to
439b920
Compare
We do not want to store the version number in case it is dynamic.
4e54121 to
d5973f7
Compare
When using `pixi list`, use data from the cached index data that we have stored. Fall back to leaving the data blank if nothing is cached. We do run into the blank data case occasionally: * Some repositories are to not get cached and uv accepts that * Some are not "simple" The `pytorch` index falls into both of those categories. Fixes: prefix-dev#5114
d5973f7 to
bdb8da4
Compare
|
Hi @hunger Just wanted to ask if this PR is already in a state that's ready for some testing? I work on quite a complex monorepo that extensively relies on pixi and editable pypi dependencies so maybe I could provide some useful feedback by testing this PR. |
|
We are very close to merging this. If you want to start testing that would be great! |
|
Okay nice, this PR fixes a bug I was about to create an issue for. Consider the following small example you can try yourself. Create a new project with this [project]
dependencies = []
name = "foo"
requires-python = ">=3.14"
version = "0.1.0"
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64", "win-64"]
[tool.pixi.pypi-options]
no-build = true
[tool.pixi.pypi-dependencies]
foo = { path = ".", editable = true }
python-dotenv = "==1.2.1,<2"and then run Now change the dependency to And the cool thing is that this PR fixes this behavior, the dependency version does not get bumped for no good reason anymore :) Seems to be related to ❓I think it would make sense to add a regression test for this. What do you think? In case you're interested in what an AI agent found out about this bugBug:
|
| Scenario | main (v0.65.x) |
feature/lockfile-v7 |
|---|---|---|
no-build + editable, no changes |
Re-solves every time, discards locked records | No re-solve (correct) |
no-build + editable, pyproject.toml changed |
Re-solves, discards locked records | Re-solves, preserves locked records as preferences |
Non-editable path deps + no-build |
Correctly fails (source builds not allowed) | Correctly fails |
Key Files
crates/pixi_core/src/lock_file/satisfiability/mod.rs—PypiNoBuildCheck::check()(line 720)crates/pixi_core/src/lock_file/outdated.rs—disregard_locked_contenthandling (line 218)crates/pixi_core/src/lock_file/update.rs— locked records filtering (line 1453)crates/pixi_core/src/lock_file/resolve/pypi.rs— preferences from locked records (line 617)
|
With the current state of the PR I get a crash when running all the install tasks in my monorepo. With current pixi 0.65.0 this does not happen. For context, my monorepo consists of a bunch of apps and packages where the apps use the packages as editable pypi dependencies. The packages in the monorepo can also depend on other packages in the monorepo. Now with pixi built from the current state of this PR the packages do not find the other packages anymore probably due to wrong resolution of relative paths? I hope this AI summary explains the bug I encounteredBug: Lockfile v7 path mismatch between environment section and package definitionsSummaryOn the ErrorRoot CauseThe bug is in The
|
|
Nice! Thanks for this! @hunger can you try to implement the fix? |
|
Also there was this debug output when running |
|
@uwu-420: Yes, I really need to double-check I have not lettered debug output :-/ Thanks for checking. I am currently busy trying to land another PR that decouples pixi a bit better from the lockfile data for pypi packages, which will enable us to hopefully have less info in lockfile-v7 than now -- and should fix a bug with pypi package versions that a test in Nichita's PR to remove the hash from local source packages exposed. |
|
We also moved over to the "real" pixi repo in the meantime: https://github.com/prefix-dev/pixi/tree/feature/lockfile-v7 This branch is stale. |
|
@hunger since this PR has been closed now, is there another PR where I should mention this bug? #5483 (comment) |
|
Yes! #5607 is the right branch |
Description
Fixes #{issue}
How Has This Been Tested?
AI Disclosure
Tools: {e.g., Claude, Codex, GitHub Copilot, ChatGPT, etc.}
Checklist:
schema/model.py.