GitXplorerGitXplorer
s

upadup

public
1 stars
1 forks
0 issues

Commits

List of commits on branch main.
Verified
94e0822e0593b225545c571b4188e1c7b3876758

Run flake8 after all code formatters

kkurtmckee committed 7 months ago
Verified
c6adba727f0da4d981ee39aee85dfbeb0547ce30

Run `pre-commit autoupdate; upadup`

kkurtmckee committed 7 months ago
Unverified
4212ca9298d2d020e4e569644080c916b1352417

Update pre-commit config

ssirosen committed a year ago
Unverified
de4da510a9ec9995311f08735a3f3411a010c2c8

Bump version and changelog for release

ssirosen committed 2 years ago
Unverified
22c1fb0a979ee17e10fd873010ebb4a0764be69f

Update changelog and add authors file

ssirosen committed 2 years ago
Verified
152e4f63aff58662afaf6e0c94864baf15822540

Merge pull request #5 from kurtmckee/support-.git-repo-suffixes

ssirosen committed 2 years ago

README

The README file for this repository.

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-implicit-str-concat
          - flake8-logging-format
          - flake8-pyi
          - flake8-typing-as-t
          - flake8-typing-imports

  - repo: https://github.com/adamchainz/blacken-docs
    hooks:
      - id: blacken-docs
        additional_dependencies:
          - black

  # Old hook URLs
  # -------------

  - 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