Skip to content

PEP 585 support in 3.7+ using __future__ #66

@TylerYep

Description

@TylerYep

Describe the bug
Vermin reports the minimum version is Python 3.9, even though the code will run correctly in Python 3.7+.

To Reproduce
Steps to reproduce the behavior.

Run the following code in Python 3.7, 3.8, 3.9

from __future__ import annotations

def fn(x: list[int]) -> list[int]:
    a: list[int] = []
    return a

fn([])

Output:

Detecting python files..
Analyzing using 12 processes..
!2, 3.9      /Users/tyler.yep/Documents/Github/probs/yo.py
  L1 C5: '__future__' module requires 2.1, 3.0
  L1 C5: '__future__.annotations' member requires !2, 3.7
  L4: annotations requires !2, 3.0
  L4: builtin generic type annotation (list[..]) requires !2, 3.9
  L5: variable annotations requires !2, 3.6
  L5: builtin generic type annotation (list[..]) requires !2, 3.9
  L6: builtin generic type annotation (list[..]) requires !2, 3.9

Minimum required versions: 3.9
Incompatible versions:     2

Expected behavior
Minimum version should be Python 3.7

Environment:

  • Vermin latest version (1.1.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions