Skip to content

Commit

Permalink
DX: define doclive Pixi job to skip notebook execution (#53)
Browse files Browse the repository at this point in the history
* DX: activate `jupyter-cache`
* DX: add `toml-sort` pre-commit hook

---------

Co-authored-by: Remco de Boer <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Jul 11, 2024
1 parent 5eb0f0d commit 6deb6ad
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 15 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ repos:
hooks:
- id: taplo

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort
args:
- --in-place

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.1
hooks:
Expand Down
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

comments_config = {
"hypothesis": True,
}
Expand All @@ -22,6 +24,7 @@
"html_image",
"smartquotes",
]
nb_execution_mode = "cache" if os.environ.get("EXECUTE_NB") else "off"
nb_execution_show_tb = True
nb_execution_timeout = -1
nitpicky = True
Expand Down
51 changes: 36 additions & 15 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,6 @@ name = "gluex-nstar"
platforms = ["linux-64"]
readme = "README.md"

[tasks]
docnb = """
sphinx-build \
-nW --keep-going \
-b html \
docs/ docs/_build/html
"""
docnblive = """
sphinx-autobuild \
--watch docs \
-nW --keep-going \
-b html \
docs/ docs/_build/html
"""

[dependencies]
ampform = ">=0.15.4,<0.16"
black = ">=24.4.2,<24.5"
Expand Down Expand Up @@ -51,3 +36,39 @@ sphinx-book-theme = ">=1.1.2,<1.2"
sphinx-comments = ">=0.0.3,<0.1"
sphinx-copybutton = ">=0.5.2,<0.6"
sympy = ">=1.12,<2"

[tasks.doc]
cmd = """
sphinx-build \
-nW --keep-going \
-b html \
docs/ docs/_build/html
"""

[tasks.doclive]
cmd = """
sphinx-autobuild \
--watch docs \
-nW --keep-going \
-b html \
docs/ docs/_build/html
"""

[tasks.docnb]
cmd = """
sphinx-build \
-nW --keep-going \
-b html \
docs/ docs/_build/html
"""
env = {EXECUTE_NB = "yes"}

[tasks.docnblive]
cmd = """
sphinx-autobuild \
--watch docs \
-nW --keep-going \
-b html \
docs/ docs/_build/html
"""
env = {EXECUTE_NB = "yes"}
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,17 @@ select = ["ALL"]
"D100",
"INP001",
]

[tool.tomlsort]
all = false
ignore_case = true
in_place = true
sort_first = [
"build-system",
"project",
"tool.setuptools",
"tool.setuptools_scm",
]
sort_table_keys = true
spaces_indent_inline_array = 4
trailing_comma_inline_array = true

0 comments on commit 6deb6ad

Please sign in to comment.