question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: are you open to have pre-commit fetch the rev from poetry.lock?

See original GitHub issue

Hi @asottile !

I’m trying to get pre-commit to fly alongside poetry at work. I’d love to avoid manually keeping the rev in the .pre-commit-config.yml file in sync with whatever is in poetry’s poetry.lock file. I’m thinking instead have pre-commit somehow read the package version from the poetry.lock file.

I take it this is not possible today (?) and I was wondering if you are open to this idea. If so, I could help see if maybe I can implement that.

Perhaps the rev could be fetched from an arbitrary file (such as poetry.lock, Pipfile.lock, requirements.txt and so on). And using e.g. regex the rev could be extracted from that file and used by pre-commit.

Let me know what you think. Anyway, thanks for all your great work, as always! 😃

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
asottilecommented, Nov 18, 2021

but you can write a hook which does what you want

1reaction
asottilecommented, Nov 18, 2021

I am not

Read more comments on GitHub >

github_iconTop Results From Across the Web

pre-commit hooks | master | Documentation - Poetry
The poetry-lock hook calls the poetry lock command to make sure the lock file is up-to-date when committing changes. Arguments #. The hook...
Read more >
pre-commit
We built pre-commit to solve our hook issues. It is a multi-language package manager for pre-commit hooks. You specify a list of hooks...
Read more >
How to have a single source of truth for poetry and pre-commit ...
This hook just keeps in sync the repos rev in .pre-commit-config.yaml with the packages version locked into poetry.lock . If you use:.
Read more >
Python with Poetry and pre-commit hooks - Object Partners
Use Poetry and pre-commit hooks to maintain a clean codebase and consistent Python development environment for allmembers of your team.
Read more >
User Guide — Hypermodern Python Cookiecutter ...
Install Poetry by downloading and running get-poetry.py: ... When you have answered these questions, your project is generated in the current directory, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found