diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 7e08ee1..6eeb2fc 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -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: diff --git a/argParseFromDoc/argParseFromDoc.py b/argParseFromDoc/argParseFromDoc.py index cade386..a2e8fd9 100644 --- a/argParseFromDoc/argParseFromDoc.py +++ b/argParseFromDoc/argParseFromDoc.py @@ -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__ @@ -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 diff --git a/setup.py b/setup.py index 5d217ab..50c3af7 100644 --- a/setup.py +++ b/setup.py @@ -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"))