-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpixi.toml
814 lines (729 loc) · 24.8 KB
/
pixi.toml
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
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
"$schema" = "https://pixi.sh/v0.39.3/schema/manifest/schema.json"
[project]
name = "urljsf"
channels = ["conda-forge"]
platforms = ["linux-64", "osx-64", "osx-arm64", "win-64"]
[tasks] # aliases ##############################################################
all = {description = """
run ALL tasks that would lead to a release""", depends-on = [
"schema",
"fix",
"lint",
"build",
"dist",
"test",
"docs",
"atest",
"check",
"report",
"dist-conda",
], cmd = "echo 🚢"}
fix = {description = """
apply ALL source formatters""", depends-on = [
"fix-toml",
"fix-dedupe",
"fix-mdlint",
"fix-prettier",
"fix-ruff",
"fix-robotidy",
], cmd = "echo 🧹"}
lint = {description = """
apply ALL static analysis tools""", depends-on = [
"lint-ruff",
"lint-yarn-audit",
"lint-mdlint",
"lint-prettier",
"lint-mypy",
"lint-robotidy",
"lint-robocop",
"lint-actionlint",
], cmd = "echo ⭐"}
build = {description = """
build ALL intermediate assets""", depends-on = [
"schema",
"build-demo",
"build-lib",
"build-app",
"build-static",
], cmd = "echo 🏗️"}
schema = {description = """
build ALL schema products""", depends-on = [
"schema-props",
"schema-json",
"schema-py",
"schema-ts",
], cmd = "echo 🧩"}
dist = {description = """
build ALL distributed artifacts""", depends-on = [
"dist-npm",
"dist-pypi",
"dist-check-wheel",
"dist-check-twine",
"dist-hash",
], cmd = "echo 📦"}
test = {description = """
run ALL unit tests""", depends-on = [
"dist-pypi",
"test-pytest",
"test-min-pytest",
], cmd = "echo 🧪"}
atest = {description = """
run ALL acceptance tests""", depends-on = ["atest-robot", "atest-nyc"], cmd = "echo 🤖"}
docs = {description = """
build all documentation""", depends-on = ["docs-sphinx"], cmd = "echo 🖨️"}
check = {description = """
perform ALL pre-release checks""", depends-on = [
"check-links",
"check-vale",
], cmd = "echo 🤓"}
# fragments ####################################################################
prettier-- = '''yarn prettier
--list-different
--cache
--cache-location build/.cache/prettier
"*.{yml,json,md}"
"{.github,docs,js,recipe,src,tests}/**/*.{md,json,yml,yaml,css,ts,tsx,ts,mjs}"'''
markdownlint-- = 'yarn markdownlint-cli2 "*.md" "{docs,tests,src,js,.github}/**/*.md"'
py-static-- = """rm -rf src/urljsf/_static/
&& cp -r js/dist/urljsf src/urljsf/_static/urljsf"""
platform-- = '''mkdir -p build
&& python -c 'import platform; u = platform.uname(); print(f"{u.system}-{u.machine}".lower())'
> build/platform.txt'''
pip-- = """rm -rf build/pip-freeze/$PIXI_ENVIRONMENT_NAME.txt
&& python -m pip install
-vv
--no-deps
--no-build-isolation
--disable-pip-version-check
--ignore-installed"""
pip-check-- = """python -m pip check
&& mkdir -p build/pip-freeze
&& python -m pip list --format=freeze
> build/pip-freeze/$PIXI_ENVIRONMENT_NAME.txt"""
pip-e-- = """pixi r pip-- -e .
&& pixi r pip-check--"""
pip-whl-- = """pixi r pip-- urljsf --find-links=dist --no-index
&& pixi r pip-check--"""
schema-vars-- = '''echo
PROPS_TS=$PIXI_PROJECT_ROOT/js/src/_props.ts
PROPS_JSON=$PIXI_PROJECT_ROOT/js/schema/v0/props.schema.json
UI_JSON=$PIXI_PROJECT_ROOT/js/schema/v0/ui.schema.json
SCHEMA_TOML=$PIXI_PROJECT_ROOT/js/schema/form.schema.toml
SCHEMA_JSON=$PIXI_PROJECT_ROOT/js/schema/v0/form.schema.json
SCHEMA_TS=$PIXI_PROJECT_ROOT/js/src/_schema.ts
SCHEMA_PY=$PIXI_PROJECT_ROOT/src/urljsf/_schema.py'''
schema-ts-json-- = """python scripts/schema.py $PROPS_TS $PROPS_JSON
&& python scripts/schema.py $PROPS_TS $UI_JSON
"""
schema-toml-json-- = "python scripts/schema.py $SCHEMA_TOML $SCHEMA_JSON $PROPS_JSON"
[feature.tasks-build.tasks]
schema-json-ts-- = "python scripts/schema.py $SCHEMA_JSON $SCHEMA_TS"
schema-json-py-- = "python scripts/schema.py $SCHEMA_JSON $SCHEMA_PY"
schema-all-- = '''pixi r schema-props
&& pixi r schema-toml-json--
&& pixi r schema-json-ts--
&& pixi r schema-json-py--
&& echo "OK"'''
# setup ########################################################################
[feature.tasks-build.tasks.build-yarn]
description = "- install nodejs-based dependencies"
cmd = "(cat node_modules/.skip-yarn && echo 'skipping yarn install') || yarn"
inputs = ["{yarn.lock,package.json,.yarnrc.yml}", "js/package.json"]
outputs = ["node_modules/.yarn-state.yml"]
[feature.tasks-dev.tasks.dev-pip]
description = "- install the editable python package for development"
cmd = "pixi r -e dev pip-e--"
inputs = ["pyproject.toml"]
outputs = ["build/pip-freeze/dev.txt"]
[feature.tasks-lint.tasks.lint-pip]
description = "- install the editable python package for linting"
cmd = "pixi r -e lint pip-e--"
inputs = ["pyproject.toml"]
outputs = ["build/pip-freeze/lint.txt"]
[feature.tasks-test.tasks.test-pip]
description = "- install the built python package for testing"
cmd = "pixi r -e test pip-whl--"
inputs = ["dist/*.whl"]
outputs = ["build/pip-freeze/test.txt"]
[feature.tasks-test-min.tasks.test-min-pip]
description = "- install the built python package for testing (oldest)"
cmd = "pixi r -e test-min pip-whl--"
inputs = ["dist/*.whl"]
outputs = ["build/pip-freeze/test-min.txt"]
[feature.tasks-docs.tasks.docs-pip]
description = "- install the built python package for docs"
cmd = "pixi r -e docs pip-whl--"
inputs = ["dist/*.whl"]
depends-on = ["dist-pypi"]
outputs = ["build/pip-freeze/docs.txt"]
# build ########################################################################
[feature.tasks-build.tasks.build-demo]
description = "- update the JSON and YAML demos"
cmd = "python scripts/demo.py"
inputs = ["js/demo/toml/", "scripts/demo.py"]
outputs = ["js/demo/{json,yaml}/"]
[feature.tasks-build.tasks.build-lib]
description = "- transpile TypeScript to JS"
cmd = "yarn build:lib"
depends-on = ["build-yarn", "schema-ts"]
inputs = ["node_modules/.yarn-state.yml", "js/src", "js/{package,tsconfig}.json"]
outputs = ["js/lib", "js/lib/index.js", "js/tsconfig.tsbuildinfo"]
[feature.tasks-build.tasks.build-app]
description = "- build the JS demo app"
cmd = "yarn build:app"
depends-on = ["build-lib", "build-demo"]
inputs = ["node_modules/.yarn-state.yml", "js/{lib,demo}/**", "js/webpack.config.mjs"]
outputs = ["js/dist"]
[feature.tasks-build.tasks.build-app-cov]
cmd = "export COV=1 && yarn build:app"
depends-on = ["build-lib", "build-demo"]
inputs = ["node_modules/.yarn-state.yml", "js/{lib,demo}/**", "js/webpack.config.mjs"]
outputs = ["build/dist-cov"]
[feature.tasks-build.tasks.build-static]
description = "- build the static assets for python distribution"
cmd = "pixi r py-static--"
depends-on = ["build-app"]
inputs = ["js/{dist,schema,lib}/**"]
outputs = ["src/urljsf/_static", "!**/demo/"]
[feature.tasks-build.tasks.dist-npm]
description = "- build the JS distributions for npmjs.org"
cmd = "mkdir -p dist && cd dist && npm pack ../js"
depends-on = ["build-app"]
inputs = ["node_modules/.yarn-state.yml", "js/{dist,LICENSE,README.md,package.json}"]
outputs = ["dist/*.tgz"]
[feature.tasks-build.tasks.dist-pypi]
description = "- build the Python distributions for pypi.org"
cmd = "pyproject-build . --no-isolation"
depends-on = ["build-static", "schema-py"]
inputs = ["{pyproject.toml,LICENSE,README.md}", "{src,tests}/", "!**/__pycache__"]
outputs = ["dist/*.{whl,tar.gz}"]
[feature.tasks-build.tasks.dist-conda]
description = "- build the conda distributions"
cmd = """
export URLJSF_GIT_DESCRIBE=$(git describe --tags)
&& rm -rf dist/noarch
&& mkdir -p build/rattler-build
&& rattler-build build
--experimental
--verbose
--channel conda-forge
--recipe recipe
--output-dir build/rattler-build
&& cp -r build/rattler-build/noarch dist/noarch
"""
depends-on = ["dist-pypi"]
inputs = ["{pyproject,pixi}.toml", "dist/*.tar.gz", "recipe"]
outputs = ["dist/noarch"]
[feature.tasks-build.tasks.dist-check-wheel]
description = "... check the built wheel"
cmd = "check-wheel-contents dist/*.whl"
depends-on = ["dist-pypi"]
inputs = ["dist/*.whl"]
[feature.tasks-build.tasks.dist-check-twine]
description = "... check the built distributions for PyPI"
cmd = "twine check --strict dist/*.whl dist/*.tar.gz"
depends-on = ["dist-pypi"]
inputs = ["dist/"]
[feature.tasks-build.tasks.dist-hash]
description = "- hash the built distributions"
cmd = """
rm -rf dist/SHA256SUMS
&& python -c 'from hashlib import sha256; from pathlib import Path; d = Path("dist"); [
print(f"{sha256(p.read_bytes()).hexdigest()} {p.relative_to(d).as_posix()}")
for p in sorted(d.rglob("*"))
if p.is_file() and p.name != "SHA256SUMS"
]'
> dist/SHA256SUMS
&& cat dist/SHA256SUMS"""
depends-on = ["dist-pypi", "dist-npm"]
inputs = ["dist", "!dist/SHA256SUMS"]
outputs = ["dist/SHA256SUMS"]
[feature.tasks-build.tasks.schema-props]
description = "- build JSON schema for rjsf form props"
cmd = "export $(pixi r schema-vars--) && pixi r schema-ts-json--"
inputs = ["js/src/_props.ts", "scripts/schema.py"]
outputs = ["js/schema/v0/props.schema.json"]
depends-on = ["build-yarn"]
[feature.tasks-build.tasks.schema-json]
description = "- build JSON schema from TOML"
cmd = "export $(pixi r schema-vars--) && pixi r schema-toml-json--"
inputs = [
"js/schema/form.schema.toml",
"js/schema/v0/props.schema.json",
"scripts/schema.py",
]
outputs = ["js/schema/v0/form.schema.json"]
depends-on = ["build-yarn"]
[feature.tasks-build.tasks.schema-ts]
description = "- build TypeScript types from JSON schema"
cmd = "export $(pixi r schema-vars--) && pixi r schema-json-ts--"
inputs = ["js/schema/v0/form.schema.json", "scripts/schema.py"]
outputs = ["js/src/_schema.ts"]
depends-on = ["schema-json"]
[feature.tasks-build.tasks.schema-py]
description = "- build python types from JSON schema"
cmd = "export $(pixi r schema-vars--) && pixi r schema-json-py--"
inputs = ["js/schema/v0", "scripts/schema.py", "scripts/jsonschema-gentypes.yaml"]
outputs = ["src/urljsf/_schema.py"]
depends-on = ["schema-json"]
# fix ##########################################################################
[feature.tasks-lint.tasks.fix-toml]
description = "- format all TOML with taplo"
cmd = """taplo fmt
--option=array_auto_collapse=false
--option=array_auto_expand=true
--option=compact_inline_tables=true
--option=column_width=88
--option=indent_string=" "
*.toml
docs/**/*.toml
js/demo/toml/*.toml
js/schema/*.toml
tests/fixtures/*/*/*/*.toml
atest/fixtures/*.toml"""
inputs = ["*.toml", "{atest,docs,js,src,tests}/**/*.toml"]
[feature.tasks-lint.tasks.fix-prettier]
description = "- format web-adjacent files with prettier"
cmd = "pixi r prettier-- --write"
depends-on = ["build-yarn"]
inputs = [
"*.{yml,json,md}",
"{.github,docs,js,recipe,src,tests}/**/*.{md,json,yml,yaml,css,ts,tsx,ts,mjs}",
"!src/**/_static",
]
[feature.tasks-lint.tasks.fix-mdlint]
description = "- format markdown with markdownlint"
cmd = "pixi r markdownlint-- --fix"
depends-on = ["build-yarn"]
inputs = ["*.{md,json}", "{docs,tests,src,js,.github}/**/*.md", "!src/**/_static"]
[feature.tasks-lint.tasks.fix-dedupe]
description = "- deduplicate JS dependencies with yarn-berry-deduplicate"
cmd = "yarn yarn-berry-deduplicate --fail --strategy fewer"
depends-on = ["build-yarn"]
inputs = ["node_modules/.yarn-state.yml", "package.json"]
outputs = ["yarn.lock"]
[feature.tasks-lint.tasks.fix-ruff]
description = "- fix python with ruff"
cmd = "ruff format && ruff check --fix-only"
inputs = ["pyproject.toml", "{atest,docs,scripts,src,tests}/**/*.py"]
[feature.tasks-lint.tasks.fix-robotidy]
cmd = "robotidy atest"
inputs = ["atest/**/*.{robot,resource}"]
# lint #########################################################################
[feature.tasks-lint.tasks.lint-actionlint]
description = "- check GitHub actions with actionlint"
cmd = "actionlint -shellcheck=shellcheck -pyflakes=pyflakes"
inputs = [".github/workflows"]
[feature.tasks-lint.tasks.lint-ruff]
description = "- check Python with ruff"
cmd = "ruff format --check && ruff check"
inputs = ["pyproject.toml", "{atest,docs,scripts,src,tests}/**/*.py"]
[feature.tasks-lint.tasks.lint-mypy]
description = "- check Python types with mypy"
cmd = "mypy -p urljsf"
inputs = ["pyproject.toml", "{src,tests}/**/*.py"]
depends-on = ["lint-pip"]
[feature.tasks-lint.tasks.lint-prettier]
description = "- check web-adjacent files with prettier"
cmd = "pixi r prettier--"
depends-on = ["build-yarn"]
inputs = [
"*.{yml,json,md}",
"{.github,docs,js,recipe,src,tests}/**/*.{md,json,yml,yaml,css,ts,tsx,ts,mjs}",
"!src/**/_static",
]
[feature.tasks-lint.tasks.lint-mdlint]
description = "- check markdown with markdownlint"
cmd = "pixi r markdownlint--"
depends-on = ["build-yarn"]
inputs = ["*.{md,json}", "{docs,tests,src,js,.github}/**/*.md", "!src/**/_static"]
[feature.tasks-lint.tasks.lint-yarn-audit]
description = "- check npm dependencies with yarn audit"
cmd = "yarn npm audit"
depends-on = ["build-yarn"]
inputs = ["yarn.lock"]
[feature.tasks-lint.tasks.lint-robotidy]
cmd = "robotidy atest --check"
inputs = ["atest/**/*.{robot,resource}"]
[feature.tasks-lint.tasks.lint-robocop]
cmd = "robocop atest"
inputs = ["atest/**/*.{robot,resource}", "pyproject.toml"]
# test #########################################################################
[feature.tasks-test.tasks.test-pytest]
description = "- test python with pytest"
cmd = """export PIXI_PLATFORM=$(cat build/platform.txt)
&& export COVERAGE_FILE=build/reports/test_pytest_$PIXI_PLATFORM.coverage
&& pytest
-n auto
--html=build/reports/test_pytest_$PIXI_PLATFORM.html
--self-contained-html
--cov-report=html:build/reports/test_pytest_htmlcov-$PIXI_PLATFORM/
--cov-report=term-missing:skip-covered
--cov=urljsf
--cov-branch
--cov-context=test
--no-cov-on-fail
--cov-fail-under=97"""
depends-on = ["test-pip", "platform--"]
inputs = ["tests/**/*.{py,rst,json}", "dist/*.whl"]
outputs = ["build/reports/test_*"]
[feature.tasks-test.tasks.report]
description = "- collect test reports"
cmd = "python scripts/report.py build/reports"
# test-min ##################################################################
[feature.tasks-test-min.tasks.test-min-pytest]
description = "- run tests against the oldest-supported dependencies"
cmd = """export PIXI_PLATFORM=$(cat build/platform.txt)
&& pytest
-n auto
--html=build/reports/test-min_pytest_$PIXI_PLATFORM.html
--self-contained-html"""
depends-on = ["test-min-pip", "platform--"]
inputs = ["tests/**/*.{py,rst,json}", "dist/*.whl"]
outputs = ["build/reports/test-min_*"]
# docs #########################################################################
[feature.tasks-docs.tasks.docs-scour]
description = "- optimize SVG for docs with scour"
cmd = """export SCOUR_ARGS="scour --enable-id-stripping --enable-comment-stripping"
&& cd docs/_static
&& $SCOUR_ARGS logo-inkscape.svg logo.svg
&& $SCOUR_ARGS icon-inkscape.svg icon.svg"""
inputs = ["docs/_static/*-inkscape.svg"]
outputs = ["docs/_static/*.svg", "docs/_static/*.svg", "!*inkscape.svg"]
[feature.tasks-docs.tasks.docs-cairo]
description = "- generate PNG for docs with cairosvg"
cmd = """cd docs/_static
&& cairosvg
icon.svg
--output-width 32
--format png
--output icon.png"""
inputs = ["docs/_static/icon.svg"]
outputs = ["docs/_static/icon.png"]
[feature.tasks-docs.tasks.docs-fetch]
cmd = """(
mkdir -p build
&& cd build
&& wget
--no-clobber
https://raw.githubusercontent.com/conda-forge/feedstock-outputs/single-file/feedstock-outputs.json
&& sleep 3
&& wget
--no-clobber
https://raw.githubusercontent.com/spdx/license-list-data/refs/heads/main/json/licenses.json
&& sleep 3
&& wget
--no-clobber
https://pixi.sh/v0.39.3/schema/manifest/schema.json
) || echo "well we tried" && exit 0
"""
outputs = ["build/{licenses,feedstock-outputs}.json"]
[feature.tasks-docs.tasks.docs-sphinx]
description = "- build docs with sphinx"
cmd = """export PYDEVD_DISABLE_FILE_VALIDATION=1
&& sphinx-build
--builder html
--color
--fail-on-warning
--fresh-env
--keep-going
--nitpicky
--show-traceback
--write-all
docs
build/docs"""
inputs = [
"*.{md,toml}",
"src/**/*.py",
"dist/*.whl",
"docs/**/*.{css,rst,md,py}",
]
depends-on = ["docs-pip", "docs-scour", "docs-cairo", "docs-fetch", "dist-hash"]
outputs = ["build/docs"]
[feature.tasks-test.tasks.docs-mkdocs]
description = "- build a demo site with mkdocs"
cmd = """rm -rf build/mkdocs
&& cd tests/fixtures/mkdocs/nested-file
&& mkdocs build --site-dir $PIXI_PROJECT_ROOT/build/mkdocs
"""
depends-on = ["test-pip"]
inputs = [
"src/**/*.py",
"tests/fixtures/mkdocs",
"!!**/site",
]
outputs = ["build/mkdocs"]
[feature.tasks-docs.tasks.docs-rtd]
description = "... copy the documentation site to where ReadTheDocs wants it"
cmd = """
python -c "
import os;
assert all(map(os.getenv, ['READTHEDOCS', 'READTHEDOCS_OUTPUT'])), 'not on ReadTheDocs'
"
&& mkdir -p "$READTHEDOCS_OUTPUT"
&& cp -r build/docs "$READTHEDOCS_OUTPUT/html"
&& ls "$READTHEDOCS_OUTPUT/html"
"""
depends-on = ["docs-sphinx"]
# atest ########################################################################
[feature.tasks-atest.tasks.atest-robot]
description = "- run acceptance test reports with robot"
cmd = "python scripts/atest.py"
depends-on = ["docs-sphinx", "build-app-cov", "docs-mkdocs"]
inputs = ["build/{docs,dist-cov,mkdocs}/", "atest", "scripts/atest.py"]
outputs = ["build/reports/atest/output.xml"]
[feature.tasks-build.tasks.atest-nyc]
description = "- gather JS coverage with nyc"
cmd = """cd js
&& yarn run nyc report
--statements 97
--branches 86
--functions 93
--lines 97"""
depends-on = ["atest-robot"]
inputs = ["js/package.json", "build/reports/atest/istanbul/*.cov.json"]
outputs = ["build/reports/nyc"]
# check ########################################################################
[feature.tasks-check.tasks.check-links]
description = "... check github hyperlinks in documentation"
cmd = """rm -rf build/reports/check-links
&& mkdir -p build/reports/check-links
&& cd build/reports/check-links
&& touch pytest.ini
&& pytest
-vv
-c pytest.ini
-p no:warnings
--rootdir=.
--html=build/reports/pytest-check-links.html
--self-contained-html
--check-links
--check-anchors
--check-links-ignore '^https?://'
-k "not (404 or coverage or lite or mypy or Untitled)"
../../../build/docs/**/*.html"""
depends-on = ["docs-sphinx"]
inputs = ["build/docs/**/*.html"]
[feature.tasks-check.tasks.check-vale]
description = "... check spelling in documentation"
cmd = "python scripts/vale/check.py"
depends-on = ["docs-sphinx"]
inputs = ["build/docs/**/*.html", "scripts/vale", "{src,tests,scripts,atest}/**/*.py"]
# watch ########################################################################
[feature.tasks-dev.tasks.watch]
description = "watch ALL the things"
cmd = "python scripts/watch.py"
[feature.tasks-build.tasks.watch-lib]
description = "- watch TypeScript and rebuild the lib"
cmd = "yarn build:lib --watch --preserveWatchOutput"
depends-on = ["build-yarn"]
[feature.tasks-build.tasks.watch-demo]
description = "- watch demo TOML and rebuild the rest"
cmd = "watchfiles 'python scripts/demo.py' scripts/demo.py js/demo/toml"
[feature.tasks-build.tasks.watch-app]
description = "- watch lib, css, etc. and rebuild the app"
cmd = "yarn build:app --watch"
depends-on = ["build-yarn"]
[feature.tasks-build.tasks.watch-static]
description = "- watch app and rebuild static"
cmd = "watchfiles 'pixi r py-static--' js/dist"
[feature.tasks-build.tasks.watch-schema]
description = "- watch schema inputs and rebuild the rest"
cmd = """export $(pixi r schema-vars--)
&& watchfiles "pixi r schema-all--" $SCHEMA_TOML $PROPS_TS scripts/schema.py"""
[feature.tasks-build.tasks.serve-demo]
description = "- serve the built demo"
cmd = "cd js/dist && python -m http.server -b 127.0.0.1 8100"
[feature.tasks-docs.tasks.serve-docs]
description = "- serve the docs"
cmd = """cd build/docs
&& python -m http.server -b 127.0.0.1 8101"""
depends-on = ["docs-sphinx"]
[feature.tasks-dev.tasks.watch-docs]
description = "- watch docs source and rebuild the site"
cmd = """rm -rf build/watch-docs
&& sphinx-autobuild docs build/watch-docs
--write-all
--jobs 8
--color
--watch src
--watch pixi.toml"""
depends-on = ["dev-pip"]
# envs #########################################################################
[environments]
build = ["deps-build", "tasks-build", "deps-pip"]
test = ["deps-test", "deps-run", "deps-py-max", "deps-pip", "tasks-test"]
test-min = [
"deps-pip",
"deps-test",
"deps-run",
"deps-run-min",
"tasks-test-min",
]
lint = [
"deps-pip",
"deps-build",
"deps-lint",
"deps-run",
"deps-py-max",
"deps-atest",
"tasks-lint",
]
docs = ["deps-pip", "deps-docs", "deps-run", "deps-py-max", "deps-build", "tasks-docs"]
check = ["deps-check", "tasks-check"]
dev = [
"deps-atest",
"deps-build",
"deps-check",
"deps-dev",
"deps-docs",
"deps-lint",
"deps-pip",
"deps-py-max",
"deps-run",
"deps-test",
"tasks-dev",
]
atest = ["deps-atest", "deps-firefox", "deps-py-max", "tasks-atest"]
# deps #########################################################################
[feature.deps-pip.dependencies]
flit = ">=3.9.0,<4.0.0a0"
pip = "*"
[feature.deps-run.dependencies]
jsonschema = ">=4.18"
mkdocs = ">=1.5"
pymdown-extensions = ">=10.11"
python = ">=3.9"
sphinx = ">=6.1"
[feature.deps-run-min.dependencies]
mkdocs = "1.5.*"
pymdown-extensions = "10.11.*"
python = "3.9.*"
sphinx = "6.1.*"
typing_extensions = "4.0.0"
[feature.deps-py-max.dependencies]
python = "3.13.*"
[feature.deps-test.dependencies]
"ruamel.yaml" = "*"
coverage = ">=7"
pytest = ">=8"
pytest-console-scripts = "*"
pytest-cov = "*"
pytest-html = "*"
pytest-xdist = "*"
[feature.deps-docs.dependencies]
cairosvg = "*"
myst-nb = "*"
pydata-sphinx-theme = ">=0.16.0,<0.17.0"
pypandoc = "*"
scour = "*"
sphinx-argparse = "*"
sphinx-autodoc-typehints = "*"
sphinx-copybutton = "*"
sphinx-jsonschema = "*"
[feature.deps-docs.target.unix.dependencies]
wget = "*"
[feature.deps-docs.target.win.dependencies]
m2-wget = "*"
[feature.deps-build.dependencies]
"ruamel.yaml" = "*"
check-wheel-contents = "*"
jsonschema-gentypes = "*"
nodejs = "22.*"
python-build = "*"
rattler-build = "*"
ruff = "*"
twine = "*"
watchfiles = "*"
yarn = "3.6.4"
[feature.deps-lint.dependencies]
actionlint-with-all = "*"
mypy = "*"
ruff = "*"
taplo = "*"
types-docutils = "*"
types-markdown = "*"
types-jinja2 = "*"
types-jsonschema = "*"
robotframework-robocop = "*"
robotframework-tidy = "*"
[feature.deps-atest.dependencies]
robotframework = "7.*"
robotframework-seleniumlibrary = "*"
robotframework-pabot = "*"
tornado = "*"
[feature.deps-firefox.dependencies]
firefox = "128.*"
geckodriver = "*"
[feature.deps-check.dependencies]
pytest-check-links = "*"
pytest-html = "*"
vale = "*"
vale-spelling-aoo-mozilla-en-dict-us = "*"
[feature.deps-dev.dependencies]
sphinx-autobuild = "*"
# tools ########################################################################
[tool.sphinx]
author = "{{ ppt.project.authors[0].name }}"
project = "{{ ppt.project.name }}"
copyright = "2024, {{ ppt.project.authors[0].name }}"
release = "{{ ppt.project.version }}"
version = "{{ ppt.project.version }}"
extensions = [
"sphinx.ext.autodoc",
"sphinx_autodoc_typehints",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"myst_nb",
"sphinx.ext.autosectionlabel",
"sphinx_copybutton",
"sphinxarg.ext",
"sphinx-jsonschema",
"urljsf.sphinxext",
]
suppress_warnings = ["autosectionlabel.*", "myst.xref_missing"]
exclude_patterns = ["rtd.rst"]
language = "en"
## autodoc
autoclass_content = "both"
always_document_param_types = true
typehints_defaults = "comma"
typehints_use_signature_return = true
autodoc_default_options = {members = true, show-inheritance = true, undoc-members = true}
autosectionlabel_prefix_document = true
## myst
myst_heading_anchors = 3
## theme
html_theme = "pydata_sphinx_theme"
html_logo = "_static/logo.svg"
html_favicon = "_static/icon.svg"
html_static_path = ["_static", "../js/dist/", "../dist"]
[tool.sphinx.html_theme_options]
github_url = "{{ ppt.project.urls.Source }}"
icon_links = [
{name = "PyPI", url = "{{ ppt.project.urls.PyPI }}", icon = "fa-brands fa-python", type = "fontawesome"},
]
pygments_dark_style = "github-dark-colorblind"
pygments_light_style = "github-light-colorblind"
[tool.sphinx.jsonschema_options]
lift_description = true
auto_reference = true
lift_definitions = true
## urljsf
[tool.sphinx.urljsf]
no_bootstrap = true
[tool.sphinx.urljsf.style]
--bs-body-bg = "var(--pst-color-background)"
--bs-body-color = "var(--pst-color-text-base)"
--bs-border-color = "var(--pst-color-border)"
--bs-card-bg = "var(--pst-color-surface)"
--bs-card-cap-bg = "var(--pst-color-danger-bg)"
--bs-danger-text-emphasis = "var(--pst-color-danger-highlight)"
--bs-secondary-color = "var(--pst-color-text-base)"
--bs-tertiary-bg = "var(--pst-color-on-background)"
[tool.sphinx.urljsf.style.".list-group"]
--bs-list-group-bg = "var(--pst-color-background)"
--bs-list-group-color = "var(--pst-color-text-base)"
--bs-list-group-border-color = "var(--pst-color-border)"
[tool.sphinx.urljsf.style."h1, h2, h3, h4, h5, h6"]
margin = "0"