-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow for editable pypi source dependencies when using path
#1044
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still uv
or should this also be pixi-uv
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 :) |
@@ -12,6 +12,9 @@ python = ">=3.12" | |||
flask = ">=3.0.2,<3.1" | |||
gunicorn = ">=21.2.0,<21.3" | |||
|
|||
[pypi-dependencies] | |||
docker-project = { path = ".", editable = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't this clash with postinstall-production
below @tdejager?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.toml
so 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.py
files. 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.