Skip to content

youtype/istub

Repository files navigation

iStub

Validator for type annotations.

  • Stubs generation
  • Code style checking with flake8
  • Type checking with mypy and pyright
  • Type consistency checking with mypy.stubtest

Usage

Basic usage

Let's assume that you want to check mylib-stubs package against mylib

Create a file istub.yml in your project root:

packages:
  - name: mylib
    path: ./mylib-stubs
    checks:
      mypy: true
      stubtest: true

Run checker:

python -m istub

You can create a whitelist of acceptable errors:

python -m istub --update

Custom configuration

packages:
  - name: mylib
    path: ./mylib-stubs
    checks:
      mypy: true
      stubtest: true
      flake8: false
      pyright: false
    pip_install:
      - pypi_dependency
      - pypi_dependency2
    pip_uninstall:
      - dependency_to_uninstall
    build:
      - ./build_cmd.sh

Latest changes

Full changelog can be found in Releases.

Versioning

istub version follows PEP 440 format.

Support and contributing

Please reports any bugs or request new features in istub repository.