From 3b0af4fca230a6061bf06144310724aaa62526ab Mon Sep 17 00:00:00 2001 From: zariiii9003 Date: Tue, 10 Dec 2024 17:47:13 +0100 Subject: [PATCH 1/2] try to fix pyinstaller --- .github/workflows/build.yml | 24 +++++++++-------- .github/workflows/build_linux.yml | 40 ----------------------------- .github/workflows/build_windows.yml | 40 ----------------------------- requirements_exe_build.txt | 5 ---- tox.ini | 15 +++++++++++ 5 files changed, 28 insertions(+), 96 deletions(-) delete mode 100644 .github/workflows/build_linux.yml delete mode 100644 .github/workflows/build_windows.yml delete mode 100644 requirements_exe_build.txt diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cea71dc23..d0b5cad2b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: build_macos +name: build_linux on: [push, pull_request] @@ -7,7 +7,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] python-version: ["3.12"] steps: @@ -18,18 +18,20 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install packages + - name: Install linux libraries + shell: bash + if: ${{ matrix.os == 'ubuntu-latest' }} run: | - pip install -r requirements_exe_build.txt - python -m build --wheel + sudo apt update + sudo apt install libegl1 libopengl0 - - name: Build an executable - shell: bash - if: ${{ matrix.python-version == '3.12' }} + - name: Install Python packages + run: | + pip install tox + + - name: Build the executable run: | - pip install -r requirements_exe_build.txt - python -m build --wheel - pyinstaller asammdf.spec --distpath dist/${RUNNER_OS} --noconfirm --clean + tox -e pyinstaller -- --distpath dist/${{ matrix.os }} --noconfirm --clean # see: https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts - name: Archive dist artifacts diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml deleted file mode 100644 index 89dc5255d..000000000 --- a/.github/workflows/build_linux.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: build_linux - -on: [push, pull_request] - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - python-version: ["3.10"] - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install packages - run: | - pip install -r requirements_exe_build.txt - python -m build --wheel - - - name: Build an executable - shell: bash - if: ${{ matrix.python-version == '3.10' }} - run: | - sudo apt update - sudo apt install libegl1 libopengl0 - pyinstaller asammdf.spec --distpath dist/${RUNNER_OS} --noconfirm --clean - - # see: https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts - - name: Archive dist artifacts - uses: actions/upload-artifact@v4 - with: - name: dist - path: dist/** - if-no-files-found: error diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml deleted file mode 100644 index 3e608810f..000000000 --- a/.github/workflows/build_windows.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: build_windows - -on: [push, pull_request] - -jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [windows-latest] - python-version: ["3.12"] - - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install packages - run: | - pip install -r requirements_exe_build.txt - python -m build --wheel - - - name: Build an executable - shell: bash - if: ${{ matrix.python-version == '3.12' }} - run: | - pip install -r requirements_exe_build.txt - python -m build --wheel - pyinstaller asammdf.spec --distpath dist/${RUNNER_OS} --noconfirm --clean - - # see: https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts - - name: Archive dist artifacts - uses: actions/upload-artifact@v4 - with: - name: dist - path: dist/** - if-no-files-found: error diff --git a/requirements_exe_build.txt b/requirements_exe_build.txt deleted file mode 100644 index b305c6596..000000000 --- a/requirements_exe_build.txt +++ /dev/null @@ -1,5 +0,0 @@ ---editable .[decode,encryption,export,export_matlab_v5,gui,symbolic_math] -build -cmerg -pyopengl -pyinstaller diff --git a/tox.ini b/tox.ini index 7406b9c32..c9cf038f5 100644 --- a/tox.ini +++ b/tox.ini @@ -39,6 +39,21 @@ deps = commands = sphinx-build --builder html --nitpicky doc doc/_build/html +[testenv:pyinstaller] +base = +deps = + pyinstaller + pyopengl +extras = + decode + encryption + export + export_matlab_v5 + gui + symbolic_math +commands = + pyinstaller asammdf.spec {posargs} + [gh-actions] python = 3.9: py39, black, ruff, doc From d8af4dcfdbd4f07491232245be996660a29c4c06 Mon Sep 17 00:00:00 2001 From: zariiii9003 Date: Tue, 10 Dec 2024 17:55:31 +0100 Subject: [PATCH 2/2] fix artifact name conflict --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0b5cad2b..963e65416 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: build_linux +name: pyinstaller_build on: [push, pull_request] @@ -37,6 +37,6 @@ jobs: - name: Archive dist artifacts uses: actions/upload-artifact@v4 with: - name: dist - path: dist/** + name: pyinstaller-${{ matrix.os }} + path: dist/${{ matrix.os }}/** if-no-files-found: error