-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
364 lines (304 loc) · 10.2 KB
/
pyproject.toml
File metadata and controls
364 lines (304 loc) · 10.2 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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
[build-system]
requires = [
"hatchling>=1.5.0",
"jupyterlab>=4.0.0,<5",
"hatch-nodejs-version>=0.3.2",
]
build-backend = "hatchling.build"
[project]
name = "arbalister"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.12"
classifiers = [
"Framework :: Jupyter",
"Framework :: Jupyter :: JupyterLab",
"Framework :: Jupyter :: JupyterLab :: 4",
"Framework :: Jupyter :: JupyterLab :: Extensions",
"Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dynamic = ["version", "description", "authors", "urls", "keywords"]
dependencies = ["jupyter_server>=2.4.0,<3", "pyarrow>=20.0", "datafusion>=40.0"]
[project.optional-dependencies]
sqlite = ["adbc_driver_manager", "adbc_driver_sqlite"]
[tool.hatch.version]
source = "nodejs"
[tool.hatch.metadata.hooks.nodejs]
fields = ["description", "authors", "urls", "keywords"]
[tool.hatch.build.targets.sdist]
artifacts = ["arbalister/labextension"]
exclude = [".github", "binder"]
[tool.hatch.build.targets.wheel.shared-data]
"arbalister/labextension" = "share/jupyter/labextensions/arbalister"
"install.json" = "share/jupyter/labextensions/arbalister/install.json"
"jupyter-config/server-config" = "etc/jupyter/jupyter_server_config.d"
[tool.hatch.build.hooks.version]
path = "arbalister/_version.py"
[tool.hatch.build.hooks.jupyter-builder]
dependencies = ["hatch-jupyter-builder>=0.5"]
build-function = "hatch_jupyter_builder.npm_builder"
ensured-targets = [
"arbalister/labextension/static/style.js",
"arbalister/labextension/package.json",
]
skip-if-exists = ["arbalister/labextension/static/style.js"]
[tool.hatch.build.hooks.jupyter-builder.build-kwargs]
build_cmd = "build:prod"
npm = ["jlpm"]
[tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs]
build_cmd = "install:extension"
npm = ["jlpm"]
source_dir = "src"
build_dir = "arbalister/labextension"
[tool.jupyter-releaser.options]
version-cmd = "hatch version"
release-message = "release: Release {version}"
[tool.jupyter-releaser.hooks]
before-build-npm = [
"python -m pip install 'jupyterlab>=4.0.0,<5'",
"jlpm",
"jlpm build:prod",
]
before-build-python = ["jlpm clean:all"]
[tool.check-wheel-contents]
ignore = ["W002"]
[tool.ruff]
line-length = 110
target-version = "py312"
extend-exclude = ["arbalister/_version.py"]
[tool.ruff.lint]
select = ["E", "W", "F", "B", "C90", "I", "YTT", "PT", "D"]
ignore = [
"D100", # Module docstrings
"D107", # Magic methods docstring
"D203", # Blank line after class convention is D211
"D213", # Docstring summary convention is D212
]
[tool.mypy]
strict = true
[[tool.mypy.overrides]]
module = ["pyarrow.*", "jupyterlab.*"]
ignore_errors = true
ignore_missing_imports = true
[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["osx-64", "osx-arm64", "linux-64", "win-64"]
[tool.pixi.environments]
default = { solve-group = "default" }
dev = { features = ["dev", "test"], solve-group = "default" }
pkg = { features = ["pkg"], solve-group = "default" }
[tool.pixi.dependencies]
python = "3.12.*"
nodejs = "*"
# Duplicate pyproject dependencies to resolve them with pixi
jupyter_server = "*"
pyarrow = "*"
datafusion = "*"
# Optional dependencies
adbc-driver-manager = "*"
adbc-driver-sqlite = "*"
[tool.pixi.pypi-dependencies]
arbalister = { path = ".", editable = true }
[tool.pixi.feature.test.dependencies]
coverage = "*"
avro = ">=1.10"
pytest = ">=8.3.0"
pytest-asyncio = "*"
pytest-cov = "*"
pytest-jupyter-server = ">=0.6.0"
ruff = ">=0.4.7"
mypy = ">=1.11.0"
biome = ">=2.3"
pre-commit = ">=3.8.0"
yamlfmt = ">=0.20"
taplo = ">=0.9.2"
typos = ">=1.31.2"
faker = "*"
# Formatters
[tool.pixi.feature.test.tasks.fmt-ruff]
cmd = "ruff format"
description = "Format Python files with ruff."
[tool.pixi.feature.test.tasks.fmt-biome]
cmd = "biome format --write"
description = "Format JS/TS/CSS files with biome."
[tool.pixi.feature.test.tasks.fmt-yamlfmt]
args = [{ arg = "path", default = "." }]
cmd = "yamlfmt {{ path }}"
description = "Format Yaml files with yamlfmt."
[tool.pixi.feature.test.tasks.fmt-taplo]
cmd = "taplo format pyproject.toml"
description = "Format TOML files with taplo."
[tool.pixi.feature.test.tasks.fmt]
depends-on = [
{ task = "fmt-ruff" },
{ task = "fmt-biome" },
{ task = "fmt-yamlfmt" },
{ task = "fmt-taplo" },
]
description = "Run all code formatters."
# Checkers
[tool.pixi.feature.test.tasks.check-ruff]
cmd = "ruff check --extend-exclude '*/jupyter_server_test_config.py' --fix --unsafe-fixes"
description = "Check Python code with ruff."
[tool.pixi.feature.test.tasks.check-mypy]
cmd = "python -m mypy arbalister/ data/"
description = "Check Python typing with MyPy."
[tool.pixi.feature.test.tasks.check-biome]
# TODO Add stylelint ?
cmd = "biome check --write --error-on-warnings"
description = "Check JS/TS/CSS code with biome."
[tool.pixi.feature.test.tasks.check-typescript]
cmd = "npx --no tsc --noEmit && echo Typescript OK"
description = "Check TS code with typescript."
[tool.pixi.feature.test.tasks.check-typos]
cmd = "typos --write-changes"
description = "Check for English typos with typos."
[tool.pixi.feature.test.tasks.check]
depends-on = [
{ task = "check-ruff" },
{ task = "check-mypy" },
{ task = "check-biome" },
{ task = "check-typescript" },
{ task = "check-typos" },
]
description = "Run all code checks."
# Tests
[tool.pixi.feature.test.tasks.test-pytest]
cmd = "python -m pytest"
description = "Test server extension with pytest."
[tool.pixi.feature.test.tasks.test-jest]
cmd = "npx --no jest --coverage"
description = "Test client extension with Jest."
# UI-tests
[tool.pixi.feature.test.tasks.playwright]
cwd = "ui-tests/"
cmd = "jlpm playwright"
description = "Execute playwright commands"
depends-on = [
{ task = "jlpm-build", args = ["prod"] },
"install-ui-tests",
"install-browsers",
]
[tool.pixi.feature.test.tasks.test-ui]
description = "Test the extension UI with playwright."
depends-on = [
{ task = "jlpm-build", args = ["prod"] },
"install-ui-tests",
"install-browsers",
{ task = "playwright", args = ["test"] },
]
[tool.pixi.feature.dev.tasks.jlpm-ui]
description = "Run Jupyter lab package manager inside the UI test directory."
cwd = "ui-tests/"
cmd = "jlpm"
[tool.pixi.feature.test.tasks.test]
depends-on = ["test-pytest", "test-jest", "test-ui"]
description = "Run all tests."
# All
[tool.pixi.feature.test.tasks.ci]
depends-on = ["check", "test"]
description = "Run all formatters, code checks, and tests."
[tool.pixi.feature.dev.dependencies]
curl = "*"
jupyterlab = ">=4.4"
jupyterhub = "*"
jupyterlab-lsp = "*"
python-lsp-server-base = ">=1.11.0"
python-lsp-ruff = ">=2.2.1"
pylsp-mypy = ">=0.6.8"
vscode-langservers-extracted = ">=4.10"
typescript-language-server = ">=5.1"
typos-lsp = "*"
commitlint-rs = "*"
# Data generation
[tool.pixi.feature.dev.tasks.gen-data]
cmd = """
python data/generate.py batch \
--num-rows 1_000_000 \
-o data/gen/test.avro \
-o data/gen/test.csv \
-o data/gen/test.ipc \
-o data/gen/test.orc \
-o data/gen/test.parquet \
-o data/gen/test.sqlite \
"""
outputs = ["data/gen/**/test.*"]
description = """Generate different data files to use in development in data/gen."""
[tool.pixi.feature.dev.tasks.gen-data-large]
cmd = """
python data/generate.py coordinate \
--output-file data/gen/large.parquet \
--num-rows 100_000_000 \
--num-cols 100 \
"""
outputs = ["data/gen/**/large.parquet"]
description = """Generate a large parquet file."""
[tool.pixi.feature.dev.tasks.fetch-data]
cmd = """
mkdir -p data/samples/ && \
curl -L -o data/samples/simple-stories.parquet \
https://huggingface.co/datasets/SimpleStories/SimpleStories/resolve/main/processed.parquet && \
curl -L -o data/samples/chinook.sqlite \
https://github.com/lerocha/chinook-database/releases/download/v1.4.5/Chinook_Sqlite.sqlite && \
curl -L -o data/samples/linkedIn.csv \
https://huggingface.co/datasets/datastax/linkedin_job_listings/resolve/main/postings.csv
"""
outputs = ["data/samples/*"]
description = "Download different data files from the Internet."
# Setup
[tool.pixi.feature.dev.tasks.jlpm-install]
cmd = "jlpm install"
description = "Install client-side required NPM packages."
inputs = ["package.json", "yarn.lock"]
outputs = [".yarn/install-state.gz"]
[tool.pixi.feature.dev.tasks.jlpm-build]
depends-on = ["jlpm-install"]
args = [{ arg = "target", default = "" }]
cmd = "jlpm build{{ ':' if target | length > 0 }}{{ target }}"
description = "Build Arbalister client package."
inputs = ["src/", "style/"]
[tool.pixi.feature.dev.tasks.install-dev]
depends-on = ["jlpm-build"]
cmd = "jupyter labextension develop . --overwrite"
description = "Install extension in developer mode."
[tool.pixi.feature.dev.tasks.serve-dev]
cmd = "jupyter lab"
depends-on = ["install-dev"]
description = "Launch JupyterLab with the current extension installed."
[tool.pixi.feature.dev.tasks.serve-hub-dev]
cmd = "jupyterhub --no-db --JupyterHub.Authenticator.allow_all=true"
depends-on = ["install-dev"]
description = "Launch JupyterHub with the current extension installed."
[tool.pixi.feature.dev.tasks.install-ui-tests]
cwd = "ui-tests"
cmd = "jlpm install"
description = "Install NPM packages needed by UI tests."
inputs = ["ui-tests/package.json", "ui-tests/yarn.lock"]
outputs = ["ui-tests/.yarn/install-state.gz"]
[tool.pixi.feature.dev.tasks.install-browsers]
# The command is already smart enough to avoid downloading again
cwd = "ui-tests"
cmd = "jlpm playwright install"
description = "Install web browsers though playwright."
[tool.pixi.feature.dev.tasks]
jlpm = { cmd = "jlpm", description = "Run Jupyter lab package manager." }
jlpm-watch = "jlpm run watch"
pre-commit = { cmd = "pre-commit", description = "Run pre-commit executable." }
commitlint = "commitlint --config dev/commitlint.yml"
jupyter = { cmd = "jupyter", description = "Run jupyter." }
labextension = "jupyter labextension"
[tool.pixi.feature.pkg.dependencies]
python-build = "*"
# Override build-system
hatchling = ">=1.5.0"
jupyterlab = ">=4.0.0,<5"
hatch-nodejs-version = ">=0.3.2"
hatch-jupyter-builder = ">=0.5"
[tool.pixi.feature.pkg.tasks.build]
cmd = "python -m build -nx"