pip-tools icon indicating copy to clipboard operation
pip-tools copied to clipboard

pip-sync reinstalls VCS package even it's installed(ssh proto)

Open HemulenKnocks opened this issue 3 years ago • 2 comments

pip-sync reinstalls VCS package even if it's installed(using ssh protocol)

$ cat requirements/cube.txt
...
git+ssh://git@bitbucket.***.***.com:7999/ngc/servitel-simulator.git@de2233307e055f05d191039169fc37a23591ca66
    # via -r requirements/cube.in
...

Environment Versions

  1. OS Type:
$ cat /proc/version
Linux version 5.4.83-v7l+ (dom@buildbot) (gcc version 8.4.0 (Ubuntu/Linaro 8.4.0-3ubuntu1))
  1. Python version:
$ .tox/cube/bin/python -V
Python 3.7.3
  1. pip version:
$ .tox/cube/bin/pip -V
pip 21.1.2 from /home/jenkinsslave/cube-aqa/.tox/cube/lib/python3.7/site-packages/pip (python 3.7)
  1. pip-tools version: pip-tools==6.2.0

Steps to replicate

  1. pip-sync requirements/cube.txt

Actual result

Found existing installation: servitel-simulator 0.1.0
Uninstalling servitel-simulator-0.1.0:
  Successfully uninstalled servitel-simulator-0.1.0
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple, https://www.piwheels.org/simple
Collecting git+ssh://****@bitbucket.***.***.com:7999/ngc/servitel-simulator.git@de2233307e055f05d191039169fc37a23591ca66 (from -r /tmp/tmp7rs5_jz8 (line 1))
  Cloning ssh://****@bitbucket.***.***.com:7999/ngc/servitel-simulator.git (to revision de2233307e055f05d191039169fc37a23591ca66) to /tmp/pip-req-build-055a_idi
  Running command git clone -q 'ssh://****@bitbucket.***.***.com:7999/ngc/servitel-simulator.git' /tmp/pip-req-build-055a_idi
  Running command git rev-parse -q --verify 'sha^de2233307e055f05d191039169fc37a23591ca66'
  Running command git fetch -q 'ssh://****@bitbucket.***.***.com:7999/ngc/servitel-simulator.git' de2233307e055f05d191039169fc37a23591ca66
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: pydantic<2.0.0,>=1.6.1 in ./.tox/cube/lib/python3.7/site-packages (from servitel-simulator==0.1.0->-r /tmp/tmp7rs5_jz8 (line 1)) (1.7.3)
Requirement already satisfied: pyyaml<6.0.0,>=5.3.1 in ./.tox/cube/lib/python3.7/site-packages (from servitel-simulator==0.1.0->-r /tmp/tmp7rs5_jz8 (line 1)) (5.3.1)
Building wheels for collected packages: servitel-simulator
  Building wheel for servitel-simulator (PEP 517) ... done
  Created wheel for servitel-simulator: filename=servitel_simulator-0.1.0-py3-none-any.whl size=11092 sha256=f39e8a23ee70d8a9e3e02fb131f083aae2180e138c91f4dcf1c55e2e92f5d8e6
  Stored in directory: /home/jenkinsslave/.cache/pip/wheels/40/ee/7f/ab881fe8d83de06658dca366c517f4f61d3abfe188373d036b
Successfully built servitel-simulator
Installing collected packages: servitel-simulator
Successfully installed servitel-simulator-0.1.0

HemulenKnocks avatar Jun 22 '21 18:06 HemulenKnocks

I see this too, and perhaps it should be tracked separately, but I'm also seeing pip-sync -n report that it'd uninstall/re-install.

At least the two are consistent :sweat_smile:

joshua-cannon-techlabs avatar Dec 13 '21 16:12 joshua-cannon-techlabs

This code makes it seem like using #egg=name==version would possibly alleviate the issue. It seems to work for me, so try that out!


However if I specify in my requirements.in git+https://github.com/owner/repo@branchname#egg=name==1.0.0, and pip-compile, the requirements.txt strip off the egg and version specifiers.

Might be worth filing a new issue for...

joshua-cannon-techlabs avatar Dec 13 '21 16:12 joshua-cannon-techlabs

I have the same issue, but pip fails with the new backtracking resolver (no hash for the vcs dependency) as pip-tools recommends the MESSAGE_UNHASHED_PACKAGE comment. So using links like https://github.com/jazzband/pip-tools/archive/SOMECOMMIT.zip pip-sync re-installs packages.

q0w avatar Dec 08 '22 12:12 q0w