Skip to content

Commit

Permalink
Python 3.12 and minor renamings
Browse files Browse the repository at this point in the history
  • Loading branch information
entorb committed Apr 29, 2024
1 parent 47d0fb0 commit b4657b4
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 53 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/check-and-ebook.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -22,43 +21,43 @@ 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')
hashed=${{ hashFiles('chapters/*.tex') }}
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

#
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/make-pdf-1-select.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -43,47 +43,47 @@ 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
run: |
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
latexmk -v
# 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
prerelease: true
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"
Expand All @@ -93,5 +93,5 @@ jobs:
run: |
ls -l
- name: print end date
- name: Print end date
run: date +%Y-%m-%d_%H:%M
14 changes: 7 additions & 7 deletions .github/workflows/make-pdf-6-parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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"
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/make-pdf-all-serial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -28,20 +28,20 @@ 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
latexmk -v
# 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
Expand All @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/make-pdf-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ repos:
args: ["--disable", "MD013"]

default_language_version:
python: python3.10
python: python3.12
2 changes: 1 addition & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
@@ -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"])
Expand Down
2 changes: 1 addition & 1 deletion scripts/ebook/step_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_requirements_ebook.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion scripts/install_requirements_pdf.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b4657b4

Please sign in to comment.