Skip to content
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

pip-sync 7.0.0 reinstalls packages due to case difference #1918

Closed
sshishov opened this issue Jul 17, 2023 · 3 comments · Fixed by #1919
Closed

pip-sync 7.0.0 reinstalls packages due to case difference #1918

sshishov opened this issue Jul 17, 2023 · 3 comments · Fixed by #1919
Labels
bug Something is not working

Comments

@sshishov
Copy link

sshishov commented Jul 17, 2023

Description

pip-sync 7.0.0 reinstalls all packages which have non-lowercase letters in their names

For instance in *.in and *.txt files we have the following data:

django

and

django==4.2.0
  ...

When we run pip sync, it will uninstall and install django because in pip-freeze the same package mentioned as Django

Environment Versions

Required Information
OS Type MacOs/Linux
Python version: $ python -V Python 3.11.4
pip version: $ pip --version: pip 23.2 from /home/user/venv/lib/python3.11/site-packages/pip (python 3.11)
pip-tools version: $ pip-compile --version pip-compile, version 7.0.0

Steps to replicate

  1. Create *.in file with django requirement
  2. Compile requirements to generate *.txt file
  3. Run pip-sync on the txt file
  4. Run pip-sync on the txt file again

Expected result

The output should be Everything up-to-date

Actual result

The requirement is reinstalled every time you run pip-sync

@sshishov sshishov changed the title pip-tools reinstalls packages due to case difference pip-sync 7.0.0 reinstalls packages due to case difference Jul 17, 2023
@atugushev
Copy link
Member

Thanks for the issue! See #1917 (comment) for details.

@atugushev atugushev added the bug Something is not working label Jul 17, 2023
@atugushev
Copy link
Member

@sshishov could you test this fix #1919? Does it resolve the issue?

pip install git+https://github.com/atugushev/pip-tools@fix-broken-sync-diff

@sshishov
Copy link
Author

sshishov commented Jul 20, 2023

@atugushev going to test it now, sorry for the long reply.

As we are using pip-tools in our dependencies, the pip-tools is also pinned... but what I did is:

(venv) user@40264cddaa4a:~/app/src$ pip install git+https://github.com/atugushev/pip-tools@fix-broken-sync-diff
Collecting git+https://github.com/atugushev/pip-tools@fix-broken-sync-diff
  Cloning https://github.com/atugushev/pip-tools (to revision fix-broken-sync-diff) to /tmp/pip-req-build-dabswewr
  Running command git clone --filter=blob:none --quiet https://github.com/atugushev/pip-tools /tmp/pip-req-build-dabswewr
  Running command git checkout -b fix-broken-sync-diff --track origin/fix-broken-sync-diff
  Switched to a new branch 'fix-broken-sync-diff'
  branch 'fix-broken-sync-diff' set up to track 'origin/fix-broken-sync-diff'.
  Resolved https://github.com/atugushev/pip-tools to commit 99133cb0ee267e465322a9e33784a22790cf0fe0
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: build in /home/user/venv/lib/python3.11/site-packages (from pip-tools==3.2.1.dev1041) (0.10.0)
Requirement already satisfied: click>=8 in /home/user/venv/lib/python3.11/site-packages (from pip-tools==3.2.1.dev1041) (8.1.5)
Requirement already satisfied: pip>=22.2 in /home/user/venv/lib/python3.11/site-packages (from pip-tools==3.2.1.dev1041) (23.2)
Requirement already satisfied: setuptools in /home/user/venv/lib/python3.11/site-packages (from pip-tools==3.2.1.dev1041) (68.0.0)
Requirement already satisfied: wheel in /home/user/venv/lib/python3.11/site-packages (from pip-tools==3.2.1.dev1041) (0.40.0)
Requirement already satisfied: packaging>=19.0 in /home/user/venv/lib/python3.11/site-packages (from build->pip-tools==3.2.1.dev1041) (23.1)
Requirement already satisfied: pyproject_hooks in /home/user/venv/lib/python3.11/site-packages (from build->pip-tools==3.2.1.dev1041) (1.0.0)
Building wheels for collected packages: pip-tools
  Building wheel for pip-tools (pyproject.toml) ... done
  Created wheel for pip-tools: filename=pip_tools-3.2.1.dev1041-py3-none-any.whl size=57051 sha256=50e52c33b361356f14cb68263d7649321c970b597b5dad863d05d0f4d2f8bab6
  Stored in directory: /tmp/pip-ephem-wheel-cache-636qm7fx/wheels/e1/fc/e8/a3b48ef2401bf486e4152d892655942a3c2d906d34963f2485
Successfully built pip-tools
Installing collected packages: pip-tools
  Attempting uninstall: pip-tools
    Found existing installation: pip-tools 7.0.0
    Uninstalling pip-tools-7.0.0:
      Successfully uninstalled pip-tools-7.0.0
Successfully installed pip-tools-3.2.1.dev1041
-------------------------------------------------------------------------
(venv) user@40264cddaa4a:~/app/src$ make sync-requirements
cd ../ && pip-sync --pip-args "--no-deps" requirements/*.txt
Collecting pip-tools==7.0.0 (from -r /tmp/tmp8bgdgi03 (line 1))
  Using cached pip_tools-7.0.0-py3-none-any.whl (56 kB)
Installing collected packages: pip-tools
  Attempting uninstall: pip-tools
    Found existing installation: pip-tools 3.2.1.dev1041
    Uninstalling pip-tools-3.2.1.dev1041:
      Successfully uninstalled pip-tools-3.2.1.dev1041
Successfully installed pip-tools-7.0.0
(venv) user@40264cddaa4a:~/app/src$

It seems it is working as expected 👍 . Just the version of pip-tools in your tag looks strange: 3.2.1.dev...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants