Skip to content

Commit

Permalink
Fix Python3.11 tests
Browse files Browse the repository at this point in the history
- moves to a newer PaddlePaddle version that supports Python3.11
- moves to a newer OpenCV version that supports Python3.11
- fixes deprecated the usage of inspect.getargspec on nose

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
  • Loading branch information
JanuszL committed Nov 24, 2023
1 parent ccfced4 commit c640905
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dali/python/nvidia/dali/_autograph/operators/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def assert_stmt(expression1, expression2):
"""
if not callable(expression2):
raise ValueError('{} must be a callable'.format(expression2))
args, _, keywords, _ = inspect.getargspec(expression2)
args, _, keywords, _, _, _, _ = inspect.getfullargspec(expression2)
if args or keywords:
raise ValueError('{} may not have any arguments'.format(expression2))

Expand Down
13 changes: 11 additions & 2 deletions qa/nose_wrapper/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,23 @@
import nose.loader
import nose.suite
import nose.plugins.attrib
import inspect

if sys.version_info >= (3, 10) and not hasattr(collections, "Callable"):
nose.case.collections = collections.abc
nose.inspector.collections = collections.abc
nose.loader.collections = collections.abc
nose.suite.collections = collections.abc
nose.plugins.attrib.collections = collections.abc
if sys.version_info >= (3, 11):

def legacy_getargspec(fun):
args, varargs, varkw, defaults, _, _, _ = inspect.getfullargspec(fun)
return (args, varargs, varkw, defaults)

inspect.getargspec = legacy_getargspec

if sys.argv[0].endswith('__main__.py'):
sys.argv[0] = '%s -m nose_wrapper' % sys.executable
if sys.argv[0].endswith("__main__.py"):
sys.argv[0] = "%s -m nose_wrapper" % sys.executable

run_exit()
4 changes: 2 additions & 2 deletions qa/setup_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def get_pyvers_name(self, url, cuda_version):


all_packages = [PlainPackage("numpy", [">=1.17,<1.24"]),
PlainPackage("opencv-python", [PckgVer("4.5.4.60", dependencies=["numpy<1.24"])]),
PlainPackage("opencv-python", [PckgVer("4.8.1.78", dependencies=["numpy<1.24"])]),
CudaPackage("cupy",
{"118": [PckgVer("12.2.0", python_min_ver="3.8",
dependencies=["numpy<1.24"])]},
Expand All @@ -485,7 +485,7 @@ def get_pyvers_name(self, url, cuda_version):
dependencies=["numpy<1.24"])]},
extra_index="https://download.pytorch.org/whl/cu{cuda_v}/"),
CudaPackageExtraIndex("paddlepaddle-gpu",
{"110": [PckgVer("2.5.0.post118",
{"110": [PckgVer("2.5.2.post117",
dependencies=["protobuf<4", "numpy<1.24"])]},
links_index="https://www.paddlepaddle.org.cn/"
"whl/linux/mkl/avx/stable.html"),
Expand Down

0 comments on commit c640905

Please sign in to comment.