flake8-pyi


Nameflake8-pyi JSON
Version 24.4.0 PyPI version JSON
download
home_pageNone
SummaryA plugin for flake8 to enable linting .pyi stub files.
upload_time2024-04-11 11:22:28
maintainerSebastian Rittau, Akuli, Shantanu
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords bugs flake8 linter pyflakes pyi qa stubs typing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # flake8-pyi

A plugin for Flake8 that provides specializations for
[type hinting stub files](https://www.python.org/dev/peps/pep-0484/#stub-files),
especially interesting for linting
[typeshed](https://github.com/python/typeshed/).

Refer to [this documentation](https://typing.readthedocs.io/en/latest/source/stubs.html) for more
details on stub files.

## Functionality

1. Adds the `.pyi` extension to the default value of the `--filename`
   command-line argument to Flake8.  This means stubs are linted by default with
   this plugin enabled, without needing to explicitly list every file.

2. Modifies PyFlakes runs for `.pyi` files to defer checking type annotation
   expressions after the entire file has been read.  This enables support for
   first-class forward references that stub files use.

3. Provides a number of `.pyi`-specific warnings that enforce typeshed's
   style guide.

Note: Be careful when using this plugin in the same environment as other flake8
plugins, as they might generate errors that are inappropriate for
`.pyi` files (e.g., about missing docstrings). We recommend running
`flake8-pyi` in a dedicated environment in your CI.

## Lints provided

This plugin reserves codes starting with **Y0**. For a full list of lints
currently provided by flake8-pyi, see the
[list of error codes](https://github.com/PyCQA/flake8-pyi/blob/main/ERRORCODES.md).

Note that several error codes recommend using types from `typing_extensions` or
`_typeshed`. Strictly speaking, these packages are not part of the standard
library. However, these packages are included in typeshed's `stdlib/`
directory, meaning that type checkers believe them to be part of the standard
library even if this does not reflect the reality at runtime. As such, since
stubs are never executed at runtime, types from `typing_extensions` and
`_typeshed` can be used freely in a stubs package, even if the package does not
have an explicit dependency on either `typing_extensions` or typeshed.

Flake8-pyi's checks may produce false positives on stubs that aim to support Python 2.

## License

MIT

## Authors

Originally created by [Łukasz Langa](mailto:lukasz@langa.pl) and
now maintained by
[Jelle Zijlstra](mailto:jelle.zijlstra@gmail.com),
[Alex Waygood](mailto:alex.waygood@gmail.com),
Sebastian Rittau, Akuli, and Shantanu.

## See also

* [List of error codes](https://github.com/PyCQA/flake8-pyi/blob/main/ERRORCODES.md)
* [Changelog](https://github.com/PyCQA/flake8-pyi/blob/main/CHANGELOG.md)
* [Information for contributors](https://github.com/PyCQA/flake8-pyi/blob/main/CONTRIBUTING.md)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "flake8-pyi",
    "maintainer": "Sebastian Rittau, Akuli, Shantanu",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Jelle Zijlstra <jelle.zijlstra@gmail.com>, Alex Waygood <alex.waygood@gmail.com>",
    "keywords": "bugs, flake8, linter, pyflakes, pyi, qa, stubs, typing",
    "author": null,
    "author_email": "\u0141ukasz Langa <=lukasz@langa.pl>",
    "download_url": "https://files.pythonhosted.org/packages/71/45/c1799a6255badaac63c095926823d9adf950de2de97340c11047212aae07/flake8_pyi-24.4.0.tar.gz",
    "platform": null,
    "description": "# flake8-pyi\n\nA plugin for Flake8 that provides specializations for\n[type hinting stub files](https://www.python.org/dev/peps/pep-0484/#stub-files),\nespecially interesting for linting\n[typeshed](https://github.com/python/typeshed/).\n\nRefer to [this documentation](https://typing.readthedocs.io/en/latest/source/stubs.html) for more\ndetails on stub files.\n\n## Functionality\n\n1. Adds the `.pyi` extension to the default value of the `--filename`\n   command-line argument to Flake8.  This means stubs are linted by default with\n   this plugin enabled, without needing to explicitly list every file.\n\n2. Modifies PyFlakes runs for `.pyi` files to defer checking type annotation\n   expressions after the entire file has been read.  This enables support for\n   first-class forward references that stub files use.\n\n3. Provides a number of `.pyi`-specific warnings that enforce typeshed's\n   style guide.\n\nNote: Be careful when using this plugin in the same environment as other flake8\nplugins, as they might generate errors that are inappropriate for\n`.pyi` files (e.g., about missing docstrings). We recommend running\n`flake8-pyi` in a dedicated environment in your CI.\n\n## Lints provided\n\nThis plugin reserves codes starting with **Y0**. For a full list of lints\ncurrently provided by flake8-pyi, see the\n[list of error codes](https://github.com/PyCQA/flake8-pyi/blob/main/ERRORCODES.md).\n\nNote that several error codes recommend using types from `typing_extensions` or\n`_typeshed`. Strictly speaking, these packages are not part of the standard\nlibrary. However, these packages are included in typeshed's `stdlib/`\ndirectory, meaning that type checkers believe them to be part of the standard\nlibrary even if this does not reflect the reality at runtime. As such, since\nstubs are never executed at runtime, types from `typing_extensions` and\n`_typeshed` can be used freely in a stubs package, even if the package does not\nhave an explicit dependency on either `typing_extensions` or typeshed.\n\nFlake8-pyi's checks may produce false positives on stubs that aim to support Python 2.\n\n## License\n\nMIT\n\n## Authors\n\nOriginally created by [\u0141ukasz Langa](mailto:lukasz@langa.pl) and\nnow maintained by\n[Jelle Zijlstra](mailto:jelle.zijlstra@gmail.com),\n[Alex Waygood](mailto:alex.waygood@gmail.com),\nSebastian Rittau, Akuli, and Shantanu.\n\n## See also\n\n* [List of error codes](https://github.com/PyCQA/flake8-pyi/blob/main/ERRORCODES.md)\n* [Changelog](https://github.com/PyCQA/flake8-pyi/blob/main/CHANGELOG.md)\n* [Information for contributors](https://github.com/PyCQA/flake8-pyi/blob/main/CONTRIBUTING.md)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A plugin for flake8 to enable linting .pyi stub files.",
    "version": "24.4.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/PyCQA/flake8-pyi/issues",
        "Changelog": "https://github.com/PyCQA/flake8-pyi/blob/main/CHANGELOG.md",
        "Homepage": "https://github.com/PyCQA/flake8-pyi",
        "Source": "https://github.com/PyCQA/flake8-pyi"
    },
    "split_keywords": [
        "bugs",
        " flake8",
        " linter",
        " pyflakes",
        " pyi",
        " qa",
        " stubs",
        " typing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b232fb9e67692e925575f0ccd2aabae28bfcf6fe443cede35ebd6c8e6d42e71a",
                "md5": "d4cbd66a8e93f1d7c41dadb7a5c21190",
                "sha256": "57e1a545a02a57b9814c238cd260a344d8a9db9a378671815e7ca9183637aa02"
            },
            "downloads": -1,
            "filename": "flake8_pyi-24.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d4cbd66a8e93f1d7c41dadb7a5c21190",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 25484,
            "upload_time": "2024-04-11T11:22:25",
            "upload_time_iso_8601": "2024-04-11T11:22:25.834359Z",
            "url": "https://files.pythonhosted.org/packages/b2/32/fb9e67692e925575f0ccd2aabae28bfcf6fe443cede35ebd6c8e6d42e71a/flake8_pyi-24.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7145c1799a6255badaac63c095926823d9adf950de2de97340c11047212aae07",
                "md5": "d50c375c6585d348cf577fd8f51246f0",
                "sha256": "4a50d2fe395d8ff08ee4a7e7b8a3cb532046335f0985c2537ffd3abedc56c9ab"
            },
            "downloads": -1,
            "filename": "flake8_pyi-24.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "d50c375c6585d348cf577fd8f51246f0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 60604,
            "upload_time": "2024-04-11T11:22:28",
            "upload_time_iso_8601": "2024-04-11T11:22:28.000212Z",
            "url": "https://files.pythonhosted.org/packages/71/45/c1799a6255badaac63c095926823d9adf950de2de97340c11047212aae07/flake8_pyi-24.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-11 11:22:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PyCQA",
    "github_project": "flake8-pyi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "flake8-pyi"
}
        
Elapsed time: 0.27453s