I'm looking into this Python project template. They use poetry
to define dev dependencies
[tool.poetry.dev-dependencies]
black = {version = "*", allow-prereleases = true}
flake8 = "*"
isort = "^5.6"
mypy = ">0.900,<1"
...
They use also pre-commit
to check housekeeping things (e.g., formatting, linting, issorting, ...), both for git and for CI workflows:
minimum_pre_commit_version: 2.8.0
default_stages: [commit, push, manual]
repos:
- repo: https://github.com/psf/black
rev: 21.11b1
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
args: [--max-line-length=88]
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
args: [--filter-files]
- ...
In my case, I definitely want a local version of dev packages managed by poetry for my IDE, and I'd like also to harness the pre-commit framework "as is", without switching to language: system
. Working this way, I need to manage each package version in two different places.
Is there a non-manual way to keep dev packages versions (i.e,. black
, flake8
, isort
, mypy
, ...) aligned to a single source of truth? A Coockiecutter template could be an option, but it looks overkilling.
poetry.lock
so you'd need some code to synchronize the two – Cronus