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

Fix Python3.11 tests #5196

Merged
merged 3 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
14 changes: 12 additions & 2 deletions qa/nose_wrapper/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,24 @@
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.argv[0].endswith('__main__.py'):
sys.argv[0] = '%s -m nose_wrapper' % sys.executable
if sys.version_info >= (3, 11):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Total nitpick: some empty lines to separate those rather unrelated workarounds.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


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

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