Skip to main content

flake8-future-annotations

Python 3.7+ PyPI version GitHub license Downloads

Verifies python 3.7+ files use from __future__ import annotations if a type is used in the module that can be rewritten using PEP 563.

Pairs well with pyupgrade with the --py37-plus flag or higher, since pyupgrade only replaces type annotations with the PEP 563 rules if from __future__ import annotations is present.

For example:

import typing as t
from typing import List

def function(a_dict: t.Dict[str, t.Optional[int]]) -> None:
    a_list: List[str] = []
    a_list.append("hello")

As a result, this plugin will emit:

hello.py:1:1: F Missing from __future__ import annotations but imports: List, t.Dict, t.Optional

After adding the future annotations import, running pyupgrade allows the code to be automatically rewritten as:

from __future__ import annotations

def function(a_dict: dict[str, int | None]) -> None:
    a_list: list[str] = []
    a_list.append("hello")

Metadata

Release files for flake8-future-annotations 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flake8-future-annotations 0.0.4
File Size Uploaded Provenance Actions
flake8-future-annotations-0.0.4.tar.gz 4.4 kB Without provenance Details for flake8-future-annotations-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flake8-future-annotations 0.0.4
File Interpreter ABI Platform Actions
flake8_future_annotations-0.0.4-py3-none-any.whl Python 3 none any Details for flake8_future_annotations-0.0.4-py3-none-any.whl

Total release size: 9.7 kB

Release files / flake8-future-annotations-0.0.4.tar.gz

Download URL flake8-future-annotations-0.0.4.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
609f7b72dafba55988acbc822a1aae6dde8ec2036d86751a627175dac3e58b46
BLAKE2b-256 checksum
How to use checksums
01dea6e961ac829942f18294ad44b2dab457b5a05c4917d7d6ce69b6dc0a3556
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2

Release files / flake8_future_annotations-0.0.4-py3-none-any.whl

Download URL flake8_future_annotations-0.0.4-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43add640b11a47eb8cfd5380727d894c5f821b4b3de7e14200b27810b61ac329
BLAKE2b-256 checksum
How to use checksums
8748026e401135f511b61b9601e4111f7472a4f187974a92ab5830ae74e218cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/3.7.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2

Security for flake8-future-annotations 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page