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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file typegun-1.0.1.tar.gz.
File metadata
- Download URL: typegun-1.0.1.tar.gz
- Upload date:
- Size: 89.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
101a47efbc5c76e7f204a20a769c096b1f2963890f676fe171ec6a46e6beee64
|
|
| MD5 |
8c318b085e82d17fc83e43fb38d3afed
|
|
| BLAKE2b-256 |
53e1152c8ba4b6417a223447def5b0efb539f32a8e4d6cf9490af71badd23a97
|
File details
Details for the file typegun-1.0.1-py3-none-any.whl.
File metadata
- Download URL: typegun-1.0.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb41ea95e813708ca8c6e70e1162e9ae41ae78e2ef5d7d0c48e47f9fdfd23d5b
|
|
| MD5 |
0368ff69e94bba814bd909d3da92d441
|
|
| BLAKE2b-256 |
6221126f92fe7fdbf51c622ea0b502c13f9dc87af8f2e37409afe28c7e96f71c
|