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.8 features used #2963

Closed
hjmjohnson opened this issue Dec 15, 2021 · 1 comment · Fixed by #2966
Closed

Python 3.8 features used #2963

hjmjohnson opened this issue Dec 15, 2021 · 1 comment · Fixed by #2966
Assignees
Labels
type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances
Milestone

Comments

@hjmjohnson
Copy link
Member

Description

This line of a previous patch
ed11fdc#diff-5a1d2bada267526be0b960bf7fa7a3ba81d8159fbe08b9c6aa983838a0cfb7e4R27

introduced the use of 'get_args' which is only supported in python 3.8 and above:

https://stackoverflow.com/a/50101934/485602

Steps to Reproduce

Run tests against python 3.7

Expected behavior

Tests pass

Actual behavior

2819: Test command: /Users/johnsonhj/Dashboard/src/ITK/cmake-debug-build/Wrapping/Generators/Python/itk/itkTestDriver "--add-before-env" "PYTHONPATH" "/Users/johnsonhj/Dashboard/src/ITK/cmake-debug-build/Wrapping/Generators/Python" "--add-before-env" "PYTHONPATH" "/Users/johnsonhj/Dashboard/src/ITK/cmake-debug-build/Wrapping/Generators/Python/itk" "--add-before-libpath" "/Users/johnsonhj/Dashboard/src/ITK/cmake-debug-build/Wrapping/Generators/Python/itk" "--compare" "/Users/johnsonhj/Dashboard/src/ITK/cmake-debug-build/Testing/Temporary/PythonMedianImageFilterTest.png" "/Users/johnsonhj/Dashboard/src/ITK/cmake-debug-build/ExternalData/Modules/Filtering/Smoothing/wrapping/test/Baseline/PythonMedianImageFilterTest.png" "/Users/johnsonhj/.venv/monai37/bin/python3" "/Users/johnsonhj/Dashboard/src/ITK/Modules/Filtering/Smoothing/wrapping/test/MedianImageFilterTest.py" "/Users/johnsonhj/Dashboard/src/ITK/cmake-debug-build/ExternalData/Testing/Data/Input/cthead1.png" "/Users/johnsonhj/Dashboard/src/ITK/cmake-debug-build/Testing/Temporary/PythonMedianImageFilterTest.png" "3"
2819: Test timeout computed to be: 1500
2819: Traceback (most recent call last):
2819:   File "/Users/johnsonhj/Dashboard/src/ITK/Modules/Filtering/Smoothing/wrapping/test/MedianImageFilterTest.py", line 27, in <module>
2819:     from typing import Sequence, TypeVar, get_type_hints, get_args, get_origin, Union
2819: ImportError: cannot import name 'get_args' from 'typing' (/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/typing.py)
2819: itkTestDriver: Process exited with return value: 1
Failed

Reproducibility

100%

Versions

Head of ITK on 2021-12-15

Environment

Mac with a pyhton 3.7 virutal environment

Additional Information

@hjmjohnson hjmjohnson added the type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances label Dec 15, 2021
@hjmjohnson hjmjohnson added this to the ITK 5.3.0 milestone Dec 15, 2021
@hjmjohnson
Copy link
Member Author

https://docs.python.org/3.8/library/typing.html

typing.get_args(tp)¶
[ CLIP --- ]
New in version 3.8.

hjmjohnson added a commit to hjmjohnson/ITK that referenced this issue Dec 15, 2021
Make code imported from Python 3.8+ features an
optional testcase.

Resolves: InsightSoftwareConsortium#2963.
hjmjohnson added a commit to hjmjohnson/ITK that referenced this issue Dec 15, 2021
Make code imported from Python 3.8+ features an
optional testcase.

Resolves: InsightSoftwareConsortium#2963.
hjmjohnson added a commit that referenced this issue Dec 15, 2021
Make code imported from Python 3.8+ features an
optional testcase.

Resolves: #2963.
hjmjohnson added a commit to hjmjohnson/ITK that referenced this issue Mar 6, 2022
Make code imported from Python 3.8+ features an
optional testcase.

Resolves: InsightSoftwareConsortium#2963.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants