-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binary .local/bin/gitlint missing after update from 0.16.0 to 0.17.0 #250
Comments
I can not reproduce this:
|
Also you seem to have it in your
It's the last item there. Can you do |
I'ts only there after installing version 0.16.0, after installing 0.17.0 it's not there.
is the command before the find you quote. I'm not relying on the PATH and instead using the full .local/bin/gitlint path. As you can see after installing 0.17.0 it's not there:
|
So I also tried to reproduce this but couldn't, see shell output below. To @sigmavirus24's point, I don't think it's possible for shell to find any program/command in # Simple Ubuntu 20.04 Box
$> cat -p Vagrantfile
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/focal64"
end
# Bring up VM, ssh into it
$> vagrant up
$> vagrant ssh
# Install and upgrade pip
$> sudo apt-get update && sudo apt-get install -y python3-pip
$> pip install --user -U pip
# Look at ~/.profile, it adds ~/.local/bin to $PATH, ONLY if that directory exists
$> cat ~/.profile
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
# When first logging in, ~/.local/bin didn't exist yet since we hadn't installed anything.
# We have now installed pip, to use it we need to exit+enter the shell or re-source the profile
# to add ~/.local/bin to $PATH
$> source ~/.profile
# Install and run gitlint
$> pip install --user gitlint
$> gitlint --version
gitlint, version 0.17.0
# Note that in order to completely remove the `gitlint` command, you need to uninstall both
# gitlint and gitlint-core
$> pip uninstall gitlint gitlint-core
|
It's unfortunate that you can't reproduce it. It's happening on several "SUSE Linux Enterprise Server 15" (aka SLES15), which is probably not your usual test environment.
I can absolutely guarantee that this is not the issue. I am aware that to execute "gitlint" without a full path ~/.local/bin would have to be on the PATH. But a) I'm only executing "gitlint" WITH the full path and b) ~/.local/bin/gitlint is simply not there, please check the output of my first "find" command (as opposed to the second "find" after installing 0.16.0 where it is there). |
Hmm, ok. I don't have more time right now though, appreciate if you can help getting to a reproducible scenario, maybe on OpenSUSE (preferably using Vagrant). I'm intrigued because we did change how we do packaging in 0.17.0, so it's possible that affects installation for some users. |
Ok, I couldn't resist. I booted an SUSE Linux Enterprise Server 15 SP2 instance on AWS, and still can't reproduce this, see below. ec2-user@ip-172-31-37-40:~> cat /etc/os-release
NAME="SLES"
VERSION="15-SP2"
VERSION_ID="15.2"
PRETTY_NAME="SUSE Linux Enterprise Server 15 SP2"
ID="sles"
ID_LIKE="suse"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:15:sp2"
ec2-user@ip-172-31-37-40:~> sudo zypper install -y python3-pip git
# removed output
ec2-user@ip-172-31-37-40:~> sudo pip3 install -U pip==21.0.1
# removed output
ec2-user@ip-172-31-37-40:~> python3 --version
Python 3.6.12
ec2-user@ip-172-31-37-40:~> pip3 --version
pip 21.0.1 from /home/ec2-user/.local/lib/python3.6/site-packages/pip (python 3.6)
ec2-user@ip-172-31-37-40:~> pip3 install --user gitlint
Collecting gitlint
Downloading gitlint-0.17.0-py2.py3-none-any.whl (2.7 kB)
Collecting gitlint-core[trusted-deps]==0.17.0
Downloading gitlint_core-0.17.0-py2.py3-none-any.whl (64 kB)
|████████████████████████████████| 64 kB 6.1 MB/s
Collecting sh>=1.13.0
Downloading sh-1.14.2-py2.py3-none-any.whl (40 kB)
|████████████████████████████████| 40 kB 11.1 MB/s
Collecting Click>=8
Downloading click-8.0.3-py3-none-any.whl (97 kB)
|████████████████████████████████| 97 kB 13.0 MB/s
Collecting arrow>=1
Downloading arrow-1.2.1-py3-none-any.whl (63 kB)
|████████████████████████████████| 63 kB 5.2 MB/s
Collecting typing-extensions
Downloading typing_extensions-4.0.0-py3-none-any.whl (22 kB)
Requirement already satisfied: python-dateutil>=2.7.0 in /usr/lib/python3.6/site-packages (from arrow>=1->gitlint-core[trusted-deps]==0.17.0->gitlint) (2.7.3)
Collecting importlib-metadata
Downloading importlib_metadata-4.8.2-py3-none-any.whl (17 kB)
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.14.0)
Collecting zipp>=0.5
Downloading zipp-3.6.0-py3-none-any.whl (5.3 kB)
Installing collected packages: zipp, typing-extensions, importlib-metadata, sh, Click, arrow, gitlint-core, gitlint
WARNING: The script gitlint is installed in '/home/ec2-user/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed Click-8.0.3 arrow-1.2.1 gitlint-0.17.0 gitlint-core-0.17.0 importlib-metadata-4.8.2 sh-1.14.2 typing-extensions-4.0.0 zipp-3.6.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.
ec2-user@ip-172-31-37-40:~> find .local -name *gitlint*
.local/lib/python3.6/site-packages/gitlint
.local/lib/python3.6/site-packages/gitlint/files/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
.local/bin/gitlint
ec2-user@ip-172-31-37-40:~> .local/bin/gitlint --version
gitlint, version 0.17.0
# ~/.local/bin/gitlint is NOT in $PATH, but we've already established this is not the issue Now I'm really out of time for today :-) Appreciate if you can provide the steps to reproduce. |
@jorisroovers thanks for taking the time to look into it! I will try to report more data. (sidenote: I just had a look at your blog, very nice 👍) |
OK, so I got more data 🙂 The problems appears when upgrading from 0.16.0 to 0.17.0 and does NOT appear when installing 0.17.0 on a clean slate. Since 0.17.0 is not cleanly uninstalled, it also appears when re-installing 0.17.0 . 0.16.0 installs/uninstalls cleanly
0.17.0 does not install/uninstall cleanly
Upgrade from 0.16.0 to 0.17.0 leads to problem
Clean installation of 0.17.0 works
|
So to emphasize:
As a workaround you can uninstall gitlint 0.16.0 and only then install 0.17.0 . If you want to uninstall 0.17.0 you need some manual cleanup:
|
To uninstall 0.17.0 you need to uninstall |
I suspect this is because the |
Thanks for digging into this @omarkohl, this helped. I've been able to reproduce this in a virtualenv on macOS. I am now convinced this is indeed a gitlint installation bug and not specific to any OS or python/pip version. Using the verbose flag on pip As @sigmavirus24 suggested, I also think this happens because we moved the I'm not a pip expert, but I'm guessing pip just uninstalls everything it finds in I think if we were to release For the record, I haven't actually tried this. Appreciate any help getting this confirmed (or new insights :-) ) (.venv) ✘ /tmp python --version
Python 3.10.0
(.venv) /tmp pip --version
pip 21.3.1 from /private/tmp/.venv/lib/python3.10/site-packages/pip (python 3.10)
(.venv) /tmp pip -v install gitlint==0.16.0
Using pip 21.3.1 from /private/tmp/.venv/lib/python3.10/site-packages/pip (python 3.10)
Collecting gitlint==0.16.0
Using cached gitlint-0.16.0-py2.py3-none-any.whl (82 kB)
Collecting Click==8.0.1
Using cached click-8.0.1-py3-none-any.whl (97 kB)
Collecting arrow==1.2.0
Using cached arrow-1.2.0-py3-none-any.whl (62 kB)
Collecting sh==1.14.2
Using cached sh-1.14.2-py2.py3-none-any.whl (40 kB)
Collecting python-dateutil>=2.7.0
Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting six>=1.5
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: six, python-dateutil, sh, Click, arrow, gitlint
changing mode of /private/tmp/.venv/bin/gitlint to 755
Successfully installed Click-8.0.1 arrow-1.2.0 gitlint-0.16.0 python-dateutil-2.8.2 sh-1.14.2 six-1.16.0
(.venv) /tmp gitlint --version
gitlint, version 0.16.0
(.venv) ✘ /tmp find .venv -name '*gitlint*'
.venv/bin/gitlint
.venv/lib/python3.10/site-packages/gitlint-0.16.0.dist-info
.venv/lib/python3.10/site-packages/gitlint
.venv/lib/python3.10/site-packages/gitlint/files/gitlint
.venv/lib/python3.10/site-packages/qa/__pycache__/test_gitlint.cpython-310.pyc
.venv/lib/python3.10/site-packages/qa/test_gitlint.py
(.venv) /tmp pip -v install gitlint==0.17.0
Using pip 21.3.1 from /private/tmp/.venv/lib/python3.10/site-packages/pip (python 3.10)
Collecting gitlint==0.17.0
Using cached gitlint-0.17.0-py2.py3-none-any.whl (2.7 kB)
Collecting gitlint-core[trusted-deps]==0.17.0
Using cached gitlint_core-0.17.0-py2.py3-none-any.whl (64 kB)
Requirement already satisfied: sh>=1.13.0 in ./.venv/lib/python3.10/site-packages (from gitlint-core[trusted-deps]==0.17.0->gitlint==0.17.0) (1.14.2)
Requirement already satisfied: Click>=8 in ./.venv/lib/python3.10/site-packages (from gitlint-core[trusted-deps]==0.17.0->gitlint==0.17.0) (8.0.1)
Requirement already satisfied: arrow>=1 in ./.venv/lib/python3.10/site-packages (from gitlint-core[trusted-deps]==0.17.0->gitlint==0.17.0) (1.2.0)
Collecting Click>=8
Using cached click-8.0.3-py3-none-any.whl (97 kB)
Collecting arrow>=1
Using cached arrow-1.2.1-py3-none-any.whl (63 kB)
Requirement already satisfied: python-dateutil>=2.7.0 in ./.venv/lib/python3.10/site-packages (from arrow>=1->gitlint-core[trusted-deps]==0.17.0->gitlint==0.17.0) (2.8.2)
Requirement already satisfied: six>=1.5 in ./.venv/lib/python3.10/site-packages (from python-dateutil>=2.7.0->arrow>=1->gitlint-core[trusted-deps]==0.17.0->gitlint==0.17.0) (1.16.0)
Installing collected packages: Click, arrow, gitlint-core, gitlint
Attempting uninstall: Click
Found existing installation: click 8.0.1
Uninstalling click-8.0.1:
Removing file or directory /private/tmp/.venv/lib/python3.10/site-packages/click-8.0.1.dist-info/
Removing file or directory /private/tmp/.venv/lib/python3.10/site-packages/click/
Successfully uninstalled click-8.0.1
Attempting uninstall: arrow
Found existing installation: arrow 1.2.0
Uninstalling arrow-1.2.0:
Removing file or directory /private/tmp/.venv/lib/python3.10/site-packages/arrow-1.2.0.dist-info/
Removing file or directory /private/tmp/.venv/lib/python3.10/site-packages/arrow/
Successfully uninstalled arrow-1.2.0
changing mode of /private/tmp/.venv/bin/gitlint to 755
Attempting uninstall: gitlint
Found existing installation: gitlint 0.16.0
Uninstalling gitlint-0.16.0:
Removing file or directory /private/tmp/.venv/bin/gitlint
Removing file or directory /private/tmp/.venv/lib/python3.10/site-packages/gitlint-0.16.0.dist-info/
Removing file or directory /private/tmp/.venv/lib/python3.10/site-packages/gitlint/
Removing file or directory /private/tmp/.venv/lib/python3.10/site-packages/qa/
Successfully uninstalled gitlint-0.16.0
Successfully installed Click-8.0.3 arrow-1.2.1 gitlint-0.17.0 gitlint-core-0.17.0
(.venv) /tmp gitlint --version
pyenv: gitlint: command not found
(.venv) ✘ /tmp find .venv -name '*gitlint*'
.venv/lib/python3.10/site-packages/gitlint_core-0.17.0.dist-info
.venv/lib/python3.10/site-packages/gitlint-0.17.0.dist-info |
On the uninstall: I think we've all mentioned that |
This may require extra development documentation due to jorisroovers/gitlint#250, which applies for upgrades.
This may require extra development documentation due to jorisroovers/gitlint#250, which applies for upgrades.
@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 TL;DR this is a limitation of pip that is described at pypa/pip#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). When you have |
@webknjaz thanks for providing that extra context here, that's insightful! At this point, I think we should close this particular issue as the root cause and workaround is known, this probably only affects a (very) small fraction of our users and we can't really solve this on our end. To summarize:
|
More precisely, it should be
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. |
Sounds good - I'll keep this issue open then as a reminder to document this. I think we probably want a net new page for this in the docs ( Happy to take a PR :) |
After 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 ...
... no executable to be found
After installing 0.16.0 ...
... everything is fine
The text was updated successfully, but these errors were encountered: