Skip to main content

Run a bunch of python typecheckers on a project, to see if there are any problems.

Project description

typegun

Special Gun Special
Super Smash Bros. Ultimate

Typegun is a small command-line utility for python to run a bunch of python typecheckers on a project, to see if there are any problems. This grew out of a script I would cart around, which I decided to make a reusable package.

(For the purposes of typegun, by typechecker I mean static analysis tools only; Not a "runtime type checker", of which there are many in Python. A "semi-static" typechecker like pyanalyze or pycroscope would be allowable here as a static analysis tool.)

This only includes typecheckers that have a reasonable shot at typing near-current-version python projects mostly-correctly, in my (non-scientific) opinion, a list which may vary over time. If you'd like to add more or bicker about the configurations these typecheckers should have, I'm happy to hear it. The versions of these typecheckers are completely unpinned, all the better to get the most recent versions of them probably. It also includes ruff, which is not a typechecker, but is very useful for code quality nonetheless.

Typegun is strategic about the order in which it runs its typecheckers, and this ordering is determined by the speed and utility of the typechecker. Ruff runs first because it runs very fast and never false-positives a type error at all, while still alerting you to other problems that may cause a type error, which the other typecheckers will detect more slowly later. Pyright runs second because it's fast and very correct to the python typing spec. Mypy runs after this because it's slower and has a couple typing problems. pytype runs last because it is slow and doesn't fully support Python 3.12 yet.

Example usage

In your project directory, do one of the following, depending on what you have installed already:

typegun

uvx typegun

pipx run typegun

pip install typegun --break-system-packages && typegun

etc etc

Illustrative diagram

poorly-drawn cartoon image of a man firing a shotgun (the bullets of which have been labeled "mypy", "pyright", etc) at a python project

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

typegun-1.0.0.tar.gz (89.2 kB view details)

Uploaded Source

Built Distribution

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

typegun-1.0.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file typegun-1.0.0.tar.gz.

File metadata

  • Download URL: typegun-1.0.0.tar.gz
  • Upload date:
  • Size: 89.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for typegun-1.0.0.tar.gz
Algorithm Hash digest
SHA256 af09b13700e3c218bdaa03f5e62529f32dc5524f3214e59dfc7b8d21b08a58d5
MD5 151421bbacac546898a2279ce7a8deb7
BLAKE2b-256 3626a9256ba967794df5aafc32a123e3fa1c4c951d9b5f23ddbdcb47a5e18ac1

See more details on using hashes here.

File details

Details for the file typegun-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: typegun-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for typegun-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6ea754a7e2b3d08f897baff9f2d713d7aa5046fb5ac30ac2ae8065ec7037021c
MD5 7e5736b2318ce130c9b1cb0263e10639
BLAKE2b-256 df9aef4ccab678d23274273104aded50e1fa0985c7da11583b3385d0ea0bda14

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