From d1f304188c7ca99b7f18f4580ab4b56ef724042b Mon Sep 17 00:00:00 2001 From: Nathaniel van Diepen Date: Sat, 1 Nov 2025 15:39:23 -0600 Subject: [PATCH] Fix strip in v4.0 image --- .github/workflows/build.yml | 41 ++++++++++++++++++------------------- pyproject.toml | 2 +- toltec/hooks/strip.py | 11 ++++++---- toltec/util.py | 8 ++++---- 4 files changed, 32 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e92441f..16d099b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,9 +15,9 @@ jobs: fail-fast: false matrix: python: - - '3.11' - - '3.12' - - '3.13' + - "3.11" + - "3.12" + - "3.13" steps: - name: Checkout the Git repository uses: actions/checkout@v4 @@ -25,7 +25,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - cache: 'pip' + cache: "pip" - name: Check formatting run: make format lint: @@ -35,9 +35,9 @@ jobs: fail-fast: false matrix: python: - - '3.11' - - '3.12' - - '3.13' + - "3.11" + - "3.12" + - "3.13" steps: - name: Checkout the Git repository uses: actions/checkout@v4 @@ -45,7 +45,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - cache: 'pip' + cache: "pip" - name: Check for erroneous constructs run: make lint links: @@ -57,7 +57,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v4 with: - node-version: '16' + node-version: "16" - name: Check Markdown links run: | npm install -g markdown-link-check @@ -69,9 +69,9 @@ jobs: fail-fast: false matrix: python: - - '3.11' - - '3.12' - - '3.13' + - "3.11" + - "3.12" + - "3.13" steps: - name: Checkout the Git repository uses: actions/checkout@v4 @@ -79,7 +79,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} - cache: 'pip' + cache: "pip" - name: Run tests run: make test build: @@ -92,8 +92,8 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.13' - cache: 'pip' + python-version: "3.13" + cache: "pip" - name: Building toltecmk run: make build - uses: actions/upload-artifact@v4 @@ -111,8 +111,8 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: '3.13' - cache: 'pip' + python-version: "3.13" + cache: "pip" - name: Building toltecmk run: make standalone - name: Sanity check @@ -150,8 +150,8 @@ jobs: strategy: matrix: artifact: - - 'pip' - - 'toltecmk' + - "pip" + - "toltecmk" permissions: contents: write steps: @@ -164,8 +164,7 @@ jobs: name: ${{ matrix.artifact }} path: dist - name: Upload to release - run: - find . -type f | xargs -rI {} gh release upload "$TAG" {} --clobber + run: find . -type f | xargs -rI {} gh release upload "$TAG" {} --clobber env: GH_TOKEN: ${{ github.token }} TAG: ${{ github.event.release.tag_name }} diff --git a/pyproject.toml b/pyproject.toml index 1070897..6ce6d72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "toltecmk" -version = "0.5.4" +version = "0.5.5" authors = [ { name="Mattéo Delabre", email="git.matteo@delab.re" }, { name="Eeems", email="eeems@eeems.email" }, diff --git a/toltec/hooks/strip.py b/toltec/hooks/strip.py index e582670..b655503 100644 --- a/toltec/hooks/strip.py +++ b/toltec/hooks/strip.py @@ -162,10 +162,13 @@ def docker_file_path(file_path: str) -> str: ) if strip_arm: - script.append( - '"${CROSS_COMPILE}strip" --strip-all -- ' - + " ".join( - docker_file_path(file_path) for file_path in strip_arm + script.extend( + ( + "source /opt/x-tools/switch-arm.sh", + '"${CROSS_COMPILE}strip" --strip-all -- ' + + " ".join( + docker_file_path(file_path) for file_path in strip_arm + ), ) ) diff --git a/toltec/util.py b/toltec/util.py index 98a5474..f06d6a7 100644 --- a/toltec/util.py +++ b/toltec/util.py @@ -29,9 +29,9 @@ LOGGING_FORMAT = "[%(levelname)8s] %(name)s: %(message)s" -def argparse_add_verbose(parser: argparse.ArgumentParser) -> None: +def argparse_add_verbose(parser: argparse.ArgumentParser) -> argparse.Action: """Add a CLI option for setting the verbosity level.""" - parser.add_argument( + return parser.add_argument( "-v", "--verbose", action="store_const", @@ -41,9 +41,9 @@ def argparse_add_verbose(parser: argparse.ArgumentParser) -> None: ) -def argparse_add_warning(parser: argparse.ArgumentParser) -> None: +def argparse_add_warning(parser: argparse.ArgumentParser) -> argparse.Action: """Add a CLI option for controlling warnings.""" - parser.add_argument( + return parser.add_argument( "-W", "--warnings", choices=("default", "error", "ignore"),