Skip to content

Commit b45d64e

Browse files
authored
chore: switch to pixi (#9)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 2188a62 commit b45d64e

File tree

9 files changed

+104
-93
lines changed

9 files changed

+104
-93
lines changed

.github/workflows/build.yml

Lines changed: 49 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -17,46 +17,37 @@ concurrency:
1717
jobs:
1818
build-book:
1919
runs-on: ubuntu-latest
20-
defaults:
21-
run:
22-
shell: bash -l {0}
2320
steps:
24-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v4
2522

26-
- uses: conda-incubator/setup-miniconda@v3
27-
with:
28-
environment-file: environment.yml
29-
activate-environment: level-up-your-python
30-
miniforge-variant: Mambaforge
31-
use-mamba: true
23+
- uses: prefix-dev/[email protected]
24+
with:
25+
pixi-version: v0.28.2
3226

33-
- name: Install the kernel
34-
run: |
35-
python -m ipykernel install --user --name conda-env-level-up-your-python-py
36-
37-
- name: Build the book
38-
run: |
39-
jupyter-book build .
40-
41-
- uses: actions/upload-artifact@v4
42-
with:
43-
name: jupyterbook
44-
path: _build/html/*
27+
- name: Build the book
28+
run: pixi run book
4529

30+
- uses: actions/upload-artifact@v4
31+
with:
32+
name: jupyterbook
33+
path: _build/html/*
4634

35+
4736
build-pyodide:
4837
runs-on: ubuntu-latest
4938
steps:
50-
- uses: actions/checkout@v4
39+
- uses: actions/checkout@v4
40+
41+
- uses: astral-sh/setup-uv@v6
5142

52-
- name: Build the Pyodide output
53-
run: |
54-
pipx run nox -s pyodide
43+
- name: Build the Pyodide output
44+
run: |
45+
uvx nox -s pyodide
5546
56-
- uses: actions/upload-artifact@v4
57-
with:
58-
name: jupyterlite
59-
path: _output/*
47+
- uses: actions/upload-artifact@v4
48+
with:
49+
name: jupyterlite
50+
path: _output/*
6051

6152

6253
deploy:
@@ -65,25 +56,32 @@ jobs:
6556
url: ${{ steps.deployment.outputs.page_url }}
6657
runs-on: ubuntu-latest
6758
needs: [build-book, build-pyodide]
59+
if: github.event_name == 'push'
6860
steps:
69-
- name: Setup Pages
70-
uses: actions/configure-pages@v5
71-
72-
- uses: actions/download-artifact@v4
73-
with:
74-
name: jupyterbook
75-
path: public
76-
77-
- uses: actions/download-artifact@v4
78-
with:
79-
name: jupyterlite
80-
path: public/live
81-
82-
- name: Upload artifact
83-
uses: actions/upload-pages-artifact@v3
84-
with:
85-
path: public
86-
87-
- name: Deploy to GitHub Pages
88-
id: deployment
89-
uses: actions/deploy-pages@v4
61+
- name: Setup Pages
62+
uses: actions/configure-pages@v5
63+
64+
- uses: actions/download-artifact@v4
65+
with:
66+
name: jupyterbook
67+
path: public
68+
69+
- uses: actions/download-artifact@v4
70+
with:
71+
name: jupyterlite
72+
path: public/live
73+
74+
- uses: actions/download-artifact@v4
75+
with:
76+
name: slides
77+
path: public/slides
78+
79+
- name: Upload artifact
80+
uses: actions/upload-pages-artifact@v3
81+
with:
82+
path: public
83+
84+
- name: Deploy to GitHub Pages
85+
id: deployment
86+
uses: actions/deploy-pages@v4
87+

environment.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

notebooks/3.1 pytest.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,9 @@
343343
],
344344
"metadata": {
345345
"kernelspec": {
346-
"display_name": "conda-env-level-up-your-python-py",
346+
"display_name": "Python 3 (ipykernel)",
347347
"language": "python",
348-
"name": "conda-env-level-up-your-python-py"
348+
"name": "python3"
349349
},
350350
"language_info": {
351351
"codemirror_mode": {
@@ -357,7 +357,7 @@
357357
"name": "python",
358358
"nbconvert_exporter": "python",
359359
"pygments_lexer": "ipython3",
360-
"version": "3.10.5"
360+
"version": "3.12.11"
361361
}
362362
},
363363
"nbformat": 4,

notebooks/3.2 NumPy.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -677,9 +677,9 @@
677677
],
678678
"metadata": {
679679
"kernelspec": {
680-
"display_name": "conda-env-level-up-your-python-py",
680+
"display_name": "Python 3 (ipykernel)",
681681
"language": "python",
682-
"name": "conda-env-level-up-your-python-py"
682+
"name": "python3"
683683
},
684684
"language_info": {
685685
"codemirror_mode": {
@@ -691,7 +691,7 @@
691691
"name": "python",
692692
"nbconvert_exporter": "python",
693693
"pygments_lexer": "ipython3",
694-
"version": "3.10.5"
694+
"version": "3.12.11"
695695
}
696696
},
697697
"nbformat": 4,

notebooks/3.3 Pandas.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@
220220
],
221221
"metadata": {
222222
"kernelspec": {
223-
"display_name": "conda-env-level-up-your-python-py",
223+
"display_name": "Python 3 (ipykernel)",
224224
"language": "python",
225-
"name": "conda-env-level-up-your-python-py"
225+
"name": "python3"
226226
},
227227
"language_info": {
228228
"codemirror_mode": {
@@ -234,7 +234,7 @@
234234
"name": "python",
235235
"nbconvert_exporter": "python",
236236
"pygments_lexer": "ipython3",
237-
"version": "3.10.5"
237+
"version": "3.12.11"
238238
}
239239
},
240240
"nbformat": 4,

notebooks/3.4 Numba.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
{
2727
"cell_type": "code",
28-
"execution_count": null,
28+
"execution_count": 1,
2929
"metadata": {},
3030
"outputs": [],
3131
"source": [
@@ -453,9 +453,9 @@
453453
],
454454
"metadata": {
455455
"kernelspec": {
456-
"display_name": "conda-env-level-up-your-python-py",
456+
"display_name": "Python 3 (ipykernel)",
457457
"language": "python",
458-
"name": "conda-env-level-up-your-python-py"
458+
"name": "python3"
459459
},
460460
"language_info": {
461461
"codemirror_mode": {
@@ -467,7 +467,7 @@
467467
"name": "python",
468468
"nbconvert_exporter": "python",
469469
"pygments_lexer": "ipython3",
470-
"version": "3.10.5"
470+
"version": "3.12.11"
471471
}
472472
},
473473
"nbformat": 4,

notebooks/3.5 pybind11.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@
153153
],
154154
"metadata": {
155155
"kernelspec": {
156-
"display_name": "conda-env-level-up-your-python-py",
156+
"display_name": "Python 3 (ipykernel)",
157157
"language": "python",
158-
"name": "conda-env-level-up-your-python-py"
158+
"name": "python3"
159159
},
160160
"language_info": {
161161
"codemirror_mode": {
@@ -167,7 +167,7 @@
167167
"name": "python",
168168
"nbconvert_exporter": "python",
169169
"pygments_lexer": "ipython3",
170-
"version": "3.10.5"
170+
"version": "3.12.11"
171171
}
172172
},
173173
"nbformat": 4,

noxfile.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@
55

66
@nox.session(reuse_venv=True)
77
def pyodide(session: nox.Session) -> None:
8-
session.install("jupyterlite[lab]")
8+
session.install(
9+
"jupyterlite-core~=0.6.2",
10+
"jupyterlab~=4.4.3",
11+
"notebook~=7.4.3",
12+
"jupyterlite-pyodide-kernel~=0.6.1",
13+
)
914
session.run("jupyter", "lite", "init")
10-
session.run("jupyter", "lite", "build", "--contents=notebooks")
15+
session.run("jupyter", "lite", "build", "--contents=content")
1116

12-
if "--serve" in session.posargs:
17+
if session.interactive:
1318
session.run("jupyter", "lite", "serve")
19+

pixi.toml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[project]
2+
name = "level-up-your-python"
3+
channels = ["conda-forge"]
4+
platforms = ["linux-64", "osx-arm64", "osx-64"]
5+
6+
[dependencies]
7+
black = "*"
8+
ipykernel = ">=6.0"
9+
ipython = ">=8.0"
10+
ipywidgets = "*"
11+
jupyter-book = "*"
12+
jupyterlab = ">=3"
13+
line_profiler = "*"
14+
matplotlib = ">=3.5"
15+
mypy = ">=0.9r760"
16+
nb_conda_kernels = "*"
17+
numba = ">=0.55"
18+
numpy = ">=1.20"
19+
pandas = ">=1.3"
20+
pip = "*"
21+
pybind11 = ">=2.10"
22+
pytest = ">=7"
23+
pytest-mock = "*"
24+
python = ">=3.11"
25+
rich = ">=11"
26+
27+
[tasks]
28+
lab = "jupyter lab"
29+
book = "export PYDEVD_DISABLE_FILE_VALIDATION=1 && python -m ipykernel install --user --name conda-env-level-up-your-python-py && jupyter-book build ."
30+
pdf = "export PYDEVD_DISABLE_FILE_VALIDATION=1 && python -m ipykernel install --user --name conda-env-level-up-your-python-py && jupyter-book build --builder pdflatex ."

0 commit comments

Comments
 (0)