mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
Update project::update_environment
to respect reinstall options (#4502)
While working on https://github.com/astral-sh/uv/pull/4492 I noticed that `--reinstall-package` was not actually respected by `update_environment`, it exited early due to satisfied requirements. Before ``` ❯ cargo run -q -- tool install black -v --reinstall-package tomli ... DEBUG All requirements satisfied: black | click>=8.0.0 | mypy-extensions>=0.4.3 | packaging>=22.0 | pathspec>=0.9.0 | platformdirs>=2 | tomli>=1.1.0 ; python_version < '3.11' | typing-extensions>=4.0.1 ; python_version < '3.11' ``` After ``` ❯ cargo run -q -- tool install black -v --reinstall-package tomli ... Uninstalled 1 package in 0.99ms Installed 1 package in 4ms - tomli==2.0.1 + tomli==2.0.1 ```
This commit is contained in:
parent
08bf6fb87c
commit
e242cdf713
1 changed files with 1 additions and 1 deletions
|
@ -319,7 +319,7 @@ pub(crate) async fn update_environment(
|
|||
|
||||
// Check if the current environment satisfies the requirements
|
||||
let site_packages = SitePackages::from_environment(&venv)?;
|
||||
if spec.source_trees.is_empty() {
|
||||
if spec.source_trees.is_empty() && reinstall.is_none() {
|
||||
match site_packages.satisfies(&spec.requirements, &spec.constraints)? {
|
||||
// If the requirements are already satisfied, we're done.
|
||||
SatisfiesResult::Fresh {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue