Skip to content

Conversation

@Jackmin801
Copy link
Member

@Jackmin801 Jackmin801 commented Jan 27, 2026

Note

Switches uv pip install behavior to use -P <package> instead of --upgrade, ensuring only the target environment is upgraded and not its dependencies.

  • get_install_command now accepts package_name and uses uv ... -P <package>; callers updated to pass normalized names
  • Private env install path and _build_install_command updated to use -P for uv and keep --upgrade for pip
  • Minor docstring/flag wording tweaks to reflect "upgrade flags" semantics

Written by Cursor Bugbot for commit 2c38931. This will update automatically on new commits. Configure here.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c38931ddf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modifies the uv pip install behavior to only upgrade the target package without upgrading its dependencies. The change switches from using the --upgrade flag to using the -P <package_name> flag for uv, while keeping pip unchanged.

Changes:

  • Modified get_install_command() to accept a package_name parameter and use -P flag for uv instead of --upgrade
  • Updated the private build install logic to use -P flag with normalized package name for uv
  • Updated _build_install_command() to use -P flag for simple index installations with uv

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

tool: Package manager to use ('uv' or 'pip')
wheel_url: URL to the wheel file
no_upgrade: If True, don't include --upgrade flag (preserves locked dependencies)
package_name: Package name for targeted upgrade with -P flag (uv only)
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring says the package_name parameter is for "targeted upgrade with -P flag (uv only)", but it doesn't specify whether the name should be normalized or not. Consider clarifying that this should be the normalized package name (as it is in practice at line 2311 where normalized_name is passed), or alternatively, perform the normalization inside this function to ensure consistency.

Suggested change
package_name: Package name for targeted upgrade with -P flag (uv only)
package_name: Normalized package name for targeted upgrade with -P flag (uv only)
(should match the normalized name used elsewhere, e.g. lowercase as in PEP 503)

Copilot uses AI. Check for mistakes.
Comment on lines 1592 to +1601
if with_tool == "uv":
cmd_parts = ["uv", "pip", "install", str(wheel_path)]
cmd_parts = ["uv", "pip", "install"]
if not no_upgrade:
# Use -P to only upgrade this package, not its dependencies
cmd_parts.extend(["-P", normalized_name])
cmd_parts.append(str(wheel_path))
else:
cmd_parts = ["pip", "install", str(wheel_path)]
if not no_upgrade:
cmd_parts.insert(-1, "--upgrade")
if not no_upgrade:
cmd_parts.append("--upgrade")
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --upgrade flag is placed after the wheel path (line 1601), but in the get_install_command function (lines 1277-1279), the flag is correctly placed before the wheel URL. This inconsistency means the command structure differs between this code path and the one using get_install_command. While pip typically accepts flags in either position, this creates unnecessary inconsistency. Consider using get_install_command(with_tool, str(wheel_path), normalized_name, no_upgrade) instead of manually building the command, which would ensure consistency with the rest of the codebase and reduce code duplication.

Copilot uses AI. Check for mistakes.
@JannikSt JannikSt merged commit 7df2986 into main Jan 27, 2026
17 checks passed
@JannikSt JannikSt deleted the fix-uv-upgrade-upgradin-2-much branch January 27, 2026 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants