From c6409056ad4870cddfcef9fca4fb3d41f27d3abb Mon Sep 17 00:00:00 2001 From: Janusz Lisiecki Date: Fri, 24 Nov 2023 09:13:48 +0100 Subject: [PATCH 1/3] Fix Python3.11 tests - 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 --- .../nvidia/dali/_autograph/operators/exceptions.py | 2 +- qa/nose_wrapper/__main__.py | 13 +++++++++++-- qa/setup_packages.py | 4 ++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/dali/python/nvidia/dali/_autograph/operators/exceptions.py b/dali/python/nvidia/dali/_autograph/operators/exceptions.py index 3eb39f380ab..356c393d259 100644 --- a/dali/python/nvidia/dali/_autograph/operators/exceptions.py +++ b/dali/python/nvidia/dali/_autograph/operators/exceptions.py @@ -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)) diff --git a/qa/nose_wrapper/__main__.py b/qa/nose_wrapper/__main__.py index b87339075eb..5f221de7261 100644 --- a/qa/nose_wrapper/__main__.py +++ b/qa/nose_wrapper/__main__.py @@ -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() diff --git a/qa/setup_packages.py b/qa/setup_packages.py index 96ad5b99786..371ab7cb7f7 100755 --- a/qa/setup_packages.py +++ b/qa/setup_packages.py @@ -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"])]}, @@ -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"), From 30ba983eb1e31b1f84bc2a5c9a3cad9015771001 Mon Sep 17 00:00:00 2001 From: Janusz Lisiecki Date: Fri, 24 Nov 2023 17:11:40 +0100 Subject: [PATCH 2/3] Review fixes Signed-off-by: Janusz Lisiecki --- dali/python/nvidia/dali/_autograph/operators/exceptions.py | 2 +- qa/nose_wrapper/__main__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dali/python/nvidia/dali/_autograph/operators/exceptions.py b/dali/python/nvidia/dali/_autograph/operators/exceptions.py index 356c393d259..ece48d299d9 100644 --- a/dali/python/nvidia/dali/_autograph/operators/exceptions.py +++ b/dali/python/nvidia/dali/_autograph/operators/exceptions.py @@ -45,7 +45,7 @@ def assert_stmt(expression1, expression2): """ if not callable(expression2): raise ValueError('{} must be a callable'.format(expression2)) - args, _, keywords, _, _, _, _ = inspect.getfullargspec(expression2) + args, _, keywords, *_ = inspect.getfullargspec(expression2) if args or keywords: raise ValueError('{} may not have any arguments'.format(expression2)) diff --git a/qa/nose_wrapper/__main__.py b/qa/nose_wrapper/__main__.py index 5f221de7261..aad8c0baabe 100644 --- a/qa/nose_wrapper/__main__.py +++ b/qa/nose_wrapper/__main__.py @@ -17,7 +17,7 @@ if sys.version_info >= (3, 11): def legacy_getargspec(fun): - args, varargs, varkw, defaults, _, _, _ = inspect.getfullargspec(fun) + args, varargs, varkw, defaults, *_ = inspect.getfullargspec(fun) return (args, varargs, varkw, defaults) inspect.getargspec = legacy_getargspec From c8399973abc2c36a7c2507446ee23dee6f6f050e Mon Sep 17 00:00:00 2001 From: Janusz Lisiecki Date: Fri, 24 Nov 2023 17:51:11 +0100 Subject: [PATCH 3/3] More fixes Signed-off-by: Janusz Lisiecki --- qa/nose_wrapper/__main__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qa/nose_wrapper/__main__.py b/qa/nose_wrapper/__main__.py index aad8c0baabe..1e9132a8a20 100644 --- a/qa/nose_wrapper/__main__.py +++ b/qa/nose_wrapper/__main__.py @@ -14,6 +14,7 @@ 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):