jazzband / pip-tools

A set of tools to keep your pinned Python dependencies fresh.
https://pip-tools.rtfd.io
BSD 3-Clause "New" or "Revised" License
7.69k stars 610 forks source link

`pre-commit`'s `pip-compile` differs between github action and local run #1996

Closed ylhan closed 11 months ago

ylhan commented 11 months ago

pre-commit's pip-compile differs between github action and local run.

Environment Versions

  1. OS Type
  2. Python version: Python 3.10.13
  3. pip version: pip 23.2.1
  4. pip-tools version: 7.3.0

Steps to replicate

.pre-commit-config.yaml:

repos:
  - repo: https://github.com/jazzband/pip-tools
    rev: 7.3.0
    hooks:
      - id: pip-compile
        name: pip-compile requirements.in
        args:
          [
            --strip-extras,
            requirements/requirements.in,
          ]
        files: ^.*requirements\.dev\.(in|txt)$

requirements.in:

--constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.6.3/constraints-3.10.txt"

apache-airflow==2.6.3

I am using python 3.10.13 both locally and in GHA

Expected result

GHA should succeed and no diff should be detected.

Actual result

There's an extra dependency greenlet added when run through GHA. image

webknjaz commented 11 months ago

Do you have evidence of using the same Python version in CI? Have you set python-language there?

webknjaz commented 11 months ago

Also, why are you using the .in file as both input and output?

webknjaz commented 11 months ago

Also, I see you only trigger this on some dev file updates. Looks like there's a lot of things you didn't disclose. This needs an actual reproducer for anybody to understand what you're doing.

ylhan commented 11 months ago

I actually figured this out. This is a sqlalchemy quirk https://docs.sqlalchemy.org/en/20/faq/installation.html related to m1s.