pyo3/pytests/noxfile.py

22 lines
578 B
Python
Raw Normal View History

2022-01-16 16:12:40 +00:00
import nox
import platform
2022-01-16 16:12:40 +00:00
2022-01-22 23:15:36 +00:00
nox.options.sessions = ["test"]
@nox.session
def test(session):
session.install("-rrequirements-dev.txt")
if platform.system() == "Linux" and platform.python_implementation() == "CPython":
session.install("numpy>=1.16")
2022-01-22 23:15:36 +00:00
session.install("maturin")
session.run_always("maturin", "develop")
session.run("pytest", *session.posargs)
2022-01-22 23:15:36 +00:00
2022-01-16 16:12:40 +00:00
@nox.session
2022-01-22 23:15:36 +00:00
def bench(session):
2022-01-16 16:12:40 +00:00
session.install("-rrequirements-dev.txt")
2022-01-22 23:15:36 +00:00
session.install(".")
session.run("pytest", "--benchmark-enable", "--benchmark-only", *session.posargs)