Skip to content

Commit

Permalink
test against different numpy versions (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbyrohl authored Aug 23, 2024
1 parent 8c76b8b commit 1be69a8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
23 changes: 19 additions & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

# waiting for https://github.com/python-poetry/poetry-plugin-export/pull/286
# for now have to fall back to nox rather than nox_poetry
from nox import Session, session
from nox import Session, parametrize, session

# from nox_poetry import Session, session

python_versions = ["3.12", "3.11", "3.10", "3.9"]
python_dflt = "3.10"
numpy_versions = ["1.21", "1.26", "2.0"]


@session(python=python_versions)
def tests(session):
def tests_base(session):
session.install("coverage[toml]", "pytest", "pytest-mock", "pygments")
session.install(".")
try:
Expand All @@ -23,13 +23,28 @@ def tests(session):
"pytest",
"-v",
"--junitxml=report.xml",
*session.posargs
*session.posargs,
)
finally:
if session.interactive:
session.notify("coverage", posargs=[])


@session(python=python_versions)
def tests(session):
tests_base(session)


@session(python=python_versions)
@parametrize("numpy", numpy_versions)
def tests_numpy_versions(session, numpy):
# Check for unspoorted combination of Python >3.10 with and NumPy 1.21 and skip it
if session.python in ["3.11", "3.12"] and numpy == "1.21":
session.skip("Skipping NumPy 1.21 on Python > 3.10")
session.install(f"numpy=={numpy}")
tests_base(session)


@session(python=python_dflt)
def coverage(session: Session) -> None:
args = session.posargs or ["report"]
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ readme = "README.md"

[tool.poetry.dependencies]
python = "^3.9"
numpy = ">=1.21"
numpy = [
{version = "^1.21", python = "<3.11"},
{version = ">=1.26", python = ">=3.11"}
]
# need dask>2024.4.1 for py>=3.11.9 (https://github.com/dask/dask/pull/11035)
dask = [{extras = ["array", "dataframe", "distributed"], version = ">=2023", python = "<3.11.9"},
{extras = ["array", "dataframe", "distributed"], version = ">=2024.4.1", python = ">=3.11.9"}
Expand Down

0 comments on commit 1be69a8

Please sign in to comment.