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. TODO: actually put it in here, and publish this package on pypi.

(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.

(will experiment with these as my job allows (using the typechecking script from there as a model)){ TODO: allow for custom behavior thru a typegun_special file or something.

TODO: allow for flexibility in what arguments/files the typecheckers are called on?

TODO: mypy daemon, faster storage with orjson? }

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-0.2.0.tar.gz (89.0 kB view details)

Uploaded Source

Built Distribution

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

typegun-0.2.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for typegun-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d751b6309c20a1d8499e28c5112f65e12a2cfdbe621237383b0209c36e6d7c46
MD5 de1933add9e6a7a92e5f2d673c44b316
BLAKE2b-256 8da7c4922d9f2d00c08d52aefb8384139b9643ffe5f09b6b89333bb3b491e2d3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for typegun-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 32dd41f06e9511b8289456665a523c21a0a2af4cbda839f14e60c4fcc035512e
MD5 2861dabaf8b279818dbe35d88f18c00e
BLAKE2b-256 cecf8ccc8fccb96e6e5ec50a7fe6da8129e119896bcf43d19485482bfd18bf43

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