Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python 3.9 feature not detected: argparse.BooleanOptionalAction #168

Closed
ollieparanoid opened this issue Mar 26, 2023 · 1 comment · Fixed by #173
Closed

python 3.9 feature not detected: argparse.BooleanOptionalAction #168

ollieparanoid opened this issue Mar 26, 2023 · 1 comment · Fixed by #173

Comments

@ollieparanoid
Copy link

Describe the bug
argparse.BooleanOptionalAction is a Python 3.9 feature, but vermin doesn't detect it.

To Reproduce

Example code:

#!/usr/bin/env python3
ret = subparser.add_parser("qemu")
ret.add_argument("--efi", action=argparse.BooleanOptionalAction, help="...")

Running vermin -t=3.7- on it doesn't report that argparse.BooleanOptionalAction is only available in Python >=3.9.

See https://docs.python.org/3/library/argparse.html.

Expected behavior
Report that argparse.BooleanOptionalAction is only available in Python >=3.9.

Environment (please complete the following information):
vermin version: 1.5.1

@netromdk
Copy link
Owner

netromdk commented Apr 4, 2023

Thanks for reporting this.

I already have the rule in place for argparse.BooleanOptionalAction.
But I actually found an error in the visitation of the AST where keyword values wouldn't be traversed correctly!

By fixing that, it reports the following for your input file (-vvv -t=3.7-):

!2, 3.9      /tmp/test.py
  L3: 'argparse.BooleanOptionalAction' member requires !2, 3.9

Minimum required versions: 3.9
Incompatible versions:     2
Target versions not met:   3.7-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants