feat: allow for editable pypi source dependencies when using path#1044
Conversation
ruben-arts
left a comment
There was a problem hiding this comment.
Nice work!! It worked for some project I have on my machine. Lets share it with the world.
Some small remarks but in general I approve!
| # pep440_rs = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | ||
| # pep508_rs = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | ||
| # uv-build = { git = "https://github.com/wolfv/uv", tag = "expose-yanks" } | ||
| # uv-cache = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | ||
| # uv-client = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | ||
| # uv-dispatch = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | ||
| # uv-distribution = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | ||
| # uv-installer = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | ||
| # uv-interpreter = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | ||
| # uv-normalize = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | ||
| # uv-resolver = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | ||
| # uv-traits = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | ||
| # distribution-filename = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | ||
| # distribution-types = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | ||
| # install-wheel-rs = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | ||
| # platform-tags = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | ||
| # pypi-types = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | ||
| # requirements-txt = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } |
There was a problem hiding this comment.
| # pep440_rs = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | |
| # pep508_rs = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | |
| # uv-build = { git = "https://github.com/wolfv/uv", tag = "expose-yanks" } | |
| # uv-cache = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | |
| # uv-client = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | |
| # uv-dispatch = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | |
| # uv-distribution = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | |
| # uv-installer = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | |
| # uv-interpreter = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | |
| # uv-normalize = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | |
| # uv-resolver = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | |
| # uv-traits = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | |
| # distribution-filename = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | |
| # distribution-types = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | |
| # install-wheel-rs = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | |
| # platform-tags = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | |
| # pypi-types = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } | |
| # requirements-txt = { git = "https://github.com/wolfv/uv", branch = "expose-yanks" } |
There was a problem hiding this comment.
No we need to keep this because we have to patch it very often.
| let installed = site_packages.iter().filter(|dist| { | ||
| dist.installer() | ||
| .unwrap_or_default() | ||
| .is_some_and(|installer| installer == "uv") |
There was a problem hiding this comment.
Is this still uv or should this also be pixi-uv?
There was a problem hiding this comment.
That PR is still open :)
|
This doesn't seem to be doing what it's supposed to do. If I add the following to particle, for example: [tool.pixi.project]
name = "particle"
channels = ["conda-forge"]
platforms = ["osx-64"]
[tool.pixi.dependencies]
particle = { path = ".", editable = true}Then it does not do an editable install, and it does not install from the local path. Instead, it pulls |
|
Ahh, I bet I got the wrong section name. Yep, |
|
Indeed, let's make an issue out of that :) |
| gunicorn = ">=21.2.0,<21.3" | ||
|
|
||
| [pypi-dependencies] | ||
| docker-project = { path = ".", editable = true } |
There was a problem hiding this comment.
doesn't this clash with postinstall-production below @tdejager?
There was a problem hiding this comment.
Hmm yes it will get overwriten probably. But the .pth files might incorrectly stay in the prefix. We need the #1092 to do it correctly.
This PR adds the ability to do editable installs for pypi-packages. This requires the project to also use a
pyproject.tomlso that we know what build system to use.This PR takes great inspiration on how UV does it with some changes.
I think that when this PR lands you mostly want to use editable installs for path based dependencies that you control, instead of regular path based dependencies.
Locking
For locking we actually lock whether the dependency is editable and also save a hash to the
pyproject.toml,setup.cfg, orsetup.pyfiles. If any of these change, the lock file is invalidated, this is analogous to how UV does this for determining whether to re-install but their code uses the timestamp instead.