-
Notifications
You must be signed in to change notification settings - Fork 894
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
Add support for --reinstall
and --reinstall-package
in uv tool install
#4504
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zanieb
force-pushed
the
zb/tool-install-force
branch
from
June 25, 2024 01:23
14be755
to
568f378
Compare
zanieb
force-pushed
the
zb/tool-install-reinstall
branch
from
June 25, 2024 01:25
214b411
to
b695e26
Compare
zanieb
force-pushed
the
zb/tool-install-force
branch
from
June 25, 2024 01:28
568f378
to
f498350
Compare
zanieb
force-pushed
the
zb/tool-install-reinstall
branch
from
June 25, 2024 01:28
b695e26
to
8620ab2
Compare
zanieb
force-pushed
the
zb/tool-install-force
branch
2 times, most recently
from
June 25, 2024 13:24
e8685a2
to
05bc596
Compare
zanieb
force-pushed
the
zb/tool-install-reinstall
branch
from
June 25, 2024 13:32
8620ab2
to
51f4a7d
Compare
zanieb
force-pushed
the
zb/tool-install-force
branch
from
June 25, 2024 13:36
05bc596
to
c6a4890
Compare
Merged
zanieb
added a commit
that referenced
this pull request
Jun 26, 2024
This is the minimal "working" implementation. In summary, we: - Resolve the requested requirements - Create an environment at `$UV_STATE_DIR/tools/$name` - Inspect the `dist-info` for the main requirement to determine its entry points scripts - Link the entry points from a user-executable directory (`$XDG_BIN_HOME`) to the environment bin - Create an entry at `$UV_STATE_DIR/tools/tools.toml` tracking the user's request The idea with `tools.toml` is that it allows us to perform upgrades and syncs, retaining the original user request (similar to declarations in a `pyproject.toml`). I imagine using a similar schema in the `pyproject.toml` in the future if/when we add project-levle tools. I'm also considering exposing `tools.toml` in the standard uv configuration directory instead of the state directory, but it seems nice to tuck it away for now while we iterate on it. Installing a tool won't perform a sync of other tool environments, we'll probably have an explicit `uv tool sync` command for that? I've split out todos into follow-up pull requests: - #4509 (failing on Windows) - #4501 - #4504 Closes #4485
zanieb
force-pushed
the
zb/tool-install-force
branch
from
June 26, 2024 16:01
c6a4890
to
94741f2
Compare
zanieb
force-pushed
the
zb/tool-install-reinstall
branch
from
June 26, 2024 16:09
51f4a7d
to
b360b39
Compare
zanieb
force-pushed
the
zb/tool-install-force
branch
from
June 26, 2024 16:23
94741f2
to
3a1f81e
Compare
zanieb
force-pushed
the
zb/tool-install-reinstall
branch
from
June 26, 2024 16:25
b360b39
to
73f519c
Compare
zanieb
force-pushed
the
zb/tool-install-force
branch
3 times, most recently
from
June 26, 2024 16:51
9ec3452
to
46e4225
Compare
zanieb
force-pushed
the
zb/tool-install-reinstall
branch
from
June 26, 2024 16:56
73f519c
to
41f1dd8
Compare
zanieb
force-pushed
the
zb/tool-install-force
branch
from
June 26, 2024 18:59
46e4225
to
cf0a6a6
Compare
zanieb
force-pushed
the
zb/tool-install-reinstall
branch
2 times, most recently
from
June 26, 2024 19:32
4d2654d
to
1736eb3
Compare
zanieb
force-pushed
the
zb/tool-install-force
branch
from
June 26, 2024 19:52
cf0a6a6
to
85cece6
Compare
zanieb
force-pushed
the
zb/tool-install-reinstall
branch
2 times, most recently
from
June 26, 2024 19:53
bbc9c38
to
19273fc
Compare
zanieb
force-pushed
the
zb/tool-install-reinstall
branch
from
June 26, 2024 20:02
19273fc
to
cb16a68
Compare
zanieb
added a commit
that referenced
this pull request
Jun 26, 2024
Adds detection of existing entry points, avoiding clobbering entry points that were installed by another tool. If we see any existing entry point collisions, we'll stop instead of overwriting them. The `--force` flag can be used to opt-in to overwriting the files; we can't use `-f` because it's taken by `--find-links` which is silly. The `--force` flag also implies replacing a tool previously installed by uv (the environment is rebuilt). Similarly, #4504 adds support for reinstalls that _will not_ clobber entry points managed by other tools.
zanieb
force-pushed
the
zb/tool-install-reinstall
branch
from
June 26, 2024 20:03
cb16a68
to
ca5a754
Compare
charliermarsh
approved these changes
Jun 26, 2024
zanieb
force-pushed
the
zb/tool-install-reinstall
branch
2 times, most recently
from
June 26, 2024 20:12
18d6ece
to
7b5ee7f
Compare
zanieb
force-pushed
the
zb/tool-install-reinstall
branch
from
June 26, 2024 20:15
7b5ee7f
to
f7904ce
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds support for
--reinstall
and--reinstall-package
touv tool install
. These are already available via the installer settings, we just respect them now.--reinstall
implies a recreation of the environment and reinstallation of the entry points.--reinstall-package
will only update a subset of the environment. If the target package is the one with the entry points, we'll reinstall the entry points. Otherwise, the entry points are not changed.