Skip to main content

PDM plugin to sync your pre-commit versions with your lockfile.

Project description

sync-pre-commit-lock

Tests pypi version License Python version pre-commit.ci status pdm-managed Ruff Code style: black

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sync_pre_commit_lock-0.1.0.tar.gz (44.5 kB view hashes)

Uploaded Source

Built Distribution

sync_pre_commit_lock-0.1.0-py3-none-any.whl (37.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page