Binary .local/bin/gitlint missing after update from 0.16.0 to 0.17.0
See original GitHub issueAfter upgrading to the latest release 0.17.0 the executable is gone. Uninstalling and installing again does not help. When installing 0.16.0 all is fine.
After installing 0.17.0 …
$ pip3 install --user -U gitlint
Collecting gitlint
Using cached gitlint-0.17.0-py2.py3-none-any.whl (2.7 kB)
Requirement already satisfied: gitlint-core[trusted-deps]==0.17.0 in ./.local/lib/python3.6/site-packages (from gitlint) (0.17.0)
Requirement already satisfied: arrow>=1 in ./.local/lib/python3.6/site-packages (from gitlint-core[trusted-deps]==0.17.0->gitlint) (1.2.1)
Requirement already satisfied: Click>=8 in ./.local/lib/python3.6/site-packages (from gitlint-core[trusted-deps]==0.17.0->gitlint) (8.0.3)
Requirement already satisfied: sh>=1.13.0 in ./.local/lib/python3.6/site-packages (from gitlint-core[trusted-deps]==0.17.0->gitlint) (1.14.2)
Requirement already satisfied: python-dateutil>=2.7.0 in ./.local/lib/python3.6/site-packages (from arrow>=1->gitlint-core[trusted-deps]==0.17.0->gitlint) (2.8.0)
Requirement already satisfied: typing-extensions in ./.local/lib/python3.6/site-packages (from arrow>=1->gitlint-core[trusted-deps]==0.17.0->gitlint) (3.7.4.3)
Requirement already satisfied: importlib-metadata in ./.local/lib/python3.6/site-packages (from Click>=8->gitlint-core[trusted-deps]==0.17.0->gitlint) (4.8.1)
Requirement already satisfied: six>=1.5 in /usr/lib/python3.6/site-packages (from python-dateutil>=2.7.0->arrow>=1->gitlint-core[trusted-deps]==0.17.0->gitlint) (1.11.0)
Requirement already satisfied: zipp>=0.5 in ./.local/lib/python3.6/site-packages (from importlib-metadata->Click>=8->gitlint-core[trusted-deps]==0.17.0->gitlint) (3.6.0)
Installing collected packages: gitlint
Successfully installed gitlint-0.17.0
WARNING: You are using pip version 21.0.1; however, version 21.3.1 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
… no executable to be found
$ find .local -name *gitlint*
.local/lib/python3.6/site-packages/gitlint_core-0.17.0.dist-info
.local/lib/python3.6/site-packages/gitlint-0.17.0.dist-info
After installing 0.16.0 …
$ pip3 install --user -U gitlint==0.16.0
...
… everything is fine
$ find .local -name *gitlint*
.local/lib/python3.6/site-packages/gitlint_core-0.17.0.dist-info
.local/lib/python3.6/site-packages/gitlint
.local/lib/python3.6/site-packages/gitlint/files/gitlint
.local/lib/python3.6/site-packages/qa/test_gitlint.py
.local/lib/python3.6/site-packages/qa/__pycache__/test_gitlint.cpython-36.pyc
.local/lib/python3.6/site-packages/gitlint-0.16.0.dist-info
.local/bin/gitlint
$ pip3 --version
pip 21.0.1 from /usr/lib/python3.6/site-packages/pip (python 3.6)
Issue Analytics
- State:
- Created 2 years ago
- Comments:18 (9 by maintainers)
Top Results From Across the Web
Can someone explain why pip versions are limited to 0.16.0 ...
This is probably a dumb question but I want to update the manim version I'm using to 0.17.1 if I type this into...
Read more >Service Update 0.17 for Microsoft Dynamics 365 9.0
Overlapping page elements were present while viewing Account entities. The "Convert to Lead" option was missing for new emails in the Unified Interface...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
More precisely, it should be
pip uninstall gitlint gitlint-core; pip install gitlint
which would also take care of a semi-broken install.At Ansible, we’ve opted for documenting this in the FAQ: https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_4.html#other / https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_2.10.html#known-issues. Maybe,
gitlint
could do the same? Probably, we could change the issue label todocs
at this point.@jorisroovers I wish I saw this issue earlier. I know exactly what happens. We’ve seen this when we were splitting the project under ansible/ansible that was previously published as just
ansible
on PyPI but got renamed toansible-base
, and thenansible-core
. Theansible
distribution is also published but with different contents.TL;DR this is a limitation of pip that is described at https://github.com/pypa/pip/issues/8509.
When you rename a distribution package (the name published on PyPI), but keep that importable package (the folder with Python files that’s installed under site-packages), there are two different packages that provide the same files (or partially the same). There used to be a
gitlint/
directory installed intosite-packages/
ingitlint==0.16.0
. Now, there’s none, but a folder with the same namegitlint/
is shipped as a part ofgitlint-core
which is pulled in bygitlint
. When you do a clean install, pip will resolve the deptree and unpack the dists properly.When you have
gitlint==0.16.0
, there’s alreadysite-packages/gitlint/
on disk. And pip knows about each file belonging to the said package. During the dependency resolution, it knows that it needs to installgitlint==0.17.0
andgitlint-core==0.17.0
but because of one being a dependency of the other, it knows thatgitlint-core
should go in first. So pip goes ahead and unpacks the contents ofgitlint-core
intosite-packages/gitlint/
, overwriting the existing files. At this point, pip knows that the files belong togitlint==0.16.0
and it needs to uninstall it before writing the newer version to disk, it removes these files which got installed fromgitlint-core
because thegitlint==0.16.0
’s metadata still says that they belong to this package. And then, it goes ahead and installsgitlint==0.17.0
. This is how you end up with a broken installation. It is specific to pip upgrades, but not fresh installs. The issue I linked above has a number of suggestions that pip could implement to address this bug (including transactions, similar to other packaging ecosystems), but so far, nobody’s working on that.