Skip to content

Commit b494c56

Browse files
committed
build: move doc building and testing to pixi
1 parent 1297186 commit b494c56

File tree

2 files changed

+50
-40
lines changed

2 files changed

+50
-40
lines changed

.github/workflows/docs.yml

+11-40
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,17 @@ on: [push, pull_request]
55
jobs:
66
docbuild:
77
runs-on: ubuntu-latest
8-
98
steps:
10-
- uses: actions/checkout@v2
11-
with:
12-
fetch-depth: 100
13-
14-
- name: Get tags
15-
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
16-
17-
- name: Set up minimal Python version
18-
uses: actions/setup-python@v2
9+
- uses: actions/checkout@v4
10+
- uses: prefix-dev/[email protected]
1911
with:
20-
python-version: "3.11"
21-
22-
- name: Get pip cache dir
23-
id: pip-cache
24-
run: echo "::set-output name=dir::$(pip cache dir)"
25-
26-
- name: Setup pip cache
27-
uses: actions/cache@v2
12+
environments: docs
13+
- run: pixi run --environment docs docbuild
14+
doctest:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: prefix-dev/[email protected]
2819
with:
29-
path: ${{ steps.pip-cache.outputs.dir }}
30-
key: pip-docs
31-
restore-keys: pip-docs
32-
33-
- name: Install locales
34-
run: |
35-
sudo apt-get install language-pack-fr
36-
sudo localedef -i fr_FR -f UTF-8 fr_FR
37-
38-
- name: Install dependencies
39-
run: |
40-
sudo apt install -y pandoc
41-
pip install --upgrade pip setuptools wheel
42-
pip install -r "requirements_docs.txt"
43-
pip install docutils commonmark==0.8.1 recommonmark==0.5.0 babel
44-
pip install .
45-
46-
- name: Build documentation
47-
run: sphinx-build -n -j auto -b html -d build/doctrees docs build/html
48-
49-
- name: Doc Tests
50-
run: sphinx-build -a -j auto -b doctest -d build/doctrees docs build/doctest
20+
environments: docs
21+
- run: pixi run --environment docs doctest

pyproject.toml

+39
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,25 @@ matplotlib = ["matplotlib"]
5353
all = [
5454
"pint[numpy,uncertainties,babel,pandas,pandas,xarray,dask,mip,matplotlib]",
5555
]
56+
docs = [
57+
"sphinx>=6",
58+
"ipython<=8.12",
59+
"nbsphinx",
60+
"jupyter_client",
61+
"ipykernel",
62+
"graphviz",
63+
"pooch",
64+
"sparse",
65+
"Serialize",
66+
"pygments>=2.4",
67+
"sphinx-book-theme>=1.1.0",
68+
"sphinx_copybutton",
69+
"sphinx_design",
70+
"docutils", #==0.14",
71+
"commonmark==0.8.1",
72+
"recommonmark==0.5.0",
73+
"babel",
74+
]
5675

5776
[project.urls]
5877
Homepage = "https://github.com/hgrecco/pint"
@@ -96,6 +115,16 @@ test = { features = ["test"], solve-group = "default" }
96115
test-all = { features = ["test-all"], solve-group = "default" }
97116
numpy = { features = ["numpy"], solve-group = "default" }
98117
codspeed = { features = ["codspeed"], solve-group = "default" }
118+
docs = { features = [
119+
"docs",
120+
"numpy",
121+
"mip",
122+
"matplotlib",
123+
"dask",
124+
"xarray",
125+
"test",
126+
"py311",
127+
] }
99128
# When pint[all] works in pixi, this will be easier.
100129
all = { features = [
101130
"test",
@@ -154,6 +183,16 @@ pip = "*"
154183
[tool.pixi.feature.typecheck.tasks]
155184
typecheck = "pyright"
156185

186+
[tool.pixi.feature.docs.pypi-dependencies]
187+
pint = { path = ".", editable = true }
188+
189+
[tool.pixi.feature.docs.tasks]
190+
docbuild = "sphinx-build -n -j auto -b html -d build/doctrees docs build/html"
191+
doctest = "sphinx-build -a -j auto -b doctest -d build/doctrees docs build/doctest"
192+
193+
[tool.pixi.feature.docs.dependencies]
194+
pandoc = "*"
195+
157196
[tool.pixi.feature.py311.dependencies]
158197
python = "3.11.*"
159198

0 commit comments

Comments
 (0)