Skip to content

Commit 7966a74

Browse files
authored
Merge pull request #1 from AnyBody/pixi
Add pixi package manager
2 parents fd26d1b + 344aad9 commit 7966a74

8 files changed

Lines changed: 5710 additions & 53 deletions

File tree

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# GitHub syntax highlighting
2+
pixi.lock linguist-language=YAML
3+

.github/workflows/build.yaml

Lines changed: 86 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ on:
1414
required: false
1515
default: ""
1616

17-
defaults:
18-
run:
19-
shell: bash -leo pipefail {0} {0}
20-
21-
2217
jobs:
2318

2419
find-tag:
@@ -40,12 +35,12 @@ jobs:
4035
steps:
4136
- uses: actions/checkout@v4
4237

43-
- name: Install mamba
44-
uses: mamba-org/setup-micromamba@v1
38+
- uses: prefix-dev/setup-pixi@v0.4.1
4539
with:
46-
environment-file: environment.yaml
47-
48-
- run: sphinx-build -M linkcheck . _build -W --keep-going -a -q
40+
cache: true
41+
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
42+
43+
- run: pixi run sphinx-build -M linkcheck . _build -W --keep-going -a -q
4944

5045

5146
link-check-last-tagged:
@@ -57,15 +52,30 @@ jobs:
5752
with:
5853
ref: ${{ needs.find-tag.outputs.latest-tag }}
5954

55+
- uses: prefix-dev/setup-pixi@v0.4.1
56+
continue-on-error: true
57+
id: pixisetup
58+
with:
59+
cache: true
60+
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
61+
62+
- if: steps.pixisetup.outcome == 'success'
63+
run: pixi sphinx-build -M linkcheck . _build -W --keep-going -a -q
64+
6065
- name: Install mamba
66+
if: steps.pixisetup.outcome == 'failure'
6167
uses: mamba-org/setup-micromamba@v1
6268
with:
6369
environment-file: environment.yaml
70+
71+
- name: build with mamba
72+
if: steps.pixisetup.outcome == 'failure'
73+
shell: bash -leo pipefail {0} {0}
74+
run: sphinx-build -M linkcheck . _build -W --keep-going -a -q
75+
6476

65-
- run: sphinx-build -M linkcheck . _build -W --keep-going -a -q
66-
6777

68-
build:
78+
build-latest:
6979

7080
runs-on: ubuntu-latest
7181
needs: [find-tag, link-check]
@@ -75,41 +85,80 @@ jobs:
7585
with:
7686
fetch-depth: 0
7787

78-
- name: Install mamba
79-
uses: mamba-org/setup-micromamba@v1
88+
- uses: prefix-dev/setup-pixi@v0.4.1
8089
with:
81-
environment-file: environment.yaml
82-
90+
cache: true
91+
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
92+
8393
- name: Build Documentation
84-
run: |
85-
sphinx-build -M html . _build-beta -W --keep-going -a -t draft
94+
run: pixi run sphinx-build -M html . _build -W --keep-going -a -t draft
8695

87-
- name: Checkout last tagged
88-
run: |
89-
git checkout ${{ needs.find-tag.outputs.latest-tag }}
96+
- uses: actions/upload-artifact@v3
97+
with:
98+
name: beta-version
99+
path: _build/html
100+
101+
102+
build-tagged:
103+
104+
runs-on: ubuntu-latest
105+
needs: [find-tag, link-check]
90106

91-
- name: Build environment for last tagged version
92-
run: micromamba create -n tutorial-tagged -y -f environment.yaml
107+
steps:
108+
- uses: actions/checkout@v4
109+
with:
110+
ref: ${{ needs.find-tag.outputs.latest-tag }}
111+
fetch-depth: 0
93112

94-
- name: Build last tagged version
95-
run: |
96-
micromamba activate tutorial-tagged
97-
sphinx-build -M html . _build -W --keep-going -a
113+
- uses: prefix-dev/setup-pixi@v0.4.1
114+
continue-on-error: true
115+
id: pixisetup
116+
with:
117+
cache: true
118+
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'master' }}
119+
120+
- name: Build Documentation
121+
if: steps.pixisetup.outcome == 'success'
122+
run: pixi run sphinx-build -M html . _build -W --keep-going -a
123+
98124

99-
- name: Prepare html for upload
100-
run: |
101-
mkdir -p gh-pages/beta
102-
cp -rT _build-beta/html gh-pages/beta
103-
cp -rT _build/html gh-pages
125+
- name: Install mamba
126+
if: steps.pixisetup.outcome == 'failure'
127+
uses: mamba-org/setup-micromamba@v1
128+
with:
129+
environment-file: environment.yaml
130+
131+
- name: build with mamba
132+
if: steps.pixisetup.outcome == 'failure'
133+
shell: bash -leo pipefail {0} {0}
134+
run: sphinx-build -M html . _build -W --keep-going -a
135+
136+
- uses: actions/upload-artifact@v3
137+
with:
138+
name: tagged-version
139+
path: _build/html
104140

