Skip to content

Commit

Permalink
add tox.ini and update build/test requirements (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
tazend committed Dec 11, 2023
1 parent f098efb commit 634510b
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ pyslurm.egg-info
# IDE files
.vscode
.idea

.python-version
.tox
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions build_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
setuptools>=59.2.0
wheel>=0.37.0
Cython>=0.29.36
packaging>=21.3
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
requires = [
"setuptools>=59.2.0",
"wheel>=0.37.0",
"Cython>=0.29.30",
"Cython>=0.29.36",
"packaging>=21.3"
]

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions test_requirements.txt
Original file line number Diff line number Diff line change
@@ -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
66 changes: 66 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 634510b

Please sign in to comment.