Skip to content

Commit 5c8e68b

Browse files
authored
Merge pull request #30 from rlanzafame/gha-workflow
Update GHA workflow
2 parents 9708e94 + d8a6974 commit 5c8e68b

3 files changed

Lines changed: 36 additions & 20 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,17 @@ jobs:
3131
steps:
3232
- uses: actions/checkout@v4
3333
- uses: actions/configure-pages@v3
34-
- uses: actions/setup-node@v4
35-
with:
36-
node-version: 18.x
3734
- uses: typst-community/setup-typst@v4
38-
39-
- name: Install MyST Markdown with npm
40-
run: npm install -g mystmd
35+
- uses: actions/setup-python@v5
36+
with:
37+
python-version: '3.12'
38+
- name: Install Python dependencies
39+
run: |
40+
python -m pip install --upgrade pip
41+
pip install -r requirements.txt
4142
4243
- name: Build HTML
43-
run: myst build --html
44+
run: jupyter book build --execute --html
4445

4546
- name: Upload Output HTML as Artifact
4647
uses: actions/upload-pages-artifact@v3

content/software.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,40 @@ Extensions in Visual Studio Code (VSC) are powerful add-ons that enhance the fun
6464
* MyST-Markdown: The official Markdown syntax extension
6565

6666

67-
## Requirements.txt
67+
## Virtual Environment and Dependencies
6868

69-
A `requirements.txt` file is included for this workshop that contains the basic dependencies needed to complete it. Note in particular that
69+
It is assumed that you are able to create and activate a virtual environment in order to complete this workshop using a personal computer. As the primary tools are Python packages available using `pip`, the choice of environment manager is somewhat trivial. To keep things simple we suggest using Python `venv` or Conda.
70+
71+
Python's `venv` is used in the GitHub Actions workflows.
72+
73+
### Python Dependencies
74+
75+
Python dependencies are managed in file `requirements.txt`, the contents of which are included here:
76+
77+
:::{literalinclude} ../requirements.txt
78+
:caption: Python dependencies in file `requirements.txt`
79+
:label: include-requirements
80+
:::
81+
82+
Note that only `jupyter-book` is needed for building the book as described in most of the lessons in this workshop. The remaining packages are for the _executable content_ lesson, which requires editing and executing Jupyter Notebooks (`*.ipynb` files). In addition, `jupyter` is a metapackage that includes a number of other commonly used packages (e.g., Jupyter Lab, IPython, etc.): it is included here to cover the range of preferences and IDE's used by workshop participants; many of these are described briefly in the table below. For each individual participant, a smaller subset of packages could be used in practice.
83+
84+
To install these dependencies ensure `requirements.txt` is in your working directory and run `pip install -r requirements.txt`.
7085

71-
We included a [requirements.txt](../..requirements.txt) file with all dependencies that are likely to be used.
72-
These include:
7386
| Package | Description |
7487
|---|---|
7588
| jupyter-book>=2.0.0a0 | Tool to build publication-quality books and documentation from Jupyter notebooks and Markdown. |
7689
| jupyterlab | Web-based interactive development environment for notebooks, code, and data. |
77-
| mystmd | MyST Markdown support for Jupyter Book / Sphinx (optional / commented). |
78-
| jupyterlab_myst | JupyterLab extension to render MyST Markdown and improve notebook/Markdown integration. |
79-
| ipykernel | IPython kernel for Jupyter, enables running Python code in notebooks. |
90+
| ipykernel | IPython kernel for Jupyter, enables running Python code in notebooks. Necessary for VSC to edit and execute notebook files. |
8091
| ipywidgets | Interactive HTML widgets for Jupyter notebooks and JupyterLab. |
92+
| jupyter | A metapackage that requires jupyterlab, ipywidgets and ipykernel, amongst other packages. |
93+
| mystmd | MyST Markdown support for Jupyter Book / Sphinx. |
94+
| jupyterlab_myst | JupyterLab extension to render MyST Markdown and improve notebook/Markdown integration. |
8195
| numpy | Core library for numerical computing with arrays and linear algebra. |
8296
| matplotlib | 2D plotting library for generating figures and visualizations. |
83-
| scipy | Scientific computing library (optional / commented). |
97+
| scipy | Scientific computing library. |
98+
99+
## PDF Generation with Typst
84100

85-
If you are sure you want to install these dependencies, download the file, navigate through the correct folder and use `pip install -r requirements.txt`.
101+
For this template we use Typst to produce a high quality PDF (explained in detail as part of the PDF Output lesson). If you want to create PDF's locally, you'll have to install Typst. The [Typst installation instructions](https://github.com/typst/typst?tab=readme-ov-file#installation) provides several options to install Typst: we strongly recommend using the latest releases.
86102

87-
## Typst
88-
For this template we use Typst to produce a high quality pdf. If you want to create pdf's locally, you'll have to install Typst. Follow the [Typst installation instructions](https://github.com/typst/typst?tab=readme-ov-file#installation) for several options to install Typst. We strongly recommend using the latest releases of Typst. If you get a confusing Typst error, a good first step is to upgrade your version of Typst.
103+
If you get a confusing error, a good first step is to upgrade your version of Typst.

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
jupyterlab>=4.4.10
1+
jupyter-book>=2.0.0a0
2+
jupyter
23
matplotlib>=3.10.7
3-
ipywidgets>=8.1.7

0 commit comments

Comments
 (0)