Skip to main content

utility for python additional_dependencies updates in pre-commit

Project description

upadup!

upadup -- Utility for Python additional_dependencies Updates in Pre-Commit

Why?

pre-commit is great, and pre-commit autoupdate is also great. However, what's not great is that pre-commit autoupdate cannot update your additional_dependencies lists.

upadup is a supplemental tool which knows how to handle specific common cases.

Usage

upadup will only update additional_dependencies items which are pinned to specific versions, and only for known python hooks and their dependencies.

Simply cd myrepo; upadup!

upadup can also be configured with information about hooks which are unknown to it. More on this below.

Config Loading and Format

If you have hooks outside of the defaults which you want upadup to examine, drop a .upadup.yaml file into your repo to configure which hooks to update.

upadup takes no arguments and automatically reads .upadup.yaml from the current directory if available. Otherwise, it uses its default configuration.

upadup needs to know what hook repos you want it to examine, and within those which dependencies you want it to keep updated. The config format intentionally mirrors your pre-commit config. Specify a list of repos, and in each repo, specify a list of hooks to update. Hooks are a combination of id (the hook ID) and additional_dependencies.

For example:

# .upadup.yaml
repos:
  - repo: https://github.com/pycqa/flake8
    hooks:
      - id: flake8
        additional_dependencies:
          - flake8_bugbear

This configuration would match the following pre-commit config:

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/PyCQA/flake8
    rev: 5.0.4
    hooks:
      - id: flake8
        additional_dependencies:
          - 'flake8-bugbear==22.7.1'

Note that matching is case insensitive for repo names and additional_dependencies, and that we normalize - and _ to match, as pypi.org does. But the overall structure of the config is intended to be a mirror image.

Default Config

The following config is the upadup default. Note that missing dependencies are ignored.

repos:
  - repo: https://github.com/pycqa/flake8
    hooks:
      - id: flake8
        additional_dependencies:
          - flake8-bandit
          - flake8-bugbear
          - flake8-builtins
          - flake8-comprehensions
          - flake8-docstrings
          - flake8-pyi
          - flake8-typing-as-t
          - flake8-typing-imports
  - repo: https://github.com/asottile/blacken-docs
    hooks:
      - id: blacken-docs
        additional_dependencies:
          - black

extends_default

Unless otherwise specified, the default config will be merged with your .upadup.yaml configuration, effectively a union.

You can disable this behavior by setting extends_default: false, as in

extends_default: false
repos:
  - repo: https://github.com/pycqa/flake8
    hooks:
      - id: flake8
        additional_dependencies:
          - flake8-bugbear

The Meaning of "upadup"

Update python additional depenedencies uh... pre-commit!

Unacceptable puns accosting durable urban pachyderms

Unbelievably playful, awesome, deterministic update program

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

upadup-0.0.7.tar.gz (309.2 kB view details)

Uploaded Source

Built Distribution

upadup-0.0.7-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file upadup-0.0.7.tar.gz.

File metadata

  • Download URL: upadup-0.0.7.tar.gz
  • Upload date:
  • Size: 309.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.0

File hashes

Hashes for upadup-0.0.7.tar.gz
Algorithm Hash digest
SHA256 9bd73a5a8a537e7c9059b93be76620cb2e29ea45349d4d9be23c6871fbc100bc
MD5 303283895cda0b92b0726de65ef57201
BLAKE2b-256 9c1b4fe97b6d0bb73a06c051bd2cb8405a271b8b4c341f2a2afdfd3f8034576e

See more details on using hashes here.

Provenance

File details

Details for the file upadup-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: upadup-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.0

File hashes

Hashes for upadup-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d39da18a5d84608116343ee875c4491771d2db508749eae518520fb776f46307
MD5 20297456386893f5b9be774cc07f3cfd
BLAKE2b-256 37c0980c5216a3479f5c5f80f5a28e1c3aecba184b521959b0ed9a7f8abab834

See more details on using hashes here.

Provenance

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