Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.2.2 instead.
Reason given by maintainers: Poetry version range was specified incorrectly

Poetry pre-commit Plugin

PyPI

A Poetry plugin for automatically installing git pre-commit hooks whenever pre-commit is specified as a dependency of the project.

Motivation

Personally I find that running pre-commit install every time I start working on a new repository is very easy to forget - there have been numerous occasions where I'd forget this step, commit some changes only to be surprised later on by failing CI checks 😅 This plugin aims to solve this issue by doing this small step for me automatically behind the scenes.

Installation

The plugin requires Poetry version 1.2.0b1 or above. Since this is still a pre-release version, you have to specify it explicitly when installing:

curl -sSL https://install.python-poetry.org | python3.9 - --version 1.2.0b3

Once a valid version of Poetry is set up, you can install the plugin like so:

poetry self add poetry-pre-commit-plugin

For more in-depth information, please refer to Poetry's docs.

Usage

There's no way to use this plugin explicitly - it will work behind the scenes after you run either poetry install or poetry add. In either of those cases, the plugin will check the following conditions:

  1. Is the project inside a git repository?
  2. Is pre-commit listed as a dependency of the project (or, in the case of poetry add - was it just added)?
  3. Has the pre-commit hook not been activated yet (i.e. the file .git/hooks/pre-commit does not exist)?

If all conditions are met, the plugin will run pre-commit install for you.

Download files

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

Source Distribution

poetry_pre_commit_plugin-0.2.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

poetry_pre_commit_plugin-0.2.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

File details

Details for the file poetry_pre_commit_plugin-0.2.0.tar.gz.

File metadata

  • Download URL: poetry_pre_commit_plugin-0.2.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.9.13 Darwin/23.6.0

File hashes

Hashes for poetry_pre_commit_plugin-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cc272653fc88acb7b2bed9df890e8a92d3e002609dbccb71b3b851f014f5fa63
MD5 72f3d5eac0aee9cc6362cd0bb5433abc
BLAKE2b-256 34c9d9799347d995aceb657e0a04f48c54568d720c33ef4b773ed2c5d531a6d7

See more details on using hashes here.

File details

Details for the file poetry_pre_commit_plugin-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for poetry_pre_commit_plugin-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 83e1edaf225da48bb2bd12480668f1e3c734c0ac339f1726ad4cb1b3abfa1b24
MD5 4915cfabd639d51b55e84fb0205f6e15
BLAKE2b-256 4398aa17c98a1d3896da58c27b9c43670d767518a0a5c473055d51c666917dd6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page