skillfed

flake8-pep585

flake8 plugin to enforce new-style type hints (PEP 585)

flake8-pep585 v0.1.7 98.7K downloads/30d#13,063 on PyPI23
Copyleft license MPL-2.0 Abandoned released

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-pep585

uv

uv add flake8-pep585

poetry

poetry add flake8-pep585

Installing 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

License :: OSI ApprovedProgramming Language :: Python :: 3Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

flake8 pep 585 plugindeprecated typing importstype hint modernizationpep 585 enforcementtyping module deprecation checkerstandard library type hintsmodern python type annotations
type-hintscode-qualitylinting

More Quality Assurance packages