forked from google/neuroglancer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnoxfile.py
More file actions
195 lines (175 loc) · 4.55 KB
/
noxfile.py
File metadata and controls
195 lines (175 loc) · 4.55 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
import os
import nox
nox.options.default_venv_backend = "uv"
nox.options.reuse_existing_virtualenvs = True
nox.options.error_on_external_run = True
@nox.session
def lint(session):
session.run_install(
"uv",
"sync",
"--only-group",
"ruff",
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
)
session.run("ruff", "check", ".", *session.posargs)
@nox.session
def format(session):
session.run_install(
"uv",
"sync",
"--only-group",
"ruff",
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
)
session.run("ruff", "format", ".", *session.posargs)
@nox.session
def mypy(session):
session.run_install(
"uv",
"sync",
"--no-install-workspace",
"--no-default-groups",
"--group",
"mypy",
"--group",
"dev",
"--extra",
"webdriver",
"--extra",
"osteoid",
"--group",
"test",
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
)
session.run("mypy", ".", *session.posargs)
@nox.session
def ty(session):
session.run_install(
"uv",
"sync",
"--no-install-workspace",
"--no-default-groups",
"--group",
"ty",
"--group",
"dev",
"--extra",
"webdriver",
"--group",
"--extra",
"osteoid",
"test",
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
)
session.run("ty", "check", *session.posargs)
@nox.session
def docs(session: nox.Session):
session.run_install(
"uv",
"sync",
"--no-default-groups",
"--group",
"docs",
"--extra",
"osteoid",
"--no-install-workspace",
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
)
session.run(
"sphinx-build",
"docs",
"dist/docs",
"-E",
"-j",
"auto",
"-T",
"-W",
"--keep-going",
*session.posargs,
env={
"PYTHONPATH": os.path.join(os.path.dirname(__file__), "python"),
},
)
@nox.session
def test(session: nox.Session):
session.run_install(
"uv",
"sync",
"--no-default-groups",
"--group",
"test",
"--extra",
"webdriver",
"--no-editable",
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
)
session.chdir("python/tests")
session.run("pytest", "-vv", "-s", *session.posargs)
@nox.session
def test_xvfb(session: nox.Session):
session.run_install(
"uv",
"sync",
"--no-default-groups",
"--group",
"test",
"--extra",
"webdriver",
"--no-editable",
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
)
session.chdir("python/tests")
session.run(
"xvfb-run",
"-e",
"/dev/stderr",
"--auto-servernum",
"--server-args",
"-screen 0 1024x768x24",
"pytest",
"-vv",
"-s",
*session.posargs,
external=True,
env={"PATH": os.environ["PATH"]},
include_outer_env=False,
)
@nox.session
def test_editable(session: nox.Session):
session.run_install(
"uv",
"sync",
"--no-default-groups",
"--group",
"test",
"--extra",
"webdriver",
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
)
session.chdir("python/tests")
session.run("pytest", "-vv", "-s", "--skip-browser-tests", *session.posargs)
@nox.session(python=False)
def cibuildwheel(session: nox.Session):
session.run(
"uv",
"run",
"--only-group",
"cibuildwheel",
"cibuildwheel",
"--output-dir",
"dist",
*session.posargs,
env={
"CIBW_BUILD_FRONTEND": "build[uv]",
"CIBW_ARCHS_MACOS": "x86_64 arm64",
"CIBW_SKIP": "pp* *_i686 *-win32 *-musllinux* cp314* cp315*",
"CIBW_TEST_GROUPS": "test",
"CIBW_TEST_COMMAND": "python -m pytest {project}/python/tests -vv -s --skip-browser-tests",
"CIBW_MANYLINUX_X86_64_IMAGE": "manylinux_2_28",
# Assume the client bundle was already built. The github actions workflow builds
# the client with specific defines to include the build stamp, and that would be
# lost if setup.py rebuilds the client.
"CIBW_ENVIRONMENT": "NEUROGLANCER_PREBUILT_CLIENT=1",
},
)