Skip to content

Commit b12bcca

Browse files
committed
Ubuntu 24.04 and Python 3.12
1 parent 1d1f5a2 commit b12bcca

File tree

9 files changed

+54
-62
lines changed

9 files changed

+54
-62
lines changed

.github/workflows/check-pr.yml

+6-9
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414

1515
jobs:
1616
check:
17-
runs-on: ubuntu-22.04
17+
runs-on: ubuntu-24.04
1818

1919
steps:
2020
- name: Checkout repository
@@ -23,17 +23,14 @@ jobs:
2323
persist-credentials: false
2424
fetch-depth: 1 # 0 if you want to push to repo
2525

26+
- name: Touch requirements.txt for pip caching
27+
run: touch requirements.txt
28+
2629
- name: Python set up
2730
uses: actions/setup-python@v5
2831
with:
29-
python-version: "3.10"
30-
# cache: "pip"
31-
32-
- name: Python cache set up
33-
uses: actions/cache@v4
34-
with:
35-
path: ${{ env.pythonLocation }}
36-
key: ${{ env.pythonLocation }}-py-cache
32+
python-version: "3.12"
33+
cache: "pip"
3734

3835
- name: Check of chapters for known issues
3936
run: python3 scripts/check_chapters.py

.github/workflows/create-release.yml

+15-18
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515

1616
jobs:
1717
release:
18-
runs-on: ubuntu-22.04
18+
runs-on: ubuntu-24.04
1919

2020
steps:
2121
# - name: test print
@@ -25,13 +25,16 @@ jobs:
2525

2626
# steps are copied from make.yml
2727

28-
- name: checkout repository
28+
- name: Checkout repository
2929
uses: actions/checkout@v4
3030
with:
3131
persist-credentials: false
3232
fetch-depth: 1 # 0 if you want to push to repo
3333

34-
- name: caching LaTeX files
34+
- name: Touch requirements.txt for pip caching
35+
run: touch requirements.txt
36+
37+
- name: Cache LaTeX files
3538
uses: actions/cache@v4
3639
with:
3740
path: |
@@ -45,34 +48,28 @@ jobs:
4548
hpmor*.xdv
4649
key: tex-cache
4750

48-
- name: python set up
51+
- name: Python set up
4952
uses: actions/setup-python@v5
5053
with:
51-
python-version: "3.10"
52-
# cache: "pip"
53-
54-
- name: python cache set up
55-
uses: actions/cache@v4
56-
with:
57-
path: ${{ env.pythonLocation }}
58-
key: ${{ env.pythonLocation }}-py-cache
54+
python-version: "3.12"
55+
cache: "pip"
5956

60-
- name: check chapters for known issues
57+
- name: Check chapters for known issues
6158
run: python3 scripts/check_chapters.py
6259

63-
- name: check pre-commit tests
60+
- name: Check pre-commit tests
6461
uses: pre-commit/[email protected]
6562

66-
- name: install requirements
63+
- name: Install requirements
6764
run: sh scripts/install_requirements.sh > /dev/null
6865

69-
- name: make PDFs
66+
- name: Make PDFs
7067
run: sh scripts/make_pdfs.sh > /dev/null
7168

72-
- name: make eBooks
69+
- name: Make eBooks
7370
run: sh scripts/make_ebooks.sh
7471

75-
- name: publish release
72+
- name: Publish release
7673
uses: softprops/action-gh-release@v2
7774
with:
7875
tag_name: "${{ inputs.version_number }}"

.github/workflows/make.yml

+17-20
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,19 @@ on:
1010

1111
jobs:
1212
build:
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-24.04
1414

1515
steps:
16-
- name: checkout repository
16+
- name: Checkout repository
1717
uses: actions/checkout@v4
1818
with:
1919
persist-credentials: false
2020
fetch-depth: 1 # 0 if you want to push to repo
2121

22-
- name: caching LaTeX files
22+
- name: Touch requirements.txt for pip caching
23+
run: touch requirements.txt
24+
25+
- name: Caching LaTeX files
2326
uses: actions/cache@v4
2427
with:
2528
path: |
@@ -33,33 +36,27 @@ jobs:
3336
hpmor*.xdv
3437
key: tex-cache
3538

36-
- name: python set up
39+
- name: Python set up
3740
uses: actions/setup-python@v5
3841
with:
39-
python-version: "3.10"
40-
# cache: "pip"
41-
42-
- name: python cache set up
43-
uses: actions/cache@v4
44-
with:
45-
path: ${{ env.pythonLocation }}
46-
key: ${{ env.pythonLocation }}-py-cache
42+
python-version: "3.12"
43+
cache: "pip"
4744

4845
# - name: test ls before
4946
# run: |
5047
# pwd
5148
# ls -al
5249

53-
- name: check chapters for known issues
50+
- name: Check chapters for known issues
5451
run: python3 scripts/check_chapters.py
5552

56-
- name: check pre-commit tests
53+
- name: Check pre-commit tests
5754
uses: pre-commit/[email protected]
5855

59-
- name: install requirements
56+
- name: Install requirements
6057
run: sh scripts/install_requirements.sh > /dev/null
6158

62-
- name: print versions
59+
- name: Print versions
6360
run: |
6461
cat /etc/os-release
6562
xelatex -v
@@ -68,18 +65,18 @@ jobs:
6865
ebook-convert --version
6966
python3 --version
7067
71-
- name: make PDFs
68+
- name: Make PDFs
7269
run: sh scripts/make_pdfs.sh > /dev/null
7370

74-
- name: make eBooks
71+
- name: Make eBooks
7572
run: sh scripts/make_ebooks.sh
7673

77-
- name: test ls after
74+
- name: Test ls after
7875
run: |
7976
pwd
8077
ls -al
8178
82-
- name: upload files to release WorkInProgress
79+
- name: Upload files to release WorkInProgress
8380
uses: softprops/action-gh-release@v2
8481
with:
8582
tag_name: WorkInProgress

.pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ exclude: |
1919
2020
repos:
2121
- repo: https://github.com/pre-commit/pre-commit-hooks
22-
rev: v4.5.0
22+
rev: v4.6.0
2323
hooks:
2424
- id: check-added-large-files
2525
args: ["--maxkb=500"]
@@ -62,7 +62,7 @@ repos:
6262
- id: trailing-whitespace
6363

6464
- repo: https://github.com/charliermarsh/ruff-pre-commit
65-
rev: "v0.3.4"
65+
rev: "v0.4.4"
6666
hooks:
6767
- id: ruff
6868
args: [--fix, --exit-non-zero-on-fix]
@@ -84,10 +84,10 @@ repos:
8484
- id: text-unicode-replacement-char
8585

8686
- repo: https://github.com/igorshubovych/markdownlint-cli
87-
rev: v0.39.0
87+
rev: v0.40.0
8888
hooks:
8989
- id: markdownlint
9090
args: ["--disable", "MD013"]
9191

9292
default_language_version:
93-
python: python3.10
93+
python: python3.12

.ruff.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fix = true # auto-fix findings
22
line-length = 88 # same as Black
3-
target-version = "py310" # Python 3.10
3+
target-version = "py312" # Python 3.12
44

55
[lint]
66
# comment this out to use only default rules (["E4", "E7", "E9", "F"])

Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1
22

33
# base image
4-
FROM ubuntu:22.04
4+
FROM ubuntu:24.04
55

66
# set timezone
77
ENV TZ=Europe/Berlin
@@ -15,7 +15,7 @@ RUN apt-get dist-upgrade -y
1515
RUN apt-get install -y python3 git
1616

1717
# for pdf, copied from scripts/install_requirements_pdf.sh
18-
RUN apt-get install -y texlive-xetex texlive-lang-german latexmk
18+
RUN apt-get install -y texlive-xetex texlive-lang-greek texlive-lang-german latexmk
1919
# for ebook, copied from scripts/install_requirements_ebook.sh
2020
RUN apt-get install -y texlive-extra-utils pandoc calibre imagemagick ghostscript
2121

@@ -30,7 +30,7 @@ VOLUME /app
3030

3131
# 1. preparation
3232
# 1.1 build/update image from Dockerfile
33-
# docker build -t hpmor
33+
# docker build -t hpmor .
3434

3535
# 1.2 create container that mounts current working dir to /app
3636
# docker run --name hpmor-en -it --mount type=bind,src="$(pwd)",dst=/app hpmor bash

scripts/ebook/step_3.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
cont = fh_in.read()
2323

2424
# \today
25-
date_str = dt.datetime.now(dt.timezone.utc).date().strftime("%d.%m.%Y")
25+
date_str = dt.datetime.now(dt.UTC).date().strftime("%d.%m.%Y")
2626
cont = cont.replace("\\today{}", date_str)
2727

2828
# writtenNote env -> \writtenNoteA

scripts/ebook/step_6.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def fix_ellipsis(s: str) -> str:
7171
count=7,
7272
)
7373

74-
# now done via pandoc -V lang=en in 5.sh
74+
# now done via pandoc -V lang=en in step_5.sh
7575
# # set language
7676
# cont = re.sub(
7777
# r'(<html [^>]*) lang="" xml:lang=""',
@@ -102,13 +102,13 @@ def fix_ellipsis(s: str) -> str:
102102

103103
# remove ids from chapters since umlaute cause problem
104104
cont = re.sub(
105-
r'(<h\d) id="[^"]+"',
105+
r'(<h\d)\s+id="[^"]+"',
106106
r"\1",
107107
cont,
108108
flags=re.DOTALL | re.IGNORECASE,
109109
)
110110
cont = re.sub(
111-
r'(<h\d class="unnumbered") id="[^"]+"',
111+
r'(<h\d\s+class="unnumbered")\s+id="[^"]+"',
112112
r"\1",
113113
cont,
114114
flags=re.DOTALL | re.IGNORECASE,

scripts/install_requirements.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/bin/sh
22

33
# update apt list
4-
sudo apt update --fix-missing
4+
sudo apt-get update --fix-missing
55

66
# pdf
7-
sudo apt install texlive-xetex latexmk
7+
sudo apt-get install texlive-xetex texlive-lang-greek latexmk
88

99
# ebook
10-
sudo apt install pandoc calibre texlive-extra-utils
10+
sudo apt-get install pandoc calibre texlive-extra-utils imagemagick ghostscript
1111
# texlive-extra-utils for latexpand
12+
# imagemagick ghostscript : for pdf title page to image conversion

0 commit comments

Comments
 (0)