mirror of
https://github.com/ihabunek/toot.git
synced 2024-09-22 04:25:55 -04:00
Fix vermin checks
This commit is contained in:
parent
f3439ad30d
commit
3cd13f6885
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -25,7 +25,7 @@ jobs:
|
|||||||
pytest
|
pytest
|
||||||
- name: Validate minimum required version
|
- name: Validate minimum required version
|
||||||
run: |
|
run: |
|
||||||
vermin --target=3.6 --no-tips .
|
vermin --target=3.7 --no-tips .
|
||||||
- name: Check style
|
- name: Check style
|
||||||
run: |
|
run: |
|
||||||
flake8
|
flake8
|
||||||
|
2
Makefile
2
Makefile
@ -10,7 +10,7 @@ publish :
|
|||||||
test:
|
test:
|
||||||
pytest -v
|
pytest -v
|
||||||
flake8
|
flake8
|
||||||
vermin --target=3.6 --no-tips --violations --exclude-regex venv/.* .
|
vermin --target=3.7 --no-tips --violations --exclude-regex venv/.* .
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
coverage erase
|
coverage erase
|
||||||
|
@ -38,8 +38,8 @@ __description__ = 'Python typing compatibility library'
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
# Python >=3.8 should have these functions already
|
# Python >=3.8 should have these functions already
|
||||||
from typing import get_args as _get_args
|
from typing import get_args as _get_args # novermin
|
||||||
from typing import get_origin as _get_origin
|
from typing import get_origin as _get_origin # novermin
|
||||||
except ImportError:
|
except ImportError:
|
||||||
if hasattr(typing, '_GenericAlias'): # Python 3.7
|
if hasattr(typing, '_GenericAlias'): # Python 3.7
|
||||||
|
|
||||||
@ -85,8 +85,8 @@ except ImportError:
|
|||||||
while tp.__origin__ is not None:
|
while tp.__origin__ is not None:
|
||||||
tp = tp.__origin__
|
tp = tp.__origin__
|
||||||
return _resolve_via_mro(tp)
|
return _resolve_via_mro(tp)
|
||||||
elif hasattr(typing, '_Literal') and isinstance(tp, typing._Literal):
|
elif hasattr(typing, '_Literal') and isinstance(tp, typing._Literal): # novermin
|
||||||
return typing.Literal
|
return typing.Literal # novermin
|
||||||
|
|
||||||
def _normalize_arg(args):
|
def _normalize_arg(args):
|
||||||
if isinstance(args, tuple) and len(args) > 1:
|
if isinstance(args, tuple) and len(args) > 1:
|
||||||
|
Loading…
Reference in New Issue
Block a user