Skip to content

Commit 047a282

Browse files
committed
Merge branch 'master' into repo2docker-container-tests
2 parents 65d20e8 + 1c868d7 commit 047a282

21 files changed

+254
-3624
lines changed

.github/workflows/deploy.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Book Deploy
33
on:
44
release:
55
types: [created]
6+
push:
7+
# all
8+
workflow_dispatch:
69

710
jobs:
811
docker-build-and-deploy:
@@ -52,7 +55,7 @@ jobs:
5255
5356
# Deploy the book's HTML to gh-pages branch
5457
- name: GitHub Pages action
55-
uses: peaceiris/actions-gh-pages@bbdfb200618d235585ad98e965f4aafc39b4c501
58+
uses: peaceiris/actions-gh-pages@v3
5659
with:
5760
github_token: ${{ secrets.GITHUB_TOKEN }}
5861
publish_dir: ./book/_build/html

.github/workflows/nbval.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: nbval
22

3-
on: [push]
3+
on:
4+
push:
5+
# all
6+
workflow_dispatch:
47

58
jobs:
69
docker-build-and-nbval:

.github/workflows/stage.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Book Staging
33
on:
44
pull_request:
55
branches: [ master ]
6+
workflow_dispatch:
67

78
jobs:
89
docker-build-and-stage:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ stock.csv
2222
.venv
2323
.venv/
2424
book/_build
25+
.DS_Store

Dockerfile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
FROM debian:bullseye-slim
1+
FROM debian:bookworm-slim
22

3-
RUN apt-get update -y && apt-get install -y texlive-xetex latexmk texlive-xetex \
4-
texlive-fonts-extra fonts-freefont-otf python3 python3-pip git zile wget
3+
#RUN apt-get update -y && apt-get install -y texlive-xetex latexmk texlive-xetex \
4+
# texlive-fonts-extra fonts-freefont-otf python3 python3-pip git zile wget
55

6-
COPY poetry.lock pyproject.toml /opt/
6+
RUN apt-get update -y && apt-get install -y python3 python3-pip texlive-xetex \
7+
latexmk git zile wget texlive-fonts-extra python3-venv
78

8-
RUN pip install poetry==1.1.4
9+
COPY requirements.txt /opt/
910

1011
WORKDIR /opt/
11-
RUN poetry config virtualenvs.create false
12-
RUN poetry install -vvv
12+
RUN python3 -m venv venv
13+
RUN . venv/bin/activate && pip install -r requirements.txt
14+
RUN . venv/bin/activate && pip list
15+
# activate venv
16+
ENV PATH="/opt/venv/bin:$PATH"
1317

1418
RUN mkdir -p /io
1519
WORKDIR /io
1620

1721
# Need this for one nbval and chapter 1
1822
RUN ln -s /usr/bin/python3 /usr/local/bin/python
1923

24+
# supress warning when running jupyter-book in container
25+
ENV PYDEVD_DISABLE_FILE_VALIDATION=1
2026
CMD ["/bin/bash"]

Makefile

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ all:
33
make pdf
44

55
install:
6-
poetry install -vvv
6+
pip install -r requirements.txt
77

88
clean:
99
cd book; rm -rf \
@@ -13,20 +13,20 @@ clean:
1313
_build .ipynb_checkpoints
1414

1515
html:
16-
poetry run jupyter-book build book --builder html
16+
jupyter-book build book --builder html
1717

1818
linkcheck:
19-
poetry run jupyter-book build book --builder linkcheck
19+
jupyter-book build book --builder linkcheck
2020

2121
pdf: book/*-*.ipynb
22-
poetry run jupyter-book build book --builder pdflatex
22+
jupyter-book build book --builder pdflatex
2323

2424
nbval:
2525
@echo "Testing all chapters (apart from 18) with --nbval"
26-
poetry run pytest -v --nbval book --sanitize-with book/static/nbval_sanitize.cfg \
26+
pytest -v --nbval book --sanitize-with book/static/nbval_sanitize.cfg \
2727
--ignore=book/18-environments.ipynb --ignore=book/_build
2828
@echo "Testing chapter 18 with --nbval-lax"
29-
poetry run pytest -v --nbval-lax book/18-environments.ipynb
29+
pytest -v --nbval-lax book/18-environments.ipynb
3030

3131

3232
nbval-native:
@@ -51,16 +51,8 @@ docker-build:
5151
docker-build-nocache:
5252
docker build -t python4compscience2 --no-cache .
5353

54-
# Here we only bind the required directories and files into the docker container
55-
# at runtime to avoid potential conflicts with local files
56-
5754
define DOCKER_RUN
58-
docker run --workdir=/io \
59-
-v $(CURDIR)/book:/io/book \
60-
-v $(CURDIR)/Makefile:/io/Makefile \
61-
-v $(CURDIR)/poetry.lock:/io/poetry.lock \
62-
-v $(CURDIR)/pyproject.toml:/io/pyproject.toml \
63-
python4compscience
55+
docker run --rm -v $(CURDIR):/io python4compscience
6456
endef
6557

6658
docker-bash:

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ and schools. Please send a message to the author if you do so.
119119

120120
Hans Fangohr is a researcher and teacher (see
121121
[homepage](https://fangohr.github.io), [blog](https://fangohr.github.io/blog),
122-
[twitter](https://twitter.com/ProfCompMod)). His interests include effective
122+
[mastodon](https://fosstodon.org/@ProfCompMod)). His interests include effective
123123
software engineering for computational science and data science, researching
124124
computational modelling and data analysis methods, and education. He is a
125125
Professor at the [University of Southampton (UK)](https://www.southampton.ac.uk)

binder/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ scipy
33
sympy
44
matplotlib
55
pandas
6+
pyarrow
67
ipython
78
pytest
89
nbval

book/12-symbolic-computation.ipynb

Lines changed: 22 additions & 21 deletions
Large diffs are not rendered by default.

book/14-numpy.ipynb

Lines changed: 4 additions & 6 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)