Skip to main content

mypy-baseline

A CLI tool for painless integration of mypy with an existing Python project. When you run it for the first time, it will remember all type errors that you already have in the project (generate "baseline"). All consequentive runs will ignore these errors and report only ones that you introduced after that.

Additionally, the tool will show you what progress you made since the last baseline, to encourage your team to resolve mypy errors:

example of the command output

Features:

  • Battle-tested.
  • Fast and simple.
  • Pure Python.
  • No mypy patching or dirty magic. The tool works exclusively with the stdout of mypy.
  • Nice stats with colors.
  • Can detect exactly what errors were introduced and what errors were resolved, even if they are in the same file.
  • Baseline is carefully crafted to avoid merge conflicts.
  • Baseline is human-readable, and diffs are informative. The reviewers of your PR will know exactly what errors you resolve and what errors you introduced.
  • Track the progress you make with git-based history of changes and burndown chart of resolved type violations.
  • Ignore speicific error messages (using regular expressions), so that buggy mypy plugins don't bother you with false-positives.

Installation

python3 -m pip install mypy-baseline

Usage

Create the baseline (it will be stored in mypy-baseline.txt by default):

mypy | mypy-baseline sync

After that, you can pipe mypy output into mypy-baseline filter, and it will filter out all issues that are already in the baseline:

mypy | mypy-baseline filter

If you introduce new errors, resolve them. If you resolve existing errors, run mypy-baseline sync again to re-generate baseline. In both cases, mypy-baseline will tell you what's wrong and what to do. Enjoy the ride!

Read more in the documentation: mypy-baseline.orsinium.dev

Metadata

Release files for mypy_baseline 0.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mypy_baseline 0.4.4
File Size Uploaded Provenance Actions
mypy_baseline-0.4.4.tar.gz 318.0 kB Without provenance Details for mypy_baseline-0.4.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mypy_baseline 0.4.4
File Interpreter ABI Platform Actions
mypy_baseline-0.4.4-py3-none-any.whl Python 3 none any Details for mypy_baseline-0.4.4-py3-none-any.whl

Total release size: 335.3 kB

Release files / mypy_baseline-0.4.4.tar.gz

Download URL mypy_baseline-0.4.4.tar.gz
Size 318.0 kB
Tags Source
SHA-256 checksum
How to use checksums
17500a6cf1492d529959b3fe89c6aac4f9e15a4d936b32d7080914225ac67a4d
BLAKE2b-256 checksum
How to use checksums
c11ce5b78a87b6cdf12c1d6255316467d17d248d84531cea51b5d3921c8ff35d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.25.1

Release files / mypy_baseline-0.4.4-py3-none-any.whl

Download URL mypy_baseline-0.4.4-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af4990f1b9b6b78387dbadb482e4053fe0cbb95354e7a1d72776eedb34c4d221
BLAKE2b-256 checksum
How to use checksums
828bef91cc8acd119c8c007c79b83d7bfcff1c0b805b2a1c610ff59b119ee190
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.25.1

Security for mypy_baseline 0.4.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page