pre-commit-ci / issues

public issues for https://pre-commit.ci
17 stars 4 forks source link

Deprecation of types-pkg-resources causes pre-commit to fail in pre-commit/action@v3.0.1 #226

Closed ValentinRauschenbachDH closed 3 months ago

ValentinRauschenbachDH commented 3 months ago

Recently our CI started to fail on pre-commit action, outputting:


[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/pycqa/isort.
[INFO] Initializing environment for https://github.com/ambv/black.
[INFO] Initializing environment for https://github.com/PyCQA/flake8.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-mypy.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-mypy:types-all.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pycqa/isort.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/ambv/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/PyCQA/flake8.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/mirrors-mypy.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/home/runner/.cache/pre-commit/repozoeapeio/py_env-python3.11/bin/python', '-mpip', 'install', '.', 'types-all')
return code: 1
stdout:
    Processing /home/runner/.cache/pre-commit/repozoeapeio
      Preparing metadata (setup.py): started
      Preparing metadata (setup.py): finished with status 'done'
    Collecting types-all
      Downloading types_all-1.0.0-py2.py3-none-any.whl.metadata (4.1 kB)
    Collecting mypy==0.981 (from pre_commit_placeholder_package==0.0.0)
      Downloading mypy-0.981-py3-none-any.whl.metadata (1.8 kB)
    Collecting typing-extensions>=3.10 (from mypy==0.981->pre_commit_placeholder_package==0.0.0)
      Downloading typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB)
    Collecting mypy-extensions>=0.4.3 (from mypy==0.981->pre_commit_placeholder_package==0.0.0)
      Using cached mypy_extensions-1.0.0-py3-none-any.whl.metadata (1.1 kB)
    Collecting types-DateTimeRange (from types-all)
      Downloading types_DateTimeRange-2.0.0.6-py3-none-any.whl.metadata (1.6 kB)
    Collecting types-Deprecated (from types-all)
      Downloading types_Deprecated-1.2.9.20240311-py3-none-any.whl.metadata (1.6 kB)
    Collecting types-Flask (from types-all)
      Downloading types_Flask-1.1.6-py3-none-any.whl.metadata (1.1 kB)
    Collecting types-JACK-Client (from types-all)
      Downloading types_JACK_Client-0.5.10.20240425-py3-none-any.whl.metadata (1.7 kB)
    Collecting types-Jinja2 (from types-all)
      Downloading types_Jinja2-2.11.9-py3-none-any.whl.metadata (1.1 kB)
    Collecting types-Markdown (from types-all)
      Downloading types_Markdown-3.6.0.20240316-py3-none-any.whl.metadata (1.8 kB)
    Collecting types-MarkupSafe (from types-all)
      Downloading types_MarkupSafe-1.1.10-py3-none-any.whl.metadata (1.1 kB)
    Collecting types-Pillow (from types-all)
      Downloading types_Pillow-10.2.0.20240520-py3-none-any.whl.metadata (1.7 kB)
    Collecting types-PyJWT (from types-all)
      Downloading types_PyJWT-1.7.1-py2.py3-none-any.whl.metadata (1.1 kB)
    Collecting types-PyMySQL (from types-all)
      Downloading types_PyMySQL-1.1.0.20240524-py3-none-any.whl.metadata (1.8 kB)
    Collecting types-PyYAML (from types-all)
      Downloading types_PyYAML-6.0.12.20240808-py3-none-any.whl.metadata (1.6 kB)
    Collecting types-Routes (from types-all)
      Downloading types_Routes-2.5.0-py3-none-any.whl.metadata (848 bytes)
    Collecting types-Werkzeug (from types-all)
      Downloading types_Werkzeug-1.0.9-py3-none-any.whl.metadata (1.0 kB)
    Collecting types-aiofiles (from types-all)
      Downloading types_aiofiles-24.1.0.20240626-py3-none-any.whl.metadata (1.6 kB)
    Collecting types-annoy (from types-all)
      Downloading types_annoy-1.17.8.4-py3-none-any.whl.metadata (1.5 kB)
    Collecting types-atomicwrites (from types-all)
      Downloading types_atomicwrites-1.4.5.1-py3-none-any.whl.metadata (1.3 kB)
    Collecting types-backports (from types-all)
      Downloading types_backports-0.1.3-py2.py3-none-any.whl.metadata (878 bytes)
    Collecting types-backports-abc (from types-all)
      Downloading types_backports_abc-0.5.2-py3-none-any.whl.metadata (895 bytes)
    Collecting types-bleach (from types-all)
      Downloading types_bleach-6.1.0.20240331-py3-none-any.whl.metadata (1.6 kB)
    Collecting types-boto (from types-all)
      Downloading types_boto-2.49.18.20240806-py3-none-any.whl.metadata (1.8 kB)
    Collecting types-cachetools (from types-all)
      Downloading types_cachetools-5.4.0.20240717-py3-none-any.whl.metadata (1.7 kB)
    Collecting types-certifi (from types-all)
      Downloading types_certifi-2021.10.8.3-py3-none-any.whl.metadata (1.4 kB)
    Collecting types-characteristic (from types-all)
      Downloading types_characteristic-14.3.7-py3-none-any.whl.metadata (1.3 kB)
    Collecting types-chardet (from types-all)
      Downloading types_chardet-5.0.4.6-py3-none-any.whl.metadata (1.5 kB)
    Collecting types-click (from types-all)
      Downloading types_click-7.1.8-py3-none-any.whl.metadata (1.0 kB)
    Collecting types-click-spinner (from types-all)
      Downloading types_click_spinner-0.1.13.20240311-py3-none-any.whl.metadata (1.6 kB)
    Collecting types-colorama (from types-all)
      Downloading types_colorama-0.4.15.20240311-py3-none-any.whl.metadata (1.6 kB)
    Collecting types-contextvars (from types-all)
      Downloading types_contextvars-2.4.7.3-py3-none-any.whl.metadata (1.5 kB)
    Collecting types-croniter (from types-all)
      Downloading types_croniter-3.0.3.20240731-py3-none-any.whl.metadata (1.7 kB)
    Collecting types-cryptography (from types-all)
      Downloading types_cryptography-3.3.23.2-py3-none-any.whl.metadata (1.4 kB)
    Collecting types-dataclasses (from types-all)
      Downloading types_dataclasses-0.6.6-py3-none-any.whl.metadata (1.3 kB)
    Collecting types-dateparser (from types-all)
      Downloading types_dateparser-1.2.0.20240420-py3-none-any.whl.metadata (1.6 kB)
    Collecting types-decorator (from types-all)
      Downloading types_decorator-5.1.8.20240310-py3-none-any.whl.metadata (1.6 kB)
    Collecting types-docopt (from types-all)
      Downloading types_docopt-0.6.11.4-py3-none-any.whl.metadata (1.4 kB)
    Collecting types-docutils (from types-all)
      Downloading types_docutils-0.21.0.20240724-py3-none-any.whl.metadata (1.9 kB)
    Collecting types-emoji (from types-all)
      Downloading types_emoji-2.1.0.3-py3-none-any.whl.metadata (1.4 kB)
    Collecting types-enum34 (from types-all)
      Downloading types_enum34-1.1.8-py3-none-any.whl.metadata (853 bytes)
    Collecting types-fb303 (from types-all)
      Downloading types_fb303-1.0.0-py3-none-any.whl.metadata (842 bytes)
    Collecting types-filelock (from types-all)
      Downloading types_filelock-3.2.7-py3-none-any.whl.metadata (1.4 kB)
    Collecting types-first (from types-all)
      Downloading types_first-2.0.5.20240806-py3-none-any.whl.metadata (1.6 kB)
    Collecting types-freezegun (from types-all)
      Downloading types_freezegun-1.1.10-py3-none-any.whl.metadata (1.4 kB)
    Collecting types-frozendict (from types-all)
      Downloading types_frozendict-2.0.9-py3-none-any.whl.metadata (1.4 kB)
    Collecting types-futures (from types-all)
      Downloading types_futures-3.3.8-py3-none-any.whl.metadata (859 bytes)
    Collecting types-geoip2 (from types-all)
      Downloading types_geoip2-3.0.0-py3-none-any.whl.metadata (1.1 kB)
    Collecting types-ipaddress (from types-all)
      Downloading types_ipaddress-1.0.8-py3-none-any.whl.metadata (1.2 kB)
    Collecting types-itsdangerous (from types-all)
      Downloading types_itsdangerous-1.1.6-py3-none-any.whl.metadata (1.1 kB)
    Collecting types-kazoo (from types-all)
      Downloading types_kazoo-0.1.3-py3-none-any.whl.metadata (854 bytes)
    Collecting types-maxminddb (from types-all)
      Downloading types_maxminddb-1.5.0-py3-none-any.whl.metadata (1.1 kB)
    Collecting types-mock (from types-all)
      Downloading types_mock-5.1.0.20240425-py3-none-any.whl.metadata (1.5 kB)
    Collecting types-mypy-extensions (from types-all)
      Downloading types_mypy_extensions-1.0.0.20240311-py3-none-any.whl.metadata (1.6 kB)
    Collecting types-nmap (from types-all)
      Downloading types_nmap-0.1.6-py3-none-any.whl.metadata ([83](https://github.com/deliveryhero/dh-disco-rankp-curated-swimlanes/actions/runs/10372935186/job/28716835030?pr=113#step:5:88)6 bytes)
    Collecting types-openssl-python (from types-all)
      Downloading types_openssl_python-0.1.3-py2.py3-none-any.whl.metadata (942 bytes)
    Collecting types-orjson (from types-all)
      Downloading types_orjson-3.6.2-py3-none-any.whl.metadata (1.0 kB)
    Collecting types-paramiko (from types-all)
      Downloading types_paramiko-3.4.0.20240423-py3-none-any.whl.metadata (1.8 kB)
    Collecting types-pathlib2 (from types-all)
      Downloading types_pathlib2-2.3.0-py3-none-any.whl.metadata ([86](https://github.com/deliveryhero/dh-disco-rankp-curated-swimlanes/actions/runs/10372935186/job/28716835030?pr=113#step:5:91)0 bytes)
    INFO: pip is looking at multiple versions of types-all to determine which version is compatible with other requirements. This could take a while.
stderr:
    ERROR: Ignored the following yanked versions: 0.1.0, 0.1.1, 0.1.2, 0.1.3
    ERROR: Could not find a version that satisfies the requirement types-pkg-resources (from types-all) (from versions: none)
    ERROR: No matching distribution found for types-pkg-resources
Check the log at /home/runner/.cache/pre-commit/pre-commit.log
Error: Process completed with exit code 3.```

After some research, I found that:
* according to [this issue on StackOverflow](https://stackoverflow.com/questions/78833765/no-matching-distribution-found-for-types-pkg-resources), `types-pkg-resources` is deprecated
* corresponding PyPI page [proposes](https://pypi.org/project/types-pkg-resources/) to use `type-setuptools` instead
* there is no newer action version

Could you please help to resolve this or maybe to clarify what needs to be changed to fix this?
asottile commented 3 months ago

this is the issue tracker for https://pre-commit.ci -- can't really help with github actions (though your config also fails locally for me in the same way)