{"id":13735150,"url":"https://github.com/decorator-factory/flake8-pep585","last_synced_at":"2025-04-14T11:14:38.370Z","repository":{"id":57429994,"uuid":"450853286","full_name":"decorator-factory/flake8-pep585","owner":"decorator-factory","description":"flake8 plugin to enforce new-style type hints (PEP 585)","archived":false,"fork":false,"pushed_at":"2023-02-28T19:37:34.000Z","size":49,"stargazers_count":23,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T11:14:33.611Z","etag":null,"topics":["flake8","flake8-plugin","python","typing"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/flake8-pep585/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/decorator-factory.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-22T15:16:39.000Z","updated_at":"2024-12-14T11:48:03.000Z","dependencies_parsed_at":"2024-06-19T16:24:09.491Z","dependency_job_id":"c43db375-4bd3-4dba-9743-c53845eadd42","html_url":"https://github.com/decorator-factory/flake8-pep585","commit_stats":{"total_commits":18,"total_committers":3,"mean_commits":6.0,"dds":"0.11111111111111116","last_synced_commit":"e7602952e5c1bdf82313c6a308e190f90e58feba"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decorator-factory%2Fflake8-pep585","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decorator-factory%2Fflake8-pep585/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decorator-factory%2Fflake8-pep585/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decorator-factory%2Fflake8-pep585/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/decorator-factory","download_url":"https://codeload.github.com/decorator-factory/flake8-pep585/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868766,"owners_count":21174758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flake8","flake8-plugin","python","typing"],"created_at":"2024-08-03T03:01:03.511Z","updated_at":"2025-04-14T11:14:38.326Z","avatar_url":"https://github.com/decorator-factory.png","language":"Python","funding_links":[],"categories":["Type annotations"],"sub_categories":[],"readme":"# flake8-pep585\n\nThis plugin enforces the changes proposed by [PEP 585](https://peps.python.org/pep-0585/).\n\n## What does PEP 585 change?\n\nBefore PEP 585, you had to import stuff from `typing` to annotate some objects from the standard library:\n\n- For context managers, you'd import `typing.ContextManager`\n- For lists, you'd import `typing.List`\n- For callables, you'd import `typing.Callable`\n- ...and so on\n\nWith PEP 585, you can now use classes already present in the standard library. For example:\n- For a context manager giving an `int`, use `contextlib.AbstractContextManager[int]`\n- For a `list` of `dict`s mapping `str`s to `int`s, use `list[dict[str, int]]`\n- For a callable taking a `float` and returning an `int`, use `collections.abc.Callable[[float], int]`\n\n`typing.List`, `typing.Callable` etc. are now deprecated. This is pretty hard to discover, since these\nimports don't cause a deprecation warning. IDEs don't help either: the \"auto-import\" feature often suggests\nimporting a deprecated item.\n\nThis plugin lets you find these deprecated imports.\n\n## Examples\n\n### Direct import\n```py\nfrom typing import Callable\n```\n```\nPEA001 typing.Callable is deprecated, use collections.abc.Callable instead. See PEP 585 for details\n```\n\n### Qualified import\n```py\nfrom datetime import time\nimport typing as ty\n\ndef construct_time(match: ty.Match) -\u003e time:\n    return time(\n        hour=int(match[\"hour\"]),\n        minute=int(match[\"minute\"]),\n    )\n```\n```\nPEA001 typing.Match is deprecated, use re.Match instead. See PEP 585 for details\n```\n\n# Installation\n\n1. Make sure you have `flake8` installed\n2. Run `pip install flake8-pep585`\n3. Run `flake8` on your code\n\n# Configuration\n\nVia your `setup.cfg` file:\n```ini\n[flake8]\npep585-activation = always  # \"always\", \"auto\" or \"never\"\n\n# Symbols that you're okay with being imported from `typing`\npep585-whitelisted-symbols =\n    Callable\n    Match\n    Pattern\n```\n\nVia the CLI:\n```\npython -m flake8 --pep585-activation=always your_project/file.py\n```\n\nThis only changes how the plugin behaves on Python 3.7.x and Python 3.8.x. By default (\"auto\"), it will be enabled\nif a `from __future__ import annotations` line is found.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecorator-factory%2Fflake8-pep585","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecorator-factory%2Fflake8-pep585","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecorator-factory%2Fflake8-pep585/lists"}