-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnoxfile.py
72 lines (53 loc) · 1.72 KB
/
noxfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
"""Nox sessions for linting, docs, and testing."""
from __future__ import annotations
from pathlib import Path
import nox
DIR = Path(__file__).parent.resolve()
nox.options.sessions = ["test"]
def _session_install_test_deps(session: nox.Session) -> None:
session.install("pytest", "hypothesis", "pytest-cov", "pytest-benchmark", "tomli")
@nox.session
def test(session: nox.Session) -> None:
"""Run the unit and regular tests."""
session.install("maturin")
_session_install_test_deps(session)
session.run("maturin", "develop", "--release", "--extras=test")
session.run("pytest")
@nox.session
def test_wheel(session: nox.Session) -> None:
"""Run the unit and regular tests."""
# install from dist...
session.install(
"utiles",
)
session.install("maturin")
_session_install_test_deps(session)
session.run("maturin", "build", "--release", "--extras=test")
session.run("pytest")
def _session_build_release(session: nox.Session) -> None:
session.install("maturin")
session.run("maturin", "build", "--release", "--strip")
@nox.session(
name="build-release",
)
def build_release(session: nox.Session) -> None:
"""Build the release."""
_session_build_release(session)
@nox.session
def bench(session: nox.Session) -> None:
"""Run the benchmarks."""
session.install("maturin")
_session_install_test_deps(session)
_session_build_release(session)
# install from wheel
session.install(
"utiles",
"--find-links",
"target/wheels",
"--no-index",
"--force-reinstall",
"--no-deps",
)
session.install("click", "mercantile", "pmtiles")
session.run("pytest")
session.run("pytest", "bench")