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

`pip-compile requirements.in` produces a different output than the pre-commit hook.

Open PawelPawlikMIM opened this issue 1 year ago • 6 comments

In version 7.3.0 pip-compile requirements.in produces a different output than the pre-commit hook. The is no issue after downgrading to 7.2.0.

Environment Versions

  1. OS Type: Ubuntu 20.04.3 LTS
  2. Python version: Python 3.9.5
  3. pip version: pip 23.3
  4. pip-tools version: 7.3.0

Steps to replicate

  1. requirements.in content:
selenium==4.14.0
  1. .pre-commit-config.yaml content:
repos:
  - repo: https://github.com/jazzband/pip-tools
    rev: 7.3.0
    hooks:
      - id: pip-compile
        files: ^requirements\.(in|txt)$
        args: [requirements.in]
  1. commit requirements.in file
  2. run pip-compile requirements.in

Expected result

requirements.txt should remain unchanged when running the 4th step.

Actual result

requirements.txt differs. diff output:

 urllib3[socks]==1.26.16
-    # via selenium
+    # via
+    #   selenium
+    #   urllib3
 wsproto==1.2.0

PawelPawlikMIM avatar Dec 13 '23 16:12 PawelPawlikMIM

Thanks!

This may be a dup of #2003 and fixed by #2011, which is merged but not yet in a release.

AndydeCleyre avatar Dec 13 '23 17:12 AndydeCleyre

Hi, thanks for the great work! I am also awaiting the release with #2011 included.

MartinRoth avatar Dec 22 '23 09:12 MartinRoth

Same issue here

jonesbusy avatar Jan 29 '24 05:01 jonesbusy

For me it works again with the newest pip...

MartinRoth avatar Jan 29 '24 07:01 MartinRoth

If I rollback to pip 23.2.1 everything is back to normal

At the end I'm not sure what should be fixed where (pip ? pip-tool ?)

I tried to play with --strip-extras, but I always end-up with compatibility issue between precommit, pip-compile and renovate tooling

jonesbusy avatar Jan 30 '24 06:01 jonesbusy

If I rollback to pip 23.2.1 everything is back to normal

At the end I'm not sure what should be fixed where (pip ? pip-tool ?)

I tried to play with --strip-extras, but I always end-up with compatibility issue between precommit, pip-compile and renovate tooling

I am using pip==23.3.2 and pip-tools==7.3.0 and it works as well. However, I feel your confusion.

MartinRoth avatar Jan 30 '24 08:01 MartinRoth

Since the upgrade to pip==24.0.0 I have this issue again 😒

MartinRoth avatar Feb 20 '24 12:02 MartinRoth

@MartinRoth Do you have the issue with pip-tools >= 7.4.0?

AndydeCleyre avatar Feb 26 '24 17:02 AndydeCleyre

Hi @AndydeCleyre, currently I am using pip-tools==7.4.0 and pip==24.0 and it seems to work again.

MartinRoth avatar Feb 27 '24 14:02 MartinRoth

Thanks! Considering this resolved, then.

webknjaz avatar Feb 28 '24 02:02 webknjaz

I confirm also with latest using pip-tools 7.4.0, pip 24.0 and latest renovate 37.218.0 I don't see anymore any compatiblity issue. Thanks!

jonesbusy avatar Feb 28 '24 03:02 jonesbusy