-
Notifications
You must be signed in to change notification settings - Fork 789
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
re-running "uv pip install -e ..." does not re-invoke the build system on the package #2844
Comments
FWIW you can use |
Yeah missed that option - it does work. Guess I'll leave it up to you whether the inconsistency with pip on the caching here is right for |
To add to that - editable mode is tricky and I’d prefer / expect uv to rebuild it every time. Keep the current logic for non-editable packages such that reinstall isn’t needed. |
I'd agree. Supposedly, editable installs are used by developers, and the only time time one needs to run |
That’s the general idea yeah. It’s intended to be used during local development. There’s nothing in the spec to support optimizing an editable install unfortunately. |
Running |
It's been broken since we switched the workflow to use `uv`, because `uv` doesn't (by default) reinstall an editable package if it sees that it's already installed with the "right version". (I personally find this pretty surprising behaviour for editable installs. It's already tracked in astral-sh/uv#2844.)
I can confirm the behavior with latest
I have a blog built with Python-based Pelican and its theme calls Plumage. So when I'm working on it I'd like to tweak stuff on my local dev environment in both repositories. The blog has a [project]
name = "blog"
dependencies = [
"pelican [Markdown] ~= 4.9.1",
"plumage",
]
[tool.uv.sources]
plumage = { path = "../plumage" } To generate the blog with its local modifications, I call The files found in the
My only option is to call:
In which case |
@kdeldycke that is a different issue, you're not using |
Oh ok I see. Still, should we requalify my observation into a separate issue? I mean, isn't a path-based local dependency the same as a Git remote branch? A requirement like
So I was expecting a local-path dependency to be, semantically, the same kind of moving target as a remote |
We have a new API whereby you can add additional files to consider when invalidating the cache. You can also include the current Git commit (i.e., invalidate whenever the SHA changes). Looks like this: [tool.uv]
cache-keys = [{ file = "pyproject.toml" }, { file = "requirements.txt" }, { git = true }] See: https://docs.astral.sh/uv/concepts/cache/#dynamic-metadata. |
Gonna close in favor of #7282. |
uv version: 0.1.29
platform: macos 14.4.1 (m1 max)
Setup a simple project using the below
pyproject.toml
andsetup.py
files. With those created, observe some differences between.venv/bin/pip install -e .
anduv pip install -e .
in howsetup.py
is invoked:example using pip as expected baseline
example using uv as problematic
Discussion
uv pip install
is not invokingeditable_wheel
(or any other commands) if it determines that the package is already installed. It only re-invokes things if I changesetup.py
orpyproject.toml
, but not other files in the project. I have also tested adding a MANIFEST.in and related files, and when I change any of those files the edit is not run.Why is this a problem?
The issue is we are hooking the commands below to invoke other builds (
yarn build
to generate webassets for our projects), and ifuv
does not invoke the install, we have to go into each project and do this, circumventing setuptools as our build system.uv
appears to be too aggressive in caching here, it should re-invokeeditable_wheel
on any editable install every time it is passed touv pip install -e ...
.Other notes
I tried using
uv pip install --refresh -e .
and it has no effect on the result.Repro example files
pyproject.toml
setup.py
The text was updated successfully, but these errors were encountered: