Repository navigation
Closed
Description
I am trying to use editorconfig-checker.python with pre-commit on Fedora 39 (beta) and I keep getting the error log (/home/aminda/.cache/pre-commit/pre-commit.log) below.
Workaround: when I override pre-commit to use Python3.10 or pypy3 as below, everything works. Using Python 3.11 resulted to the same issue. edit about an hour later: 3.11 seems to work now, maybe I misspelled it earlier in .pre-commit-config.yaml or something.
# .pre-commit-config.yaml
default_language_version:
python: python3.10version information
pre-commit version: 3.4.0
git --version: git version 2.41.0
sys.version:
3.12.0rc3 (main, Sep 19 2023, 00:00:00) [GCC 13.2.1 20230728 (Red Hat 13.2.1-1)]
sys.executable: /usr/bin/python3
os.name: posix
sys.platform: linux
error information
An unexpected error has occurred: CalledProcessError: command: ('/home/aminda/.cache/pre-commit/repo95lw_aku/py_env-python3/bin/python', '-mpip', 'install', '.')
return code: 1
stdout:
Processing /home/aminda/.cache/pre-commit/repo95lw_aku
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: editorconfig-checker
Building wheel for editorconfig-checker (pyproject.toml): started
Building wheel for editorconfig-checker (pyproject.toml): finished with status 'error'
Failed to build editorconfig-checker
stderr:
error: subprocess-exited-with-error
× Building wheel for editorconfig-checker (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [4 lines of output]
running bdist_wheel
running build
running fetch_binaries
error: [Errno 17] File exists: 'build/temp.linux-x86_64-cpython-312'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for editorconfig-checker
ERROR: Could not build wheels for editorconfig-checker, which is required to install pyproject.toml-based projects
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/pre_commit/error_handler.py", line 73, in error_handler
yield
File "/usr/lib/python3.12/site-packages/pre_commit/main.py", line 414, in main
return run(args.config, store, args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pre_commit/commands/run.py", line 442, in run
install_hook_envs(to_install, store)
File "/usr/lib/python3.12/site-packages/pre_commit/repository.py", line 248, in install_hook_envs
_hook_install(hook)
File "/usr/lib/python3.12/site-packages/pre_commit/repository.py", line 95, in _hook_install
lang.install_environment(
File "/usr/lib/python3.12/site-packages/pre_commit/languages/python.py", line 214, in install_environment
lang_base.setup_cmd(prefix, install_cmd)
File "/usr/lib/python3.12/site-packages/pre_commit/lang_base.py", line 86, in setup_cmd
cmd_output_b(*cmd, cwd=prefix.prefix_dir, **kwargs)
File "/usr/lib/python3.12/site-packages/pre_commit/util.py", line 110, in cmd_output_b
raise CalledProcessError(returncode, cmd, stdout_b, stderr_b)
pre_commit.util.CalledProcessError: command: ('/home/aminda/.cache/pre-commit/repo95lw_aku/py_env-python3/bin/python', '-mpip', 'install', '.')
return code: 1
stdout:
Processing /home/aminda/.cache/pre-commit/repo95lw_aku
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: editorconfig-checker
Building wheel for editorconfig-checker (pyproject.toml): started
Building wheel for editorconfig-checker (pyproject.toml): finished with status 'error'
Failed to build editorconfig-checker
stderr:
error: subprocess-exited-with-error
× Building wheel for editorconfig-checker (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [4 lines of output]
running bdist_wheel
running build
running fetch_binaries
error: [Errno 17] File exists: 'build/temp.linux-x86_64-cpython-312'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for editorconfig-checker
ERROR: Could not build wheels for editorconfig-checker, which is required to install pyproject.toml-based projectsMetadata
Metadata
Assignees
Labels
No labels
Activity
[-]Potentially incompatible with Python > 3.10?[/-][+]Potentially incompatible with Python 3.12?[/+]marktsuchida commentedon Sep 26, 2023
I see very similar errors (full logs below) with Python 3.11 on macOS, and #25 (Python 3.11, Linux) also seems to be related. Some details of the errors differ but the main
[Errno 17] File existserror is equivalent.In my hands, the installation always succeeds immediately after clearing the pre-commit cache (
rm -rf ~/.cache/pre-commit).However, after a successful install triggered by
git commit, runningpre-commit runtriggers the error. Conversely, after a successful install triggered bypre-commit run, runninggit committriggers the error.But after running
pre-commit uninstallfollowed bypre-commit installandpre-commit run,git commitwould no longer trigger a rebuild and would succeed. This is a better workaround/fix than clearing the pre-commit cache (if it works; I did not try this without also clearing the cache).So it's possible my git hook was installed by an older version of pre-commit (or at least one that somehow causes cache invalidation). At least in my case, it seems that the issue was caused by the version of pre-commit used to install the git hook and the version used to (directly) run being mismatched.
I use several different hooks across several projects and have only encountered this issue with editorconfig-checker.python, so it does seem specific to how this hook builds. Presumably other hooks do not have an issue being rebuilt within the same pre-commit cache repo.
pre-commit.log from failed 'git commit' following successful 'pre-commit run' after clearing pre-commit cache
version information
error information
pre-commit.log from failed 'pre-commit run' following successful 'git commit' after clearing pre-commit cache
version information
error information
asottile commentedon Sep 28, 2023
this is a derivative work of shellcheck-py and is currently violating the license by not including a copy of it
it's also missing the fix for this problem -- shellcheck-py/shellcheck-py#91
mmicu commentedon Sep 28, 2023
Hi @asottile, thanks for the feedbacks.
I will provide the fixes in a temporary branch soon.
mmicu commentedon Oct 8, 2023
Hi @Mikaela, thanks for reporting the issue. I was able to replicate it locally and the fix suggested by @asottile worked fine.
I'd like to wait for editorconfig-checker/pull/292 before creating an official release.
mstruebing commentedon Oct 10, 2023
@mmicu it's finally there 🎉 : https://github.com/editorconfig-checker/editorconfig-checker/releases/tag/2.7.2
mmicu commentedon Oct 11, 2023
Thank you, @mstruebing.
The new version 2.7.3 is available now.
fix: Bump editorconfig-checker
fix: Bump editorconfig-checker (#105)