PDM plugin to sync your pre-commit versions with your lockfile.
Project description
sync-pre-commit-lock
PDM and Poetry plugin to sync your pre-commit versions with your lockfile and automatically install pre-commit hooks.
Features
- 🔁 Sync pre-commit versions with your lockfile
- ⏩ Run every time you run the lockfile is updated, not as a pre-commit hook
- 🔄 Install pre-commit hooks automatically, no need to run
pre-commit install
manually
Supported versions
- Python 3.10+
- PDM 2.7.4+
- Poetry 1.6.0+ (currently in development)
Installation
For PDM
Install it just like any other PDM plugin:
pdm self add "sync-pre-commit-lock[pdm]""
Optionally, you can also specify the plugin in your project pyproject.toml
, to share it with your team:
[tool.pdm]
plugins = [
"sync-pre-commit-lock[pdm]"
]
We add the extra group
[pdm]
to the plugin name, to make sure version constraints are met.
For Poetry
Install like any other Poetry plugin, but beware that it's still in development!
TODO
- Add tests
- Add "E2E" tests
- Add CI (mypy, testing)
- Add PDM scripts for dev and CI
- Add CD (automated releases)
- Add docs
- Add badges
- Add pre-commit hook to run linting
- Create a more verbose command
- Add support for poetry
- Add support for hatch
- Add support for flit
- Add CLI?
- Expose a pre-commit hook to sync the lockfile
- Support nested params for some repos? Like mypy types
- Support reading DB from python module?
- Support reordering DB inputs (file/global config/python module/cli)
- Test using SSH/file dependencies
- Check ref existence before writing?
- Support multiple hooks repos for the same dependency?
- Normalize the URL trailing slash
- New feature to convert from pre-commit online to local?
Inspiration
This project is inspired by @floatingpurr's sync_with_pdm and sync_with_poetry.
The code to install pre-commit hooks automatically is adapted from @vstrimaitis's poetry-pre-commit-plugin, licensed under GPL-3.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sync_pre_commit_lock-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 834ffce05c1da7f5579439f4f49b214c90183ac4fb969473b3468500e89bd6c1 |
|
MD5 | 0397602815136aebe7136dc6349fb16c |
|
BLAKE2b-256 | 5e9e3e8ec844f9ecfb091b79e70b85691335f702e3174c06b7c18598d1088577 |
Hashes for sync_pre_commit_lock-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3648601b45959b8e906c46bf7ba633c1b87c30a8b9b802b2f1be55351ea422ab |
|
MD5 | 821e7e2535664be84095862197ba6fe1 |
|
BLAKE2b-256 | d66af3d8b042e3cb310c9092c76c32e1a6a4f769fb07ce3a9b7f37c860d778f1 |