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

pylint pre-commit hook race condition #43

Closed
lkubb opened this issue Nov 15, 2023 · 0 comments · Fixed by #42
Closed

pylint pre-commit hook race condition #43

lkubb opened this issue Nov 15, 2023 · 0 comments · Fixed by #42

Comments

@lkubb
Copy link
Contributor

lkubb commented Nov 15, 2023

pre-commit runs hook invocations for files in parallel. The lint-code-pre-commit and lint-tests-pre-commit sessions install requirements, including the current project. This leads to a race condition where the hook (almost) never actually works without SKIP_REQUIREMENTS_INSTALL=1:

  • error: [Errno 2] No such file or directory: 'build/bdist.linux-x86_64/wheel/saltext/pushover/modules/__init__.py'

  • error: [Errno 13] Permission denied: 'build/bdist.linux-x86_64/wheel/saltext.saltext_namecheap-0.1.dev1+g41c96eb.d20231031-py3.7.egg-info'

  • error: [Errno 2] No such file or directory: 'build/bdist.linux-x86_64/wheel/saltext.saltext_mysql-0.1.dev1+ga006706-py3.8.egg-info'

This can be fixed by

  • not installing the libraries in the nox session and disabling related warnings (which they are already I think)
  • or setting require_serial: true in the hook (and relying on pylint's parallelism via jobs=0)

I will submit the latter fix as part of the compound PR.

Edit: This might be the cause of #17, but I'm not sure since it does not describe the specific error.

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

Successfully merging a pull request may close this issue.

1 participant