Skip to main content

Update the additional dependencies of mypy pre-commit hook from uv.lock

Project description

Update mypy pre-commit hook

This script uses uv to update the additional_dependencies of the mypy pre-commit hook.

With uv export it will generate a list of all dependencies required to run mypy. By default, it assumes that an uv dependency group, called mypy, exists and contains all additional dependencies (besides the project dependencies) to successfully run type checking. The group(s) may only contain the direct dependencies. Transitive dependencies are derived by uv automatically.

The dependency group(s) can be overwritten by -g/--group or --no-groups option.

Installation

Run

uv add update-mypy-hook --group dev

Using update-mypy-hook

Run in your python project root folder

update-mypy-hook --help

Pre-commit hook

Add this to your .pre-commit-config.yaml

- repo: https://github.com/H4rryK4ne/update-mypy-hook
  rev: v0.3.0
  hooks:
  - id: update-mypy-hook
    args:
    - --extra-excluded-package=some_package
    - --extra-excluded-package=some_other_package

Options:

  -h, --help            show this help message and exit
  -g GROUP, --group GROUP
                        Dependency group to include. Can be used multiple times (default: mypy)
  --no-groups           Do not include any dependency groups.
  -c PRE_COMMIT_CONFIG_PATH, --pre-commit-config-path PRE_COMMIT_CONFIG_PATH
                        Path to .pre-commit-config.yaml (default: .pre-commit-config.yaml)
  -p PROJECT_PATH, --project-path PROJECT_PATH
                        Path to python project. Only needed if not in project root.
  --excluded-package PACKAGE
                        Package excluded in the additional_dependencies. Can be used multiple times (default: mypy, mypy-extensions, tomli, typing-extensions)
  -x PACKAGE, --extra-excluded-package PACKAGE
                        Additional package excluded from additional_dependencies. Extends the --excluded-package option. Can be used multiple times.
  --yaml-width YAML_WIDTH
                        maximum width of yaml output (default: 120)
  --yaml-indent YAML_INDENT
                        number of spaces to indent (default: 2)
  --yaml-default-flow-style, --no-yaml-default-flow-style
                        use default flow style (default: False)

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

update_mypy_hook-0.3.1.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

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

update_mypy_hook-0.3.1-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file update_mypy_hook-0.3.1.tar.gz.

File metadata

  • Download URL: update_mypy_hook-0.3.1.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for update_mypy_hook-0.3.1.tar.gz
Algorithm Hash digest
SHA256 1aaab131ff969382ac84c6f7170d2af646011b83e8629183230f4175631f97a7
MD5 547a0840a0bfe5c25dddeae4be20f7b6
BLAKE2b-256 33f0a6ec513c1d44a0c764f763b91cae77d1fe36aac305d222ced1f1628794e8

See more details on using hashes here.

File details

Details for the file update_mypy_hook-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: update_mypy_hook-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for update_mypy_hook-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e214e91111dcb810ffd117df7fcb8eab638a1ec5147afa029af9460ceac4e723
MD5 481b9dcbe02a4e08d5289a16c3d8b4de
BLAKE2b-256 d3224bac809a6c2c064aa3e8f5b838ef1b86dc739f10d425b32bf94c46718d54

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 Pingdom Monitoring Sentry Error logging StatusPage Status page