devonfw / ide

Tool to automate setup and update of development environment (esp. for Java projects).
Apache License 2.0
35 stars 101 forks source link

Add version handling to commandlet pip #1170

Open CREITZ25 opened 1 year ago

CREITZ25 commented 1 year ago

With the switch from ide-mirrors to ide-urls, versions of the pip commandlet are available. In order to be able to use this functionality, the commandlet must be adjusted so that it does not always automatically use the latest version.

Therefore, the doDownload line must be adjusted to either use "${PIP_VERSION}" if it configured, or if not, the latest version must be determined and passed to doDownload.

https://github.com/devonfw/ide/blob/92c226191dbb2d1e8cdfc0898d19beeafcc6752b/scripts/src/main/resources/scripts/command/pip#LL41C7-L41C59

hohwille commented 1 year ago

Aint there a dependency between python and pip? In other words: can any python version X work together witn any pip version Y? I doubt this is the case. This is not meant to block this issue but something to address in the documentation and in the future also for what I planned triggered by issue #1082: we need to introduce dependencies to each tool/edition version in ide-urls. The biggest question will be how to determine this automatically? Actually I assume it will not be possible to do it fully automatic. Rather we need to investigate, keep a current default in the code for each tool/edition and change it manually as soon as we observer problems. However, to bring greatest UX for devonfw-ide I see no other way...

hohwille commented 1 year ago

For the moment we also have the problem that the updater for pip is broken (same problem as #1199). We should go for a pragmatic solution and manually have only a latest version of pip in ide-urls without checksums.

hohwille commented 1 year ago

So for #941 we have at least the minimum fix that I just pushed. However, I leave this issue open as the actual problem is still valid and not yet fixed.

CREITZ25 commented 1 year ago

The following PIP releases are available on the website https://pip.pypa.io: 2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6 and the current release.

But if you look at Github, the releases have completely different names: the current one there is 23.1.2.

I installed all releases, from 2.7 to the current one and found the following connection:

https://bootstrap.pypa.io/get-pip.py 23.1.2 https://bootstrap.pypa.io/pip/3.6/get-pip.py 21.3.1 (last 21th release) https://bootstrap.pypa.io/pip/3.5/get-pip.py 20.3.4 (last 20th release) https://bootstrap.pypa.io/pip/3.4/get-pip.py 19.1.1 (not the last 19th release) https://bootstrap.pypa.io/pip/3.3/get-pip.py 10.0.1 https://bootstrap.pypa.io/pip/3.2/get-pip.py 7.1.2 https://bootstrap.pypa.io/pip/2.7/get-pip.py 20.3.4 (also the last 20th release) https://bootstrap.pypa.io/pip/2.6/get-pip.py 9.0.3

I also found the following information on the website:

Python 2 support pip 20.3 was the last version of pip that supported Python 2. Bugs reported with pip which only occur on Python 2.7 will likely be closed as “won't fix” issues by pip's maintainers.

--> https://bootstrap.pypa.io/pip/3.5/get-pip.py 20.3.4 (last 20.3th)

The current version of pip works on: Windows, Linux and MacOS. CPython 3.7, 3.8, 3.9, 3.10 and latest PyPy3.

--> https://bootstrap.pypa.io/get-pip.py

That means for Python 2 we need PIP 3.5 and for Python 3 we need the current PIP Release.

However, we have to check the versions in Github, otherwise we won't notice when "latest" changes.