pre-commit-ci / issues

public issues for https://pre-commit.ci
16 stars 3 forks source link

pip-compile (only) failing in CI #198

Closed MRigal closed 6 months ago

MRigal commented 6 months ago

Hi all,

My pip-compile pre-commit check works fine locally but fails permanently on pre-commit.ci.

Here is my config (will skip the job for CI in the meantime): https://github.com/technologiestiftung/innovationserhebung/blob/main/.pre-commit-config.yaml#L25

Here is one failed job, the issue is always the same: https://results.pre-commit.ci/run/github/674207122/1702402372.NCAiPpbMSimlcHE4qQbN6A?

Thanks a lot in advance and already for this great tool!

EDIT: for the sake of having it easy to find for others, here is part of the failure output:

pip-compile requirements.in..............................................Failed
- hook id: pip-compile
- exit code: 1

  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7faa6167e690>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/fastapi/
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7faa61189a50>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/fastapi/
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7faa6118a350>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/fastapi/
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7faa6118ab50>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/fastapi/
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7faa6118b4d0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/fastapi/
  ERROR: Cannot install fastapi<1 because these package versions have conflicting dependencies.
Discarding fastapi==0.104.1 (from -r requirements.txt (line 31)) to proceed the resolution
  ERROR: Could not find a version that satisfies the requirement fastapi<1 (from versions: none)
Traceback (most recent call last):
  File "/pc/clone/ALBjEfDNRcCPl7QbN7Ooww/py_env-python3.11/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers.py", line 397, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/pc/clone/ALBjEfDNRcCPl7QbN7Ooww/py_env-python3.11/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers.py", line 174, in _add_to_criteria
    raise RequirementsConflicted(criterion)
pip._vendor.resolvelib.resolvers.RequirementsConflicted: Requirements conflict: SpecifierRequirement('fastapi<1')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/pc/clone/ALBjEfDNRcCPl7QbN7Ooww/py_env-python3.11/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 92, in resolve
    result = self._result = resolver.resolve(
                            ^^^^^^^^^^^^^^^^^
  File "/pc/clone/ALBjEfDNRcCPl7QbN7Ooww/py_env-python3.11/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/pc/clone/ALBjEfDNRcCPl7QbN7Ooww/py_env-python3.11/lib/python3.11/site-packages/pip/_vendor/resolvelib/resolvers.py", line 399, in resolve
    raise ResolutionImpossible(e.criterion.information)
pip._vendor.resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=SpecifierRequirement('fastapi<1'), parent=None)]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/pc/clone/ALBjEfDNRcCPl7QbN7Ooww/py_env-python3.11/bin/pip-compile", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/pc/clone/ALBjEfDNRcCPl7QbN7Ooww/py_env-python3.11/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/pc/clone/ALBjEfDNRcCPl7QbN7Ooww/py_env-python3.11/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/pc/clone/ALBjEfDNRcCPl7QbN7Ooww/py_env-python3.11/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/pc/clone/ALBjEfDNRcCPl7QbN7Ooww/py_env-python3.11/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/pc/clone/ALBjEfDNRcCPl7QbN7Ooww/py_env-python3.11/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/pc/clone/ALBjEfDNRcCPl7QbN7Ooww/py_env-python3.11/lib/python3.11/site-packages/piptools/scripts/compile.py", line 659, in cli
    results = resolver.resolve(max_rounds=max_rounds)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/pc/clone/ALBjEfDNRcCPl7QbN7Ooww/py_env-python3.11/lib/python3.11/site-packages/piptools/resolver.py", line 604, in resolve
    is_resolved = self._do_resolve(
                  ^^^^^^^^^^^^^^^^^
  File "/pc/clone/ALBjEfDNRcCPl7QbN7Ooww/py_env-python3.11/lib/python3.11/site-packages/piptools/resolver.py", line 636, in _do_resolve
    resolver.resolve(
  File "/pc/clone/ALBjEfDNRcCPl7QbN7Ooww/py_env-python3.11/lib/python3.11/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 101, in resolve
    raise error from e
pip._internal.exceptions.DistributionNotFound: No matching distribution found for fastapi<1
asottile commented 6 months ago

please search your error message -- there are several duplicates about this intentional behavior

MRigal commented 6 months ago

Hi @asottile thanks for the reply, but for sure I had searched before, here as well as in the original pre-commit repo, without success. I've searched with following patterns:

I've also searched the web for more infos, on pre-commit.ci as well as on pip-compile side, without success.

I would be happy to document the case better, to find it searchable (thus modifying my original description).

I could unfortunately not find hints for this intentional behavior, any link/reference would be of great help. Or maybe in a nutshell: it should be skipped on CI because there is no network available, right?