Back to directory
orsinium-labs avatar
orsinium-labs / typeforce

typeforce

Make mypy more effective

21

Stars

2

Forks

1

Watchers

MIT

License

typeforce

Typeforce is a CLI tool that enriches your Python environment with type annotations, empowering mypy.

In particular:

  • Generates py.typed for annotated packages.
  • Installs missed stub files and plugins.

py.typed

PEP-561 says the following:

Package maintainers who wish to support type checking of their code MUST add a marker file named py.typed to their package supporting typing.

In practice, many maintainers don't know about this marker. So there are tons of packages that do have type annotations but don't have py.typed.

Typeforce checks all installed third-party packages and adds py.typed into packages that have type annotations.

stubs and plugins

One of the breaking changes mypy 0.900 introduced is moving out all stubs and plugins for third-party packages out of mypy itself. Now, stub files for every such package should be installed manually.

Typeforce scans all installed third-party packages and installs all needed stub files and plugins if available.

Installation

python3 -m pip install --user typeforce

Usage

python3 -m typeforce --exe python3.9

Releases

Sep 30, 2022

Download .zip

What's Changed

Adds missing annotation to Explorer.run by @sobolevn in #1 Better site discovery by @orsinium in #2

New Contributors

@sobolevn made their first contribution in #1

Full Changelog: 0....