Skip to content

Commit

Permalink
make it compatible with python3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
rsanchezgarc committed Jul 11, 2022
1 parent a60461e commit f3aa157
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ jobs:
ls
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Test package
run: |
python -m pip install -r requirements.txt
python -m unittest discover && echo "Tests Exit code $?"
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
Expand Down
4 changes: 2 additions & 2 deletions argParseFromDoc/argParseFromDoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def fromTypeToTypeFun(docStringElem):
#Check optional or union
if isinstance(docuType, _GenericAlias):
complex_type = docuType._name
if complex_type is None: #Union type, or Literal type
if complex_type == "Optional" or complex_type is None: #Union type, or Literal type, depending on the version
if docuType.__origin__ == typing.Union:
# check if we are in Union[XXX,NoneType]
inner_args = docuType.__args__
Expand All @@ -70,7 +70,7 @@ def fromTypeToTypeFun(docStringElem):

if isinstance(docuType, _GenericAlias):
complex_type = docuType._name
if complex_type is None: #Union type, or Literal type
if complex_type == "Literal" or complex_type is None: #Union type, or Literal type, depending on the version
if docuType.__origin__ == getattr(typing, "Literal", "Literal"):
_type = tuple(docuType.__args__)
return _type, nargs, required
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import setuptools
from setuptools import setup

VERSION="0.0.3"
VERSION="0.0.4"

def readme():
readmePath = os.path.abspath(os.path.join(__file__, "..", "README.md"))
Expand Down

0 comments on commit f3aa157

Please sign in to comment.