flake8-pyi
A plugin for flake8 to enable linting .pyi stub files.
Decision gist · record as of 2026-08-14
Yes, if you maintain or contribute to type stub files (.pyi). The plugin is actively maintained, has no known vulnerabilities, and solves a real problem—standard linters are not designed for stub files. Install in a dedicated CI environment to avoid conflicts with other Flake8 plugins. Not necessary for projects that do not use stub files.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; flake8 and pyflakes must be installed as runtime dependencies.
- Low friction install with just two runtime dependencies (flake8 and pyflakes).
- Repository is actively maintained with recent commits and a stable release history since 2016.
License · maintenance · safety
MIT (permissive) — MIT license permits free use, modification, and distribution with minimal restrictions—suitable for any project type.
last release 2026-05-11 (95 days) · last repo commit 2026-07-24 · 83 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 995,574 downloads/mo, #4,550 on PyPI
Alternatives
Verify before relying
pip install flake8-pyi
flake8 --filename='*.pyi' your_stubs/- Whether the Y0-prefixed error codes cover all common stub-file style issues or if some require manual review.
- Performance impact when running flake8-pyi alongside other plugins in the same environment.
What it is and what it does
flake8-pyi is a Flake8 plugin designed specifically for linting Python type stub files (.pyi). It extends Flake8 to automatically include .pyi files in linting runs and modifies PyFlakes to handle forward references correctly—a feature essential for stub files where types are declared but never executed. The plugin enforces typeshed's style guide through a set of stub-specific lint rules (prefixed with Y0) that catch patterns inappropriate for stub files.
The plugin is most useful in CI pipelines for projects that maintain type stubs, particularly typeshed itself. It runs on modern Python versions and has minimal dependencies. The documentation notes that running it in a dedicated CI environment is recommended to avoid conflicts with other Flake8 plugins that may flag issues irrelevant to stub files (like missing docstrings).
Use it for
- Lint typeshed stub files in CI to enforce consistent style and catch type annotation errors before merging.
- Validate custom .pyi stub files in a project's type stubs package without manual review of every file.
- Catch forward-reference issues in stub files that would be missed by standard Flake8 and PyFlakes.
- Enforce typeshed conventions in stub-heavy projects to maintain consistency across many .pyi files.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you maintain or contribute to type stub files (.pyi).
The plugin is actively maintained, has no known vulnerabilities, and solves a real problem—standard linters are not designed for stub files. Install in a dedicated CI environment to avoid conflicts with other Flake8 plugins. Not necessary for projects that do not use stub files.
Install
flake8-pyi on PyPI
Before you install
Low friction install with just two runtime dependencies (flake8 and pyflakes). Repository is actively maintained with recent commits and a stable release history since 2016.
Requires Python 3.10 or later; flake8 and pyflakes must be installed as runtime dependencies.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for any project type.
Quickstart
pip install flake8-pyi
flake8 --filename='*.pyi' your_stubs/
Verify before relying
- Whether the Y0-prefixed error codes cover all common stub-file style issues or if some require manual review.
- Performance impact when running flake8-pyi alongside other plugins in the same environment.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesflake8pyflakes |
| Maintenance | Actively maintained 95 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 995,574 / month, #4,550 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleFramework :: Flake8Intended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python ModulesTopic :: Software Development :: Quality Assurance |
Evidence: flake8_pyi-26.5.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “flake8 stub file linting”
- flake8-pyiA Flake8 plugin that lints Python type stub files (.pyi) with…
- flake8-unused-argumentsA flake8 plugin that detects unused function arguments in Python code…
- flake8-copyrightA flake8 plugin that enforces the presence of copyright notices in…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also dlint · flake8-bugbear · flake8 · types-pyflakes · flake8-annotations · flake8-type-checking · flake8-pie · flake8-bandit · flake8-json · flake8-tuple