netromdk / vermin

Concurrently detect the minimum Python versions needed to run code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

typing.NamedTuple is classified as Python 3.11 feature

pyrco opened this issue · comments

commented

Describe the bug
In PR #124 (commit 9b2f3f3) typing.NamedTuple is added as a feature only present since Python 3.11. According to the Python documentation, NamedTuple has been a part of the typing module since its inception in Python 3.5.

To Reproduce
test.py

from typing import NamedTuple

class SomeTuple(NamedTuple):
    foo: int
    bar: str = "BAR"
$ vermin -vvvv -t 3.11- ./test.py 
Detecting python files..
Analyzing using 2 processes..
!2, 3.11     /home/user/src/fox/dissect-develop/github.com/netromdk/vermin/tv/test/test.py
  L1 C5: 'typing' module requires !2, 3.5
  L1 C5: 'typing.NamedTuple' member requires !2, 3.11
  L4: variable annotations require !2, 3.6
  L5: variable annotations require !2, 3.6

Tips:
- Generic or literal annotations might be in use. If so, try using: --eval-annotations
  But check the caveat section: https://github.com/netromdk/vermin#caveats
- You're using potentially backported modules: typing
  If so, try using the following for better results: --backport typing
- Since '# novm' or '# novermin' weren't used, a speedup can be achieved using: --no-parse-comments
(disable using: --no-tips)

Minimum required versions: 3.11
Incompatible versions:     2

Expected behavior
Vermin should allow the use of typing.NamedTuple in Python 3.5 or higher

Environment (please complete the following information):

  • Vermin version 1.5.0

Thank you for finding this!

FYI: I'm releasing v1.5.1 within the next few days - waiting to see if more stuff needs to be fixed also.