From 634510b42fe053baa6245b2ae349a65ff6ac87db Mon Sep 17 00:00:00 2001 From: tazend <75485188+tazend@users.noreply.github.com> Date: Mon, 11 Dec 2023 22:35:16 +0100 Subject: [PATCH] add tox.ini and update build/test requirements (#329) --- .gitignore | 3 ++ README.md | 2 +- build_requirements.txt | 4 +++ pyproject.toml | 2 +- setup.py | 2 +- test_requirements.txt | 7 +++-- tox.ini | 66 ++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 80 insertions(+), 6 deletions(-) create mode 100644 build_requirements.txt create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore index ef44eef6..13009fa3 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,6 @@ pyslurm.egg-info # IDE files .vscode .idea + +.python-version +.tox diff --git a/README.md b/README.md index 1db47f45..93f5552c 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ pyslurm is the Python client library for the [Slurm Workload Manager](https://sl * [Slurm](https://slurm.schedmd.com) - Slurm shared library and header files * [Python](https://www.python.org) - >= 3.6 -* [Cython](https://cython.org) - >= 0.29.30 but < 3.0 +* [Cython](https://cython.org) - >= 0.29.36 This Version is for Slurm 23.02.x diff --git a/build_requirements.txt b/build_requirements.txt new file mode 100644 index 00000000..b0b6f4e2 --- /dev/null +++ b/build_requirements.txt @@ -0,0 +1,4 @@ +setuptools>=59.2.0 +wheel>=0.37.0 +Cython>=0.29.36 +packaging>=21.3 diff --git a/pyproject.toml b/pyproject.toml index 862c77ae..7d73cf81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "setuptools>=59.2.0", "wheel>=0.37.0", - "Cython>=0.29.30", + "Cython>=0.29.36", "packaging>=21.3" ] diff --git a/setup.py b/setup.py index a50603fa..36ea6523 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ from setuptools._vendor.packaging.version import Version -CYTHON_VERSION_MIN = "0.29.30" # Keep in sync with pyproject.toml +CYTHON_VERSION_MIN = "0.29.36" # Keep in sync with pyproject.toml SLURM_LIB = "libslurm" TOPDIR = Path(__file__).parent PYTHON_MIN_REQUIRED = (3, 6) diff --git a/test_requirements.txt b/test_requirements.txt index 9e2765ff..0e86be12 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -1,4 +1,5 @@ -cython>=0.29.30,<3.0 -wheel==0.37.0 -setuptools==59.2.0 pytest==7.1.2 +setuptools>=59.2.0 +wheel>=0.37.0 +Cython>=0.29.36 +packaging>=21.3 diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..1e922fb1 --- /dev/null +++ b/tox.ini @@ -0,0 +1,66 @@ +[tox] +skip_missing_interpreters=True +envlist = + py36 + py37 + py38 + py39 + py310 + py311 + py312 + + +[env] +passenv = + SLURM_LIB_DIR + SLURM_INCLUDE_DIR + SLURM_BUILD_JOBS + + +[testenv] +labels = test +deps = -r{toxinidir}/test_requirements.txt +passenv = {[env]passenv} +skip_install = true +commands = + {envpython} -V + cython -V + {envpython} {toxinidir}/setup.py build -j {env:SLURM_BUILD_JOBS:4} + {envpython} {toxinidir}/setup.py install + pytest tests/unit + + +[testenv:build-cy3x] +labels = build,cy3x +deps = -r{toxinidir}/build_requirements.txt +skip_install = true +passenv = {[env]passenv} +commands = + {envpython} -V + cython -V + {envpython} {toxinidir}/setup.py build -j {env:SLURM_BUILD_JOBS:4} + + +[testenv:build-cy29] +labels = build,cy29 +deps = + -r{toxinidir}/build_requirements.txt + Cython == 0.29.36 +passenv = {[env]passenv} +skip_install = true +commands = + {envpython} -V + cython -V + {envpython} {toxinidir}/setup.py build -j {env:SLURM_BUILD_JOBS:4} + + +[testenv:integration] +labels = test,integration +skip_install = true +passenv = {[env]passenv} +commands = + {envpython} -V + cython -V + {envpython} {toxinidir}/setup.py build -j {env:SLURM_BUILD_JOBS:4} + {envpython} {toxinidir}/setup.py install + pytest tests/integration