From 6374f8f82adb2b1c9f9b8368a3f02ca8de5744cc Mon Sep 17 00:00:00 2001 From: "Kaustubh R. Mote" Date: Tue, 16 Dec 2025 17:23:46 +0530 Subject: [PATCH 1/2] added noxfile.py for testing the codebase with multiple versions of python and numpy --- noxfile.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 noxfile.py diff --git a/noxfile.py b/noxfile.py new file mode 100644 index 00000000..4d00c492 --- /dev/null +++ b/noxfile.py @@ -0,0 +1,41 @@ +import nox + +PYTHON_NUMPY_MATRIX = { + "3.9": ["1.24", "1.25", "1.26", "2.0"], + "3.10": ["1.24", "1.25", "1.26", "2.0", "2.1", "2.2"], + "3.11": ["1.24", "1.25", "1.26", "2.0", "2.1", "2.2", "2.3"], + "3.12": ["1.26", "2.0", "2.1", "2.2", "2.3"], + "3.13": ["1.26", "2.0", "2.1", "2.2", "2.3"], + "3.14": ["2.0", "2.1", "2.2", "2.3"], +} + +ALL_NUMPY_VERSIONS = tuple(set(sum(PYTHON_NUMPY_MATRIX.values(), []))) + +DEPENDENCIES = ["pytest", "pluggy", "scipy"] + +@nox.session(python=list(PYTHON_NUMPY_MATRIX.keys())) +@nox.parametrize("numpy_version", ALL_NUMPY_VERSIONS) +def tests(session: nox.Session, numpy_version): + """ + Main test function + + Parameters + ---------- + session : nox.Session + current nox session + numpy_version : str + numpy version to test + + """ + py_version = session.python + if numpy_version not in PYTHON_NUMPY_MATRIX[py_version]: + session.skip(f"NumPy version '{numpy_version}' is not supported on Python {py_version}") + return + + numpy_dep = f"numpy=={numpy_version}.*" + session.install(".", numpy_dep, *DEPENDENCIES) + session.run( + "pytest", + "--ignore=nmrglue/util/xcpy_test.py", + *session.posargs + ) \ No newline at end of file From 0e9dcffe3395a5324e9b2457bca5d77b2271b624 Mon Sep 17 00:00:00 2001 From: "Kaustubh R. Mote" Date: Thu, 25 Dec 2025 09:12:16 +0530 Subject: [PATCH 2/2] added xmltodict (for rs2d.py), pytest-xdist for parallel testing, and python 3.8 with compatible numpy versions --- noxfile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index 4d00c492..f34995e4 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,6 +1,7 @@ import nox PYTHON_NUMPY_MATRIX = { + "3.8": ["1.23", "1.24"], "3.9": ["1.24", "1.25", "1.26", "2.0"], "3.10": ["1.24", "1.25", "1.26", "2.0", "2.1", "2.2"], "3.11": ["1.24", "1.25", "1.26", "2.0", "2.1", "2.2", "2.3"], @@ -11,7 +12,7 @@ ALL_NUMPY_VERSIONS = tuple(set(sum(PYTHON_NUMPY_MATRIX.values(), []))) -DEPENDENCIES = ["pytest", "pluggy", "scipy"] +DEPENDENCIES = ["pytest", "pytest-xdist", "pluggy", "scipy", "xmltodict"] @nox.session(python=list(PYTHON_NUMPY_MATRIX.keys())) @nox.parametrize("numpy_version", ALL_NUMPY_VERSIONS) @@ -38,4 +39,4 @@ def tests(session: nox.Session, numpy_version): "pytest", "--ignore=nmrglue/util/xcpy_test.py", *session.posargs - ) \ No newline at end of file + )