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

Pre-commit broken on Python 3.12 #215

Open
sjev opened this issue May 6, 2024 · 1 comment
Open

Pre-commit broken on Python 3.12 #215

sjev opened this issue May 6, 2024 · 1 comment

Comments

@sjev
Copy link
Contributor

sjev commented May 6, 2024

  • Platform/operating system: docker, python:3-slim

  • Python version (run python -version or python3 -version): 3.12.2

  • Problem: pre-commit run --all-files crashes. (log below)

  • How to reproduce:

  1. checkout main
  2. open it in docker container:

docker run -it --rm -v "$(pwd)":/workspace -w /workspace python:latest bash

  1. run these:
git config --global --add safe.directory /workspace
pip install pre-commit
pre-commit run --all-files

error log (relevant part)

 File "/tmp/pip-build-env-l7g3nkvd/overlay/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2191, in <module>
              register_finder(pkgutil.ImpImporter, find_on_path)
                              ^^^^^^^^^^^^^^^^^^^
          AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
          [end of output]
@sjev sjev changed the title Pre-commit broken on Python 3.12.3 Pre-commit broken on Python 3.12 May 6, 2024
@icfly2
Copy link

icfly2 commented Jun 12, 2024

You need to run this first:

open-mmlab/mim#242 (comment)

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

No branches or pull requests

2 participants