From 678859e53e99e6e16759b978a77992dcc21a208f Mon Sep 17 00:00:00 2001 From: Torben <59419684+entorb@users.noreply.github.com> Date: Tue, 14 May 2024 19:42:41 +0200 Subject: [PATCH] Ubuntu 24.04 and Python 3.12 --- .github/workflows/check-pr.yml | 15 ++++++--------- .github/workflows/create-release.yml | 15 ++++++--------- .github/workflows/make.yml | 15 ++++++--------- .pre-commit-config.yaml | 8 ++++---- .ruff.toml | 2 +- Dockerfile | 6 +++--- scripts/ebook/step_3.py | 2 +- scripts/install_requirements.sh | 6 +++--- 8 files changed, 30 insertions(+), 39 deletions(-) diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml index 64c97b459..4d1372920 100644 --- a/.github/workflows/check-pr.yml +++ b/.github/workflows/check-pr.yml @@ -14,7 +14,7 @@ permissions: jobs: check: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Checkout repository @@ -23,17 +23,14 @@ jobs: persist-credentials: false fetch-depth: 1 # 0 if you want to push to repo + - name: Touch requirements.txt for pip caching + run: touch requirements.txt + - name: Python set up uses: actions/setup-python@v5 with: - python-version: "3.10" - # cache: "pip" - - - name: Python cache set up - uses: actions/cache@v4 - with: - path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-py-cache + python-version: "3.12" + cache: "pip" - name: Check of chapters for known issues run: python3 scripts/check_chapters.py diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index c8b97f401..4c10a0160 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -15,7 +15,7 @@ on: jobs: release: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: # - name: test print @@ -31,6 +31,9 @@ jobs: persist-credentials: false fetch-depth: 1 # 0 if you want to push to repo + - name: Touch requirements.txt for pip caching + run: touch requirements.txt + - name: caching LaTeX files uses: actions/cache@v4 with: @@ -48,14 +51,8 @@ jobs: - name: python set up uses: actions/setup-python@v5 with: - python-version: "3.10" - # cache: "pip" - - - name: python cache set up - uses: actions/cache@v4 - with: - path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-py-cache + python-version: "3.12" + cache: "pip" - name: check chapters for known issues run: python3 scripts/check_chapters.py diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index 904b09c5c..b022e1c1f 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -10,7 +10,7 @@ on: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: checkout repository @@ -19,6 +19,9 @@ jobs: persist-credentials: false fetch-depth: 1 # 0 if you want to push to repo + - name: Touch requirements.txt for pip caching + run: touch requirements.txt + - name: caching LaTeX files uses: actions/cache@v4 with: @@ -36,14 +39,8 @@ jobs: - name: python set up uses: actions/setup-python@v5 with: - python-version: "3.10" - # cache: "pip" - - - name: python cache set up - uses: actions/cache@v4 - with: - path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-py-cache + python-version: "3.12" + cache: "pip" # - name: test ls before # run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 11c31da54..a70b5e72e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ exclude: | repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-added-large-files args: ["--maxkb=500"] @@ -62,7 +62,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.3.4" + rev: "v0.4.4" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -84,10 +84,10 @@ repos: - id: text-unicode-replacement-char - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.39.0 + rev: v0.40.0 hooks: - id: markdownlint args: ["--disable", "MD013"] default_language_version: - python: python3.10 + python: python3.12 diff --git a/.ruff.toml b/.ruff.toml index 074665cf1..fa7b32fd4 100644 --- a/.ruff.toml +++ b/.ruff.toml @@ -1,6 +1,6 @@ fix = true # auto-fix findings line-length = 88 # same as Black -target-version = "py310" # Python 3.10 +target-version = "py312" # Python 3.12 [lint] # comment this out to use only default rules (["E4", "E7", "E9", "F"]) diff --git a/Dockerfile b/Dockerfile index 5830c75ee..e4aa8fc8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # syntax=docker/dockerfile:1 # base image -FROM ubuntu:22.04 +FROM ubuntu:24.04 # set timezone ENV TZ=Europe/Berlin @@ -15,7 +15,7 @@ RUN apt-get dist-upgrade -y RUN apt-get install -y python3 git # for pdf, copied from scripts/install_requirements_pdf.sh -RUN apt-get install -y texlive-xetex texlive-lang-german latexmk +RUN apt-get install -y texlive-xetex texlive-lang-greek texlive-lang-german latexmk # for ebook, copied from scripts/install_requirements_ebook.sh RUN apt-get install -y texlive-extra-utils pandoc calibre imagemagick ghostscript @@ -30,7 +30,7 @@ VOLUME /app # 1. preparation # 1.1 build/update image from Dockerfile -# docker build -t hpmor +# docker build -t hpmor . # 1.2 create container that mounts current working dir to /app # docker run --name hpmor-en -it --mount type=bind,src="$(pwd)",dst=/app hpmor bash diff --git a/scripts/ebook/step_3.py b/scripts/ebook/step_3.py index 21da654a1..337f2faf0 100755 --- a/scripts/ebook/step_3.py +++ b/scripts/ebook/step_3.py @@ -22,7 +22,7 @@ cont = fh_in.read() # \today - date_str = dt.datetime.now(dt.timezone.utc).date().strftime("%d.%m.%Y") + date_str = dt.datetime.now(dt.UTC).date().strftime("%d.%m.%Y") cont = cont.replace("\\today{}", date_str) # writtenNote env -> \writtenNoteA diff --git a/scripts/install_requirements.sh b/scripts/install_requirements.sh index 5bd77e1af..ab92af670 100755 --- a/scripts/install_requirements.sh +++ b/scripts/install_requirements.sh @@ -1,11 +1,11 @@ #!/bin/sh # update apt list -sudo apt update --fix-missing +sudo apt-get update --fix-missing # pdf -sudo apt install texlive-xetex latexmk +sudo apt-get install texlive-xetex texlive-lang-greek latexmk # ebook -sudo apt install pandoc calibre texlive-extra-utils +sudo apt-get install pandoc calibre texlive-extra-utils # texlive-extra-utils for latexpand