Question regarding why pip is selecting a different version than I would expect.
Env: python 3.8.13, pip 22.0.4
I have a package in my
This pip command:
pip install -v -v -v -i https://pypi.org/simple --find-links=/home/steve/Documents/project01/GitRepos/ioif/ioif-core/dist -i https://gitlab.XXXXX.stevens.edu:9090/gitlab-ci/devl 'ioif-core'
The directory used in the --find-link option has a wheel file: ioif_core-0.8.4.post20221107-py3-none-any.whl using PEP440 compliant naming. The devpi index gitlab-ci/devl has an older wheel file for the same package (the below output from pip shows the determined version: 0.8.4.post20220421181059).
pip is installing the 20220421 version rather than the 20221107 and I’m confused as to why? I am probably missing why from the verbose output the factor that is causing pip to select the wheel it is.
The wheel’s METADATA file has the ‘Version: 0.8.4.post20221107’ value.
MTIA for any insights, feedback.
pip output snippet:
Found link https://gitlab.XXXX.stevens.edu:9090/gitlab-ci/devl/%2Bf/8c7/5f31e11f030b3/ioif_core-0.8.4.post20220421181059-py3-none-any.whl#sha256=8c75f31e11f030b3f4f3141485ceec166afdadb4b430376f6bc4d8fb622fd8d9 (from https://gitlab.XXXXX.stevens.edu:9090/gitlab-ci/devl/+simple/ioif-core/) (requires-python:>=3.7), version: 0.8.4.post20220421181059
[... older version links deleted from this listing ]
Skipping link: not a file: https://gitlab.XXXXX.stevens.edu:9090/gitlab-ci/devl/ioif-core/
Found link file:///home/steve/Documents/project01/GitRepos/ioif/ioif-core/dist/ioif_core-0.8.4.post20221107-py3-none-any.whl, version: 0.8.4.post20221107
Local files found: /home/steve/Documents/project01/GitRepos/ioif/ioif-core/dist/ioif_core-0.8.4.post20221107-py3-none-any.whl
Given no hashes to check 65 links for project 'ioif-core': discarding no candidates
Collecting ioif-core
Created temporary directory: /tmp/pip-unpack-ei2_nd7p
Found index url https://gitlab.XXXXX.stevens.edu:9090/gitlab-ci/devl
Looking up "https://gitlab.XXXXX.stevens.edu:9090/gitlab-ci/devl/%2Bf/8c7/5f31e11f030b3/ioif_core-0.8.4.post20220421181059-py3-none-any.whl" in the cache
Current age based on date: 73658
Freshness lifetime from max-age: 315360000
The response is "fresh", returning cached response
315360000 > 73658
Using cached https://gitlab.XXXXX.stevens.edu:9090/gitlab-ci/devl/%2Bf/8c7/5f31e11f030b3/ioif_core-0.8.4.post20220421181059-py3-none-any.whl (452 kB)
Added ioif-core from https://gitlab.XXXXX.stevens.edu:9090/gitlab-ci/devl/%2Bf/8c7/5f31e11f030b3/ioif_core-0.8.4.post20220421181059-py3-none-any.whl#sha256=8c75f31e11f030b3f4f3141485ceec166afdadb4b430376f6bc4d8fb622fd8d9 to build tracker '/tmp/pip-req-tracker-gv4rtrhy'
Removed ioif-core from https://gitlab.XXXX.stevens.edu:9090/gitlab-ci/devl/%2Bf/8c7/5f31e11f030b3/ioif_core-0.8.4.post20220421181059-py3-none-any.whl#sha256=8c75f31e11f030b3f4f3141485ceec166afdadb4b430376f6bc4d8fb622fd8d9 from build tracker '/tmp/pip-req-tracker-gv4rtrhy'
Requirement already satisfied: Owlready2>=0.33 in ./.tox/py38-bash/lib/python3.8/site-packages (from ioif-core) (0.35)
Requirement already satisfied: pytz in ./.tox/py38-bash/lib/python3.8/site-packages (from ioif-core) (2022.6)
Requirement already satisfied: pandas in ./.tox/py38-bash/lib/python3.8/site-packages (from ioif-core) (1.5.1)
Requirement already satisfied: urllib3>=1.24.1 in ./.tox/py38-bash/lib/python3.8/site-packages (from ioif-core) (1.26.12)
Requirement already satisfied: numpy in ./.tox/py38-bash/lib/python3.8/site-packages (from ioif-core) (1.23.4)
Requirement already satisfied: python-dateutil>=2.6.0 in ./.tox/py38-bash/lib/python3.8/site-packages (from ioif-core) (2.8.2)
Requirement already satisfied: six>=1.5 in ./.tox/py38-bash/lib/python3.8/site-packages (from python-dateutil>=2.6.0->ioif-core) (1.16.0)
Created temporary directory: /tmp/pip-unpack-tet0a3is
Installing collected packages: ioif-core
Successfully installed ioif-core-0.8.4.post20220421181059
WARNING: You are using pip version 22.0.4; however, version 22.3.1 is available.
NOTE: the wheel is built using
python ./setup.py egg_info --tag-build=post$(date +%Y%m%d%H%M%S) bdist_wheel
to give finer time granularity (so the newest is actually selected).
The presence of the Local files found: indicates to me that the code at line 852 in _internal/index/package_finder.py has identified the indicated wheel files and that it ought to be in the returned list prior to those qualifying pages (non-file URLs). So the question I need to chase down is why the local file isn’t used rather than the older index URL.