2022-01-16 16:12:40 +00:00
|
|
|
import nox
|
2023-07-22 20:38:57 +00:00
|
|
|
from nox.command import CommandFailed
|
2022-01-16 16:12:40 +00:00
|
|
|
|
2022-01-22 23:15:36 +00:00
|
|
|
nox.options.sessions = ["test"]
|
|
|
|
|
|
|
|
|
|
|
|
@nox.session
|
2023-07-22 20:38:57 +00:00
|
|
|
def test(session: nox.Session):
|
2023-12-04 19:03:56 +00:00
|
|
|
session.install(".[dev]")
|
2023-07-22 20:38:57 +00:00
|
|
|
try:
|
|
|
|
session.install("--only-binary=numpy", "numpy>=1.16")
|
|
|
|
except CommandFailed:
|
|
|
|
# No binary wheel for numpy available on this platform
|
|
|
|
pass
|
2022-01-22 23:15:36 +00:00
|
|
|
session.install("maturin")
|
|
|
|
session.run_always("maturin", "develop")
|
2022-10-25 06:23:21 +00:00
|
|
|
session.run("pytest", *session.posargs)
|
2022-01-22 23:15:36 +00:00
|
|
|
|
2022-01-16 16:12:40 +00:00
|
|
|
|
|
|
|
@nox.session
|
2023-07-22 20:38:57 +00:00
|
|
|
def bench(session: nox.Session):
|
2023-12-04 19:03:56 +00:00
|
|
|
session.install(".[dev]")
|
2022-02-05 09:39:56 +00:00
|
|
|
session.run("pytest", "--benchmark-enable", "--benchmark-only", *session.posargs)
|