flake8-typing-imports
flake8 plugin which checks that typing imports are properly guarded
Decision gist · record as of 2026-08-14
Yes. This is a lightweight, actively maintained plugin that solves a real problem—typing module instability across Python versions—with zero security issues and minimal install friction. If you support multiple Python versions and use type hints, it catches mistakes that are otherwise easy to miss and can cause runtime failures in older environments.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later; flake8 must be installed and available in your environment.
- Low friction: pure Python wheel with only flake8 as a runtime dependency.
- Actively maintained with a recent release (2025-10-09) and no known vulnerabilities.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this plugin freely with minimal restrictions.
last release 2025-10-09 (309 days) · last repo commit 2026-07-15 · 51 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 117,542 downloads/mo, #12,159 on PyPI
Alternatives
Verify before relying
pip install flake8-typing-imports
# Then run flake8 normally; the plugin integrates automatically
flake8 your_code.py
# Configure minimum Python version in .flake8 or setup.cfg:
# [flake8]
# min_python_version = 3.6.0- Whether the plugin correctly handles all edge cases in typing module changes across Python versions 3.5.0–3.7.2 as claimed.
- Performance impact when running on large codebases with many typing imports.
What it is and what it does
This is a flake8 plugin that enforces safe typing imports by checking that typing module usage matches your minimum supported Python version. The typing module has seen significant API changes across Python versions, and this plugin catches cases where you import or use typing constructs that don't exist in all your target versions—flagging them with codes like TYP001 (unguarded import), TYP002 (@overload issues), TYP003 (unquoted Union/Pattern), TYP004–TYP005 (NamedTuple limitations), and TYP006 (unquoted typing attributes).
You configure it with a minimum Python version (defaulting to 3.5.0, or read from setup.cfg's python_requires), and it runs as part of your normal flake8 checks. It helps you avoid runtime errors by ensuring that imports are either guarded behind TYPE_CHECKING blocks or version checks, or that you quote type hints that aren't available in all supported versions.
Use it for
- Enforce TYPE_CHECKING guards in a codebase that supports multiple Python versions to avoid runtime import errors.
- Catch typing API usage that's broken or unavailable in your minimum supported Python version during CI/CD.
- Validate that NamedTuple definitions don't use unsupported features like methods or defaults in older Python versions.
- Automatically check that Union[Match, ...] and Union[Pattern, ...] are quoted when targeting Python <3.5.2.
- Integrate typing safety checks into pre-commit hooks alongside other flake8 linting rules.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
This is a lightweight, actively maintained plugin that solves a real problem—typing module instability across Python versions—with zero security issues and minimal install friction. If you support multiple Python versions and use type hints, it catches mistakes that are otherwise easy to miss and can cause runtime failures in older environments.
Install
flake8-typing-imports on PyPI
Before you install
Low friction: pure Python wheel with only flake8 as a runtime dependency. Actively maintained with a recent release (2025-10-09) and no known vulnerabilities.
Requires Python 3.9 or later; flake8 must be installed and available in your environment.
License in practice
MIT license is permissive; you can use, modify, and distribute this plugin freely with minimal restrictions.
Quickstart
pip install flake8-typing-imports
# Then run flake8 normally; the plugin integrates automatically
flake8 your_code.py
# Configure minimum Python version in .flake8 or setup.cfg:
# [flake8]
# min_python_version = 3.6.0
Verify before relying
- Whether the plugin correctly handles all edge cases in typing module changes across Python versions 3.5.0–3.7.2 as claimed.
- Performance impact when running on large codebases with many typing imports.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageflake8 |
| Maintenance | Actively maintained 309 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 117,542 / month, #12,159 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy |
Evidence: flake8_typing_imports-1.17.0-py2.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 typing imports guard”
- flake8-typing-importsA flake8 plugin that detects unguarded typing imports and…
- flake8-type-checkingA flake8 plugin that identifies which imports should be moved into or…
- flake8-pep585A flake8 plugin that detects and flags deprecated type imports from…
Give your agent the search over MCP, or paste the wish link into any chat.
More Quality Assurance packages
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
Ruff is a Python linter and code formatter written in Rust that combines linting, formatting, and code fixing into a single tool, replacing Flake8, Black, isort, and related utilities.
Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.
Black reformats Python source code to a consistent style by parsing entire files and rewriting them according to an opinionated, deterministic set of rules, eliminating manual formatting decisions.
pytest-xdist distributes pytest tests across multiple CPU cores or machines to speed up test execution, with the simplest usage being `pytest -n auto` to spawn workers equal to available CPUs.
Install it if your test suite takes long enough that parallelization would save meaningful time.
Validates AWS CloudFormation templates in YAML or JSON format against resource provider schemas and best practices, checking property values and configuration correctness.
Install it if you work with CloudFormation templates.
See also flake8-type-checking · flake8-pie · flake8-annotations · flake8-pep585 · flake8-import-order · flake8-tidy-imports · guardrails-ai-types · shellcheck-py · flake8-isort · flake8-pyi