flake8-pep585
flake8 plugin to enforce new-style type hints (PEP 585)
What it is and what it does
flake8-pep585 is a linter plugin that integrates with flake8 to catch deprecated type imports from the `typing` module. PEP 585 introduced the ability to use standard library classes directly for type annotations—for example, `list[int]` instead of `typing.List[int]`, or `collections.abc.Callable` instead of `typing.Callable`. The plugin scans your code for these deprecated imports and reports them with specific error codes and suggestions for the modern equivalent.
The plugin works on Python 3.7 through 3.9 and can be configured to always enforce the rules, automatically detect them (based on the presence of `from __future__ import annotations`), or never enforce them. You can also whitelist specific symbols if you have a reason to keep using the older imports. Since it has no runtime dependencies beyond flake8 itself, installation is straightforward.
Use it for:
- Modernize a codebase to use PEP 585 type hints when upgrading to Python 3.9+.
- Enforce team standards in CI/CD pipelines to prevent deprecated typing imports in new code.
- Discover and fix deprecated type imports that IDEs' auto-import features may have suggested.
- Gradually migrate a project to modern type annotations without manual code review.
- Validate that a project is ready for future Python versions where old typing imports may be removed.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A flake8 plugin that detects and flags deprecated type imports from the `typing` module that should be replaced with standard library equivalents under PEP 585.
Yes, if you are actively maintaining code on Python 3.9+ and want to enforce PEP 585 compliance. The plugin is straightforward to set up and has no runtime overhead. However, note that the project is abandoned (last release February 2023) and may not be updated for future flake8 or Python releases, so verify compatibility with your current toolchain before relying on it long-term.
Install
flake8-pep585 on PyPI
pip
pip install flake8-pep585uv
uv add flake8-pep585poetry
poetry add flake8-pep585Installing flake8-pep585
Before you install
Low install friction; no runtime dependencies. Maintenance is abandoned—last release was 2023-02-26, over a year ago. The repository is not archived, but no active development is expected.
License in practice
Licensed under MPL-2.0 (copyleft). You may use and modify the plugin freely, but any modifications must be distributed under the same license if shared.
Quickstart
pip install flake8-pep585
# Then run flake8 on your code:
flake8 your_project/
# Or configure via setup.cfg:
# [flake8]
# pep585-activation = always
Requires flake8 to be installed separately. Only enforces PEP 585 rules on Python 3.7–3.9; behavior on 3.7–3.8 depends on presence of `from __future__ import annotations`.
Verify before relying
- Whether the plugin correctly handles all PEP 585 replacements or if there are edge cases not covered.
- Whether the abandoned status means the plugin may break with future Python or flake8 releases.
Package facts
| License | MPL-2.0 (copyleft) |
| Python support | supports the current Python release (>=3.7,<4.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,265 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 98,711/month — #13,063 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: flake8_pep585-0.1.7-py3-none-any.whl
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
flake8-deprecatedA flake8 plugin that detects calls to…
copyleft · top 15,000 on PyPI
flake8-requirementsA flake8 plugin that validates whether imported…
permissive · top 15,000 on PyPI
flake8-annotationsA Flake8 plugin that enforces PEP 3107-style…
permissive · top 15,000 on PyPI
flake8-typing-importsA flake8 plugin that detects unguarded typing…
permissive · top 15,000 on PyPI
flake8-tidy-importsA flake8 plugin that detects and reports…
permissive · top 15,000 on PyPI
flake8-import-orderA flake8 plugin that enforces import ordering…
copyleft · top 5,000 on PyPI
eval-type-backportEnables newer Python typing syntax (like `X |…
permissive · top 1,000 on PyPI
typeapiProvides a unified API for reflecting and…
permissive · top 15,000 on PyPI
flake8-type-checkingA flake8 plugin that identifies which imports…
permissive · top 15,000 on PyPI
flake8-pep3101A flake8 plugin that detects and flags…
copyleft · top 15,000 on PyPI