141+
prepare-pages:
142+
needs: [build-latest, build-tagged]
143+
runs-on: ubuntu-latest
144+
steps:
145+
- uses: actions/download-artifact@v3
146+
with:
147+
name: tagged-version
148+
path: public
149+
- uses: actions/download-artifact@v3
150+
with:
151+
name: beta-version
152+
path: public/beta
105153
- uses: actions/upload-pages-artifact@v2
106154
with:
107-
path: gh-pages
155+
path: public
156+
108157

109158

110159
deploy:
111-
needs: [build, link-check-last-tagged]
112-
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
160+
needs: prepare-pages
161+
if: github.ref == 'refs/heads/master'
113162
runs-on: ubuntu-latest
114163
permissions:
115164
pages: write
@@ -124,5 +173,4 @@ jobs:
124173
id: deployment
125174
uses: actions/deploy-pages@v2
126175

127-
128-
176+

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
_build/
22
.vscode/
33
*.docx
4-
*.pyc
4+
*.pyc# pixi environments
5+
.pixi
6+

Finite_element_analysis/lesson1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ getting lost in the jungle of meshing.
264264

265265
In the following, we will make use of two freely available tools.
266266
Preprocessing (meshing and applying boundary conditions) is done using
267-
[IA-FEMesh](http://www.ccad.uiowa.edu/mimx) provided by the
267+
[IA-FEMesh](https://ctpr.github.io/IA-FEMesh/) provided by the
268268
University of Iowa. [Calculix](http://www.calculix.de) is used as
269269
solver and post-processor. This fine piece of software is written and
270270
maintained by Guido Dhondt and Klaus Wittig. Calculix v1.8 and

conf.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ def tagged_commit():
119119
".github",
120120
"README.md",
121121
"galleries/*",
122+
".pixi",
122123
]
123124

124125

@@ -276,7 +277,6 @@ def tagged_commit():
276277

277278
html_theme_options = {
278279
# "logo_only": True,
279-
280280
"repository_url": "https://github.com/anybody/tutorials",
281281
"use_repository_button": False,
282282
# "extra_navbar": 'Tutorials by <a href="https://anybodytech.com">AnyBody Technology</a>',
@@ -288,9 +288,7 @@ def tagged_commit():
288288
"show_navbar_depth": 2,
289289
"search_bar_text": "",
290290
"pygment_light_style": "AnyScript",
291-
"pygment_dark_style": "stata-dark"
292-
293-
291+
"pygment_dark_style": "stata-dark",
294292
}
295293

296294

@@ -442,9 +440,9 @@ def tagged_commit():
442440
"https://doi.org/10.1115/1.4052115", # asme.org prevents the linkcheck
443441
"https://dx.doi.org/10.1115/1.4001678", # asme.org prevents the linkcheck
444442
"https://dx.doi.org/10.1115/1.4029258", # asme.org prevents the linkcheck
445-
"https://doi.org/10.1080/10255840802459412", # tandfonline sometimes blocks linkcheck
446-
"https://doi.org/10.1080/23335432.2014.993706", # tandfonline sometimes blocks linkcheck
447-
"https://anyscript.org/tutorials/dev/", # The dev sides can sometimes be missing.
443+
"https://doi.org/10.1080/10255840802459412", # tandfonline sometimes blocks linkcheck
444+
"https://doi.org/10.1080/23335432.2014.993706", # tandfonline sometimes blocks linkcheck
445+
"https://anyscript.org/tutorials/dev/", # The dev sides can sometimes be missing.
448446
]
449447

450448
linkcheck_allowed_redirects = {
@@ -457,4 +455,4 @@ def tagged_commit():
457455

458456

459457
def setup(app):
460-
...
458+
...

environment.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ channels:
44
- conda-forge
55
dependencies:
66
- python
7-
- pip
8-
- sphinx<6
9-
- myst-parser>=0.18
10-
- pydata-sphinx-theme>=0.13
7+
- sphinx<7
8+
- myst-parser
9+
- pydata-sphinx-theme
1110
- make
1211
- sphinx-togglebutton
1312
- pygments_anyscript
@@ -17,7 +16,7 @@ dependencies:
1716
- tomli
1817
- sphinx-copybutton
1918
- sphinxext-opengraph
20-
- sphinx-book-theme>=1.0
19+
- sphinx-book-theme
2120
- sphinx-design
2221
- sphinxcontrib-youtube
2322

0 commit comments

Comments
 (0)