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 (TODO: daemon?) and has a couple typing problems. pytype runs last because it is slow and doesn't fully support Python 3.12 yet.

TODO: allow for custom behavior thru a typegun_special file or something.

TODO: example usage using pipx or w/e

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.1.0.tar.gz (88.9 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.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for typegun-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d8585164d2d8657ebea2919ce26cdf01b35e2a612d09513f13a6012142197755
MD5 33928e6cd32768108707a4c35fa5d577
BLAKE2b-256 c31c9fbbadf14a6f3d4cf8bd9cdf9c932addbfa70b4eff6442ef963c2031ddb5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: typegun-0.1.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-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c28c2d89200fe9e44604ba2faf44385b17ae1ecca7d15d97747ba87e60b736e7
MD5 62231f6826c7296396e96cd18502ec9d
BLAKE2b-256 532d30c4d34890012aa0284c45c49c184bf6c33fb2470a6c138af417a7848c4e

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