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-update instead of no auto-update at all #9714

Closed
voxify-dev opened this issue Sep 26, 2024 · 4 comments · Fixed by #9716
Closed

pre-commit-update instead of no auto-update at all #9714

voxify-dev opened this issue Sep 26, 2024 · 4 comments · Fixed by #9716
Labels
area/docs Documentation issues/improvements kind/enhancement Not a bug or feature, but improves usability or performance

Comments

@voxify-dev
Copy link
Contributor

voxify-dev commented Sep 26, 2024

Issue Kind

Change in current behaviour

Description

As per this issue and docs, it is obvious that we can't use pre-commit autoupdate feature with poetry - but that means manual update every time we want the newest (stable) version of the repo.

Impact

As per description, the impact is very clear - pre-commit config that is not manually updated/revisited will get outdated sooner or later...

Workarounds

I came across a blog post that mentioned this with an alternative solution:

You may notice, I’m also using the third party pre-commit-update tool, since I find it works better than the built in pre-commit autoupdate command. Poetry in particular conflicts with this built-in command.

So I checked out pre-commit-update and it works perfectly for our use case. It is very configurable and you can even use it as a pre-commit hook itself.

Minimal example would be:

repos:
-   repo: https://gitlab.com/vojko.pribudic.foss/pre-commit-update
    rev: v0.5.1post1
    hooks:
    -   id: pre-commit-update
-   repo: https://github.com/python-poetry/poetry
    rev: 1.8.0  # add version here
    hooks:
    -   id: poetry-check
    -   id: poetry-lock
    -   id: poetry-export
    -   id: poetry-install

Which - on commit - would produce:

✘ poetry - 1.8.0 -> 1.8.3
Changes detected and applied

You can even do all sorts of other things - such as excluding the repo, pin it to a certain tag, use unstable versions - etc.

So my proposal would be to perhaps offer that as an alternative in the docs :)

@voxify-dev voxify-dev added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Sep 26, 2024
@Secrus
Copy link
Member

Secrus commented Sep 26, 2024

Contributions are welcome.

@Secrus Secrus added area/docs Documentation issues/improvements kind/enhancement Not a bug or feature, but improves usability or performance and removed kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Sep 26, 2024
@voxify-dev
Copy link
Contributor Author

@Secrus thank you for the fast reply, did not expect and answer this quick :)
Do you want me to raise a PR regarding this or you had something else in mind?
Thanks!

@Secrus
Copy link
Member

Secrus commented Sep 26, 2024

@voxify-dev the fastest way to see docs changes is to submit a PR, so if you are up for it, just make one.

Copy link

github-actions bot commented Nov 7, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/docs Documentation issues/improvements kind/enhancement Not a bug or feature, but improves usability or performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants