diff --git a/.github/workflows/check-and-ebook.yml b/.github/workflows/check-and-ebook.yml index 9bf93f8bf..4f7d3b81c 100644 --- a/.github/workflows/check-and-ebook.yml +++ b/.github/workflows/check-and-ebook.yml @@ -1,7 +1,6 @@ -# This workflow runs upon new commits (check and make) and PRs (check only) - name: Check and Make eBook +# This workflow runs upon new commits (check and make) and PRs (check only) on: workflow_dispatch: push: @@ -22,13 +21,13 @@ jobs: cache-hit: ${{ steps.cache-lookup.outputs.cache-hit }} steps: - - name: checkout repository + - name: Check out repository uses: actions/checkout@v4 with: persist-credentials: false fetch-depth: 1 # 0 if you want to push to repo - - name: calculate hash on chapters/*.tex + - name: Calculate hash on chapters/*.tex id: calculate-hash run: | current_date=$(date -u '+%Y-%m-%d') @@ -36,29 +35,29 @@ jobs: echo "hash=${current_date}-${hashed}" >> $GITHUB_OUTPUT echo "${current_date}-${hashed}" > hash-chapters.txt - - name: cache lookup + - name: Cache lookup id: cache-lookup uses: actions/cache@v4 with: path: hash-chapters.txt key: chapter-hash-for-ebook-${{ steps.calculate-hash.outputs.hash }} - - name: python set up + - name: Python set up uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.12" # cache: "pip" - - name: python cache set up + - name: Python cache set up uses: actions/cache@v4 with: path: ${{ env.pythonLocation }} key: python-${{ env.pythonLocation }} - - name: check chapters for known issues + - name: Check chapters for known issues run: python3 -O scripts/check_chapters.py - - name: check pre-commit hooks + - name: Check pre-commit hooks uses: pre-commit/action@v3.0.1 # @@ -72,16 +71,16 @@ jobs: runs-on: ubuntu-22.04 steps: - - name: checkout repository + - name: Check out repository uses: actions/checkout@v4 with: persist-credentials: false fetch-depth: 1 # 0 if you want to push to repo - - name: python set up + - name: Python set up uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.12" # cache: "pip" # - name: setup environment to DE lang @@ -95,14 +94,14 @@ jobs: ls -l echo ${{ needs.check.outputs.cache-hit }} - - name: install apt packages using cache + - name: Install apt packages using cache uses: awalsh128/cache-apt-pkgs-action@latest with: packages: texlive-extra-utils pandoc calibre imagemagick ghostscript version: 1.0 # execute_install_scripts: true - - name: print versions + - name: Print versions run: | cat /etc/os-release # xelatex -v @@ -111,7 +110,7 @@ jobs: pandoc --version python3 --version - - name: make eBooks + - name: Make eBooks run: | wget --quiet https://github.com/entorb/hpmor-de/releases/download/WorkInProgress/hpmor.pdf -O hpmor.pdf sh scripts/make_ebooks.sh > /dev/null @@ -121,7 +120,7 @@ jobs: pwd ls -l - - name: publish eBooks to release + - name: Publish eBooks to release uses: softprops/action-gh-release@v2 with: tag_name: WorkInProgress diff --git a/.github/workflows/make-pdf-1-select.yml b/.github/workflows/make-pdf-1-select.yml index 92146fc68..4c1569813 100644 --- a/.github/workflows/make-pdf-1-select.yml +++ b/.github/workflows/make-pdf-1-select.yml @@ -13,14 +13,14 @@ jobs: build: runs-on: ubuntu-22.04 steps: - - name: print selection + - name: Print selection run: | echo "selected PDF: ${{ github.event.inputs.pdf_target }}" - - name: print start date + - name: Print start date run: date +%Y-%m-%d_%H:%M - - name: checkout repository + - name: Check out repository uses: actions/checkout@v4 with: persist-credentials: false @@ -43,10 +43,10 @@ jobs: - name: ls chapters run: ls -l chapters/ - - name: python set up + - name: Python set up uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.12" # cache: "pip" - name: ls before @@ -54,16 +54,16 @@ jobs: pwd ls -l - - name: check chapters for known issues + - name: Check chapters for known issues run: python3 -O scripts/check_chapters.py - - name: install PDF requirements + - name: Install PDF requirements run: | # not: to save time - # sudo apt update > /dev/null + # sudo apt-get update > /dev/null sh scripts/install_requirements_pdf.sh > /dev/null - - name: print versions + - name: Print versions run: | cat /etc/os-release xelatex -v @@ -71,11 +71,11 @@ jobs: # pandoc -v python3 --version - - name: make PDF + - name: Make PDF run: | latexmk "${{ github.event.inputs.pdf_target }}" > /dev/null - - name: publish PDF to release + - name: Publish PDF to release uses: softprops/action-gh-release@v2 with: tag_name: WorkInProgress @@ -83,7 +83,7 @@ jobs: files: | ./hpmor*.pdf - - name: upload log as artifact + - name: Upload log as artifact uses: actions/upload-artifact@v4 with: name: "${{ github.event.inputs.pdf_target }}.log" @@ -93,5 +93,5 @@ jobs: run: | ls -l - - name: print end date + - name: Print end date run: date +%Y-%m-%d_%H:%M diff --git a/.github/workflows/make-pdf-6-parallel.yml b/.github/workflows/make-pdf-6-parallel.yml index e715e5451..314069081 100644 --- a/.github/workflows/make-pdf-6-parallel.yml +++ b/.github/workflows/make-pdf-6-parallel.yml @@ -11,13 +11,13 @@ jobs: matrix: part: [hpmor-1, hpmor-2, hpmor-3, hpmor-4, hpmor-5, hpmor-6] steps: - - name: checkout repository + - name: Check out repository uses: actions/checkout@v4 with: persist-credentials: false fetch-depth: 1 # 0 if you want to push to repo - - name: cache LaTeX files + - name: Cache LaTeX files uses: actions/cache@v4 with: path: | @@ -31,23 +31,23 @@ jobs: hpmor*.xdv key: latex-build-files - - name: install PDF requirements + - name: Install PDF requirements run: | # not: to save time - # sudo apt update > /dev/null + # sudo apt-get update > /dev/null sh scripts/install_requirements_pdf.sh > /dev/null - - name: make PDF + - name: Make PDF run: latexmk ${{ matrix.part }} > /dev/null - - name: publish PDF to release + - name: Publish PDF to release uses: softprops/action-gh-release@v2 with: tag_name: WorkInProgress prerelease: true files: ${{ matrix.part }}.pdf - - name: upload log as artifact + - name: Upload log as artifact uses: actions/upload-artifact@v4 with: name: "${{ matrix.part }}.log" diff --git a/.github/workflows/make-pdf-all-serial.yml b/.github/workflows/make-pdf-all-serial.yml index 8a8d647d7..c5fb6b7b1 100644 --- a/.github/workflows/make-pdf-all-serial.yml +++ b/.github/workflows/make-pdf-all-serial.yml @@ -8,13 +8,13 @@ jobs: build: runs-on: ubuntu-22.04 steps: - - name: checkout repository + - name: Check out repository uses: actions/checkout@v4 with: persist-credentials: false fetch-depth: 1 # 0 if you want to push to repo - - name: caching LaTeX files + - name: Cache LaTeX files uses: actions/cache@v4 with: path: | @@ -28,12 +28,12 @@ jobs: hpmor*.xdv key: latex-build-files - - name: install PDF requirements + - name: Install PDF requirements run: | - sudo apt update > /dev/null + sudo apt-get update > /dev/null sh scripts/install_requirements_pdf.sh > /dev/null - - name: print versions + - name: Print versions run: | cat /etc/os-release xelatex -v @@ -41,7 +41,7 @@ jobs: # pandoc -v python3 --version - - name: make PDFs + - name: Make PDFs run: latexmk hpmor-1 hpmor-2 hpmor-3 hpmor-4 hpmor-5 hpmor-6 hpmor > /dev/null - name: Publish PDF to release @@ -51,7 +51,7 @@ jobs: prerelease: true files: hpmor*.pdf - - name: upload logs as artifact + - name: Upload logs as artifact uses: actions/upload-artifact@v4 with: name: "hpmor.log" diff --git a/.github/workflows/make-pdf-test.yml b/.github/workflows/make-pdf-test.yml index c11e2837b..84877d358 100644 --- a/.github/workflows/make-pdf-test.yml +++ b/.github/workflows/make-pdf-test.yml @@ -21,7 +21,7 @@ jobs: - name: Python set up uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.12" # cache: "pip" - name: Test ls before @@ -31,11 +31,11 @@ jobs: - name: Install requirements run: | - sudo apt update > /dev/null + sudo apt-get update > /dev/null sh scripts/install_requirements_pdf.sh > /dev/null # unfortunately not working - # - name: cache packages + # - name: Cache packages # uses: awalsh128/cache-apt-pkgs-action@latest # with: # packages: texlive-xetex texlive-lang-german latexmk @@ -54,7 +54,7 @@ jobs: # run: sh scripts/make_pdf.sh > /dev/null run: latexmk layout/test -f - # - name: publish log to release + # - name: Publish log to release # uses: softprops/action-gh-release@v2 # with: # tag_name: WorkInProgress diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e45442f24..a986d21a6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -90,4 +90,4 @@ repos: 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/scripts/ebook/step_3.py b/scripts/ebook/step_3.py index 93f73be59..56ab49e33 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_ebook.sh b/scripts/install_requirements_ebook.sh index 53c3dcac9..53110fed6 100755 --- a/scripts/install_requirements_ebook.sh +++ b/scripts/install_requirements_ebook.sh @@ -1,6 +1,6 @@ #!/bin/sh -sudo apt install texlive-extra-utils pandoc calibre imagemagick ghostscript +sudo apt-get install texlive-extra-utils pandoc calibre imagemagick ghostscript # pandoc calibre : for ebook converting # texlive-extra-utils : for latexpand # imagemagick ghostscript : for pdf title page to image conversion diff --git a/scripts/install_requirements_pdf.sh b/scripts/install_requirements_pdf.sh index 35a97ec71..79703953d 100755 --- a/scripts/install_requirements_pdf.sh +++ b/scripts/install_requirements_pdf.sh @@ -1,3 +1,3 @@ #!/bin/sh -sudo apt install texlive-xetex texlive-lang-german latexmk +sudo apt-get install texlive-xetex texlive-lang-german latexmk