Skip to content

Conversation

@hohwille
Copy link
Member

@hohwille hohwille commented Dec 7, 2025

This PR fixes #39

Implemented changes:

  • This is a fork of PR #39: implement pip commandlet #1597 so credits go to @maybeec since I took over his work
  • However, I implemented PR #39: refactoring to extract package-manager logic out of node/npm #1638 and reused this to share common logic between node/npm and uv/python/pip since both worlds use a package manager that we use instead of our default installation routines.
  • I was able to cause so problems bugs in some edge-cases with the current state of #39: implement pip commandlet #1597 (e.g. install python, install pip, uninstall uv, run pip, bang)
  • Also I now give the option to the user to decide if he wants to use the "real pip" or the emulated "uv pip". IMHO end users will typically expect that ide pip «args» is doing the same thing as pip «args» as we promised in our documentation. Therefore I am still thinking if the default should actually be the "real pip" - currently I made uv be the default.

Checklist for this PR

Make sure everything is checked before merging this PR. For further info please also see
our DoD.

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary» (e.g. #921: fixed setup.bat). If no issue ID exists, title only.
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue (might happen for very small PRs)
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labeled
    with internal

Checklist for tool commandlets

Have you added a new «tool» as commandlet? There are the following additional checks:

  • The tool can be installed automatically (during setup via settings) or via the commandlet call
  • The tool is isolated in its IDEasy project, see Sandbox Principle
  • The new tool is added to the table of tools in LICENSE.asciidoc
  • The new commandlet is a command-wrapper for «tool»
  • Proper help texts for all supported languages are added here
  • The new commandlet installs potential dependencies automatically
  • The variables «TOOL»_VERSION and «TOOL»_EDITION are honored by your commandlet
  • The new commandlet is tested on all platforms it is available for or tested on all platforms that are in scope of the linked issue

maybeec and others added 21 commits November 18, 2025 14:58
added execute permissions to binaries
added extra echo for pip to uv binaries
replaced cmd content with bash
Removed duplicate entry for issue devonfw#39 in the changelog.
…ommandlet

- Refactored Pip.java to extend LocalToolCommandlet instead of DelegatingToolCommandlet
- Created PipRepository extending ArtifactToolRepository for PyPI version resolution
- Created PipArtifact and PipArtifactMetadata data classes
- Created PypiJsonObject record for parsing PyPI JSON API responses
- Added getPipRepository() to IdeContext interface and AbstractIdeContext
- Created PipRepositoryMock for testing with WireMock
- pip installation now delegates to 'uv pip install pip=={version}'
- pip execution runs through 'uv pip' instead of direct pip binary
- Consolidated test resources and fixed test configuration

Addresses review comments from PR devonfw#1597
# Conflicts:
#	cli/src/main/java/com/devonfw/tools/ide/tool/PackageManagerBasedLocalToolCommandlet.java
#	cli/src/main/java/com/devonfw/tools/ide/tool/node/Node.java
@hohwille hohwille added this to the release:2025.12.001 milestone Dec 7, 2025
@hohwille hohwille self-assigned this Dec 7, 2025
@hohwille hohwille added enhancement New feature or request commandlet ide sub-command pip Python package manager (Pip Installs Packages) labels Dec 7, 2025
@github-project-automation github-project-automation bot moved this to 🆕 New in IDEasy board Dec 7, 2025
@hohwille hohwille mentioned this pull request Dec 7, 2025
15 tasks
@coveralls
Copy link
Collaborator

coveralls commented Dec 7, 2025

Pull Request Test Coverage Report for Build 20007288351

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 183 unchanged lines in 6 files lost coverage.
  • Overall coverage decreased (-0.1%) to 70.003%

Files with Coverage Reduction New Missed Lines %
com/devonfw/tools/ide/tool/ide/IdeToolCommandlet.java 1 78.33%
com/devonfw/tools/ide/variable/IdeVariables.java 1 95.74%
com/devonfw/tools/ide/commandlet/CommandletManagerImpl.java 8 90.0%
com/devonfw/tools/ide/context/IdeContext.java 19 74.6%
com/devonfw/tools/ide/tool/LocalToolCommandlet.java 24 81.03%
com/devonfw/tools/ide/context/AbstractIdeContext.java 130 67.91%
Totals Coverage Status
Change from base Build 20003978026: -0.1%
Covered Lines: 10030
Relevant Lines: 13775

💛 - Coveralls

@maybeec
Copy link
Member

maybeec commented Dec 7, 2025

Nice @hohwille ! Thanks. Just one question:

Also I now give the option to the user to decide if he wants to use the "real pip" or the emulated "uv pip".

Is there any option to stay in control as a settings admin over all installations to not end up in different behaviors on the team's machines as some chose so, some others ?

@hohwille
Copy link
Member Author

hohwille commented Dec 7, 2025

Is there any option to stay in control as a settings admin over all installations to not end up in different behaviors on the team's machines as some chose so, some others ?

First of all the project settings can define this via

PIP_EDITION=uv

vs.

PIP_EDITION=pip

The general configuration philosophy of IDEasy is that users can override things in their conf/ide.properties.
By doing so you take control but also responsibility ("With great power comes great responsibility").
Typically the average IDEasy user never does things like this unless he was told so by others.
So to what I observed the users only override stuff there when there is a real purpose to do so.
The bigger problem is IMHO if users do override something, they easily forget about this and months or years later this may become a problem.
We support the command ide -d env to get a quick overview of your configurations and where they originate from.

IMHO it is not a good idea to give 100% control to an "IDE admin".
This is from a command and conquer thinking.
User should have the last word and "manual override" like the pilot of a plane can overrule the auto-pilot.

@hohwille hohwille moved this from 🆕 New to 👀 In review in IDEasy board Dec 7, 2025
@hohwille hohwille merged commit 3ccfec4 into devonfw:main Dec 7, 2025
3 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in IDEasy board Dec 7, 2025
@hohwille hohwille deleted the maybeec-feature/39-pip-commandlet branch December 7, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commandlet ide sub-command enhancement New feature or request pip Python package manager (Pip Installs Packages)

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Implement ToolCommandlet for pip

4 participants