mypy-runner


Namemypy-runner JSON
Version 0.6.0 PyPI version JSON
download
home_pagehttps://github.com/chadrik/mypy-runner
SummaryRun mypy with options to filter errors and colorize output
upload_time2023-04-21 22:40:12
maintainer
docs_urlNone
authorChad Dombrova
requires_python
licenseMIT
keywords pep484 typing annotations mypy
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            mypy-runner
===========

Ease your way into static type checking by focusing on a small set of problems at a time.

It can be quite challenging to get an existing code base to pass mypy's checks, even at its most lenient settings, and unfortunately, until you do you can't use mypy as part of your CI/CD process.

``mypy-runner`` lets you gradually introduce type checking by identifying a subset of files and errors to check:

- choose a set of files and errors to check
- get tests passing and enforce them in your CI and pre-commit hooks
- repeat

Features
--------

``mypy-runner`` adds the following features to ``mypy``:

- Display colorized output
- Convert specific errors to warnings
- Filter specific errors and warnings
- Automatically insert missing `typing` imports (see `--add-missing-imports` below)

Compatibility
-------------

``mypy-runner`` supports ``mypy`` 0.730 and higher.

Options
-------

::

    usage: mypyrun [-h] [--version] [--daemon] [--select SELECT [SELECT ...]] [--ignore IGNORE [IGNORE ...]] [--warn WARN [WARN ...]] [--color] [--show-ignored] [--add-missing-imports] [--options OPTIONS] [--config-file CONFIG_FILE]
                      [--files FILES [FILES ...]] [--warning-filters WARNING_FILTERS [WARNING_FILTERS ...]] [--error-filters ERROR_FILTERS [ERROR_FILTERS ...]] [--mypy-executable MYPY_EXECUTABLE]
                      [ARG [ARG ...]]

    positional arguments:
      ARG                   Regular mypy flags and files (precede with --)

    optional arguments:
      -h, --help            show this help message and exit
      --version             show program's version number and exit
      --daemon              Run mypy in daemon mode (inverse: --no-daemon)
      --select SELECT [SELECT ...], -s SELECT [SELECT ...]
                            Errors to check
      --ignore IGNORE [IGNORE ...], -i IGNORE [IGNORE ...]
                            Errors to skip
      --warn WARN [WARN ...], -w WARN [WARN ...]
                            Errors to convert into warnings
      --color               Colorize output (inverse: --no-color)
      --show-ignored, -x    Show errors that have been ignored (darker if using color)
      --add-missing-imports
                            Add missing typing imports. This will detect mypy errors related to missing classes from the typing module and automatically insert them into the file
      --options OPTIONS, -o OPTIONS
                            Override the default options to use the namedconfiguration section (e.g. pass --options=foo to use the [mypyrun-foo] section)
      --config-file CONFIG_FILE, -c CONFIG_FILE
                            Specific configuration file.
      --files FILES [FILES ...]
                            Files to isolate (triggers use of 'active'options for these files)
      --warning-filters WARNING_FILTERS [WARNING_FILTERS ...]
                            Regular expression to ignore messages flagged as warnings
      --error-filters ERROR_FILTERS [ERROR_FILTERS ...]
                            Regular expression to ignore messages flagged as errors
      --mypy-executable MYPY_EXECUTABLE
                            Path to the mypy executable

As with tools like ``flake8``, you use specific error codes to enable or disable error output.
Errors that are ignored or converted into warnings will not trigger a non-zero exit status.

Configuration
-------------

``mypyrun`` looks for a ``[mypyrun]`` section in either ``mypy.ini`` or ``mypyrun.ini``.

Here's an example configuration file:

.. code-block:: ini

    [mypyrun]

    # run dmypy instead of mypy
    daemon = true

    # only display these errors
    select =
        not_defined,
        return_expected,
        return_not_expected,
        incompatible_subclass_attr,

    # all other errors are warnings
    warn = *

    # filter errors generated from these paths:
    exclude =
        thirdparty/*,

    # pass these paths to mypy
    paths =
        arnold/python,
        houdini/python,
        katana/python,
        mari/python,
        maya/python,
        nuke/python,
        python/packages,

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/chadrik/mypy-runner",
    "name": "mypy-runner",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "pep484,typing,annotations,mypy",
    "author": "Chad Dombrova",
    "author_email": "chadrik@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ef/23/d3b8cee91d3bf7dea160d9e166b929582dcb4735fcdd0f845bc575414a02/mypy_runner-0.6.0.tar.gz",
    "platform": null,
    "description": "mypy-runner\n===========\n\nEase your way into static type checking by focusing on a small set of problems at a time.\n\nIt can be quite challenging to get an existing code base to pass mypy's checks, even at its most lenient settings, and unfortunately, until you do you can't use mypy as part of your CI/CD process.\n\n``mypy-runner`` lets you gradually introduce type checking by identifying a subset of files and errors to check:\n\n- choose a set of files and errors to check\n- get tests passing and enforce them in your CI and pre-commit hooks\n- repeat\n\nFeatures\n--------\n\n``mypy-runner`` adds the following features to ``mypy``:\n\n- Display colorized output\n- Convert specific errors to warnings\n- Filter specific errors and warnings\n- Automatically insert missing `typing` imports (see `--add-missing-imports` below)\n\nCompatibility\n-------------\n\n``mypy-runner`` supports ``mypy`` 0.730 and higher.\n\nOptions\n-------\n\n::\n\n    usage: mypyrun [-h] [--version] [--daemon] [--select SELECT [SELECT ...]] [--ignore IGNORE [IGNORE ...]] [--warn WARN [WARN ...]] [--color] [--show-ignored] [--add-missing-imports] [--options OPTIONS] [--config-file CONFIG_FILE]\n                      [--files FILES [FILES ...]] [--warning-filters WARNING_FILTERS [WARNING_FILTERS ...]] [--error-filters ERROR_FILTERS [ERROR_FILTERS ...]] [--mypy-executable MYPY_EXECUTABLE]\n                      [ARG [ARG ...]]\n\n    positional arguments:\n      ARG                   Regular mypy flags and files (precede with --)\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      --version             show program's version number and exit\n      --daemon              Run mypy in daemon mode (inverse: --no-daemon)\n      --select SELECT [SELECT ...], -s SELECT [SELECT ...]\n                            Errors to check\n      --ignore IGNORE [IGNORE ...], -i IGNORE [IGNORE ...]\n                            Errors to skip\n      --warn WARN [WARN ...], -w WARN [WARN ...]\n                            Errors to convert into warnings\n      --color               Colorize output (inverse: --no-color)\n      --show-ignored, -x    Show errors that have been ignored (darker if using color)\n      --add-missing-imports\n                            Add missing typing imports. This will detect mypy errors related to missing classes from the typing module and automatically insert them into the file\n      --options OPTIONS, -o OPTIONS\n                            Override the default options to use the namedconfiguration section (e.g. pass --options=foo to use the [mypyrun-foo] section)\n      --config-file CONFIG_FILE, -c CONFIG_FILE\n                            Specific configuration file.\n      --files FILES [FILES ...]\n                            Files to isolate (triggers use of 'active'options for these files)\n      --warning-filters WARNING_FILTERS [WARNING_FILTERS ...]\n                            Regular expression to ignore messages flagged as warnings\n      --error-filters ERROR_FILTERS [ERROR_FILTERS ...]\n                            Regular expression to ignore messages flagged as errors\n      --mypy-executable MYPY_EXECUTABLE\n                            Path to the mypy executable\n\nAs with tools like ``flake8``, you use specific error codes to enable or disable error output.\nErrors that are ignored or converted into warnings will not trigger a non-zero exit status.\n\nConfiguration\n-------------\n\n``mypyrun`` looks for a ``[mypyrun]`` section in either ``mypy.ini`` or ``mypyrun.ini``.\n\nHere's an example configuration file:\n\n.. code-block:: ini\n\n    [mypyrun]\n\n    # run dmypy instead of mypy\n    daemon = true\n\n    # only display these errors\n    select =\n        not_defined,\n        return_expected,\n        return_not_expected,\n        incompatible_subclass_attr,\n\n    # all other errors are warnings\n    warn = *\n\n    # filter errors generated from these paths:\n    exclude =\n        thirdparty/*,\n\n    # pass these paths to mypy\n    paths =\n        arnold/python,\n        houdini/python,\n        katana/python,\n        mari/python,\n        maya/python,\n        nuke/python,\n        python/packages,\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Run mypy with options to filter errors and colorize output",
    "version": "0.6.0",
    "split_keywords": [
        "pep484",
        "typing",
        "annotations",
        "mypy"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e98a2a1773de59b0760725dea4ebea9b757280983aa1c003caa5a407fd3c511d",
                "md5": "172b2aaa456c46c016192d2c32eccfe9",
                "sha256": "abb36474620a52fbc55db2caf5087146dc85e4b301266f36ccd66c1cb0ff9489"
            },
            "downloads": -1,
            "filename": "mypy_runner-0.6.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "172b2aaa456c46c016192d2c32eccfe9",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 10229,
            "upload_time": "2023-04-21T22:40:10",
            "upload_time_iso_8601": "2023-04-21T22:40:10.823015Z",
            "url": "https://files.pythonhosted.org/packages/e9/8a/2a1773de59b0760725dea4ebea9b757280983aa1c003caa5a407fd3c511d/mypy_runner-0.6.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ef23d3b8cee91d3bf7dea160d9e166b929582dcb4735fcdd0f845bc575414a02",
                "md5": "758244b15dfc37cbb5c5b8133e7abc53",
                "sha256": "113a74e581b4d3abfc42aa2b129ef00abd7478e40fae8a6de743139eb1fdb32c"
            },
            "downloads": -1,
            "filename": "mypy_runner-0.6.0.tar.gz",
            "has_sig": false,
            "md5_digest": "758244b15dfc37cbb5c5b8133e7abc53",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10773,
            "upload_time": "2023-04-21T22:40:12",
            "upload_time_iso_8601": "2023-04-21T22:40:12.752220Z",
            "url": "https://files.pythonhosted.org/packages/ef/23/d3b8cee91d3bf7dea160d9e166b929582dcb4735fcdd0f845bc575414a02/mypy_runner-0.6.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-21 22:40:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "chadrik",
    "github_project": "mypy-runner",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "mypy-runner"
}
        
Elapsed time: 0.06237s