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 hook stops working after a few days #119

Open
davisagli opened this issue Dec 4, 2024 · 1 comment
Open

pre-commit hook stops working after a few days #119

davisagli opened this issue Dec 4, 2024 · 1 comment
Labels
01 type: bug something does not work

Comments

@davisagli
Copy link
Member

Running make install installs pre-commit hooks, but they stop working later.

This seems to be because of a bad interaction between pipx and pre-commit:

  • pipx run creates a temporary virtualenv in a cache dir which expires after a few days
  • pre-commit creates .git/hooks/pre-commit with INSTALL_PYTHON set to the python that was used to install it
  • in this case that is a pipx cache folder, ~/.local/pipx/.cache/ab0998f0ed2c232/bin/python

I'm not sure how to solve this yet. For the project template we could install pre-commit using the Python in backend/.venv, but that doesn't help for the frontend template.

(Reported in https://community.plone.org/t/pre-commit-not-found-error-when-attempting-to-commit-code-with-cookieplone-based-setup-solved/20192)

@davisagli davisagli added the 01 type: bug something does not work label Dec 4, 2024
@davisagli
Copy link
Member Author

Possible workaround: manually edit .git/hooks/pre-commit and change INSTALL_PYTHON to path/to/repository/backend/.venv/bin/python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
01 type: bug something does not work
Projects
None yet
Development

No branches or pull requests

1 participant