From 4797def19e2f516a7f9145189abd0943bb43770f Mon Sep 17 00:00:00 2001 From: Joey Yakimowich-Payne Date: Mon, 28 Aug 2023 16:42:10 -0600 Subject: [PATCH] Fix all poetry issues with github action --- .github/workflows/default.yml | 104 +++++++++++++++++----------------- 1 file changed, 53 insertions(+), 51 deletions(-) diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index 7b2e5e0..8c39315 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -37,6 +37,7 @@ jobs: - name: Setup Env Vars run: | export PATH="$HOME/.local/bin:$PATH" + echo "PATH=$PATH" >> $GITHUB_ENV echo "BUILD_DIR=build" >> $GITHUB_ENV echo "DIST_DIR=dist" >> $GITHUB_ENV FILE_LOC=$(find . -name info.py) @@ -62,11 +63,11 @@ jobs: - name: Check Python install run: | poetry self update - poetry shell - - which python3 - python3 --version - file python3 + poetry run which python3 + poetry run python3 --version + poetry run which pip3 + poetry run pip3 --version + poetry run file python3 - name: Install Python dependencies run: | @@ -75,19 +76,17 @@ jobs: - name: Check Python dependencies run: | - poetry shell - python3 -c "from PySide6 import __version__; print(__version__)" - python3 -c "from PySide6.QtCore import __version__; print(__version__)" - python3 -c "from PySide6.QtCore import QLibraryInfo; print(QLibraryInfo.location(QLibraryInfo.LibrariesPath))" - python3 -c "import ssl; print(ssl)" - python3 -c "from py2app.recipes import pyside6" - python3 -c 'from distutils.sysconfig import get_config_var; print(get_config_var("LDLIBRARY"))' + poetry run python3 -c "from PySide6 import __version__; print(__version__)" + poetry run python3 -c "from PySide6.QtCore import __version__; print(__version__)" + poetry run python3 -c "from PySide6.QtCore import QLibraryInfo; print(QLibraryInfo.location(QLibraryInfo.LibrariesPath))" + poetry run python3 -c "import ssl; print(ssl)" + poetry run python3 -c "from py2app.recipes import pyside6" + poetry run python3 -c 'from distutils.sysconfig import get_config_var; print(get_config_var("LDLIBRARY"))' - name: Setup Deb run: | - poetry shell - python3 create_pyinstaller_file.py - pyinstaller -w --noconfirm --hidden-import PySide6 \ + poetry run python3 create_pyinstaller_file.py + poetry run pyinstaller -w --noconfirm --hidden-import PySide6 \ --add-data "${{ env.PROJ_DIR }}/resources:." \ --icon "${{ env.PROJ_DIR }}/resources/icon.png" \ --hidden-import configobj \ @@ -114,6 +113,7 @@ jobs: name: ${{ env.PROJ_PATH }}_${{ env.VER }}_${{ matrix.os }}-tar path: | ${{ env.PROJ_MOD }}.tar.gz + retention-days: 1 - name: Deploy deb uses: actions/upload-artifact@v3 @@ -121,6 +121,7 @@ jobs: name: ${{ env.PROJ_PATH }}_${{ env.VER }}_${{ matrix.os }}-deb path: | ./*.deb + retention-days: 1 - name: Release uses: softprops/action-gh-release@v1 @@ -148,26 +149,29 @@ jobs: - name: Check Python install run: | (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python - + $PATH = $env:Path + ";" + $env:APPDATA + "\Python\Scripts\" + $env:Path = $PATH + echo "$env:Path=$PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append poetry self update - poetry shell - which python - python --version - python -c "import struct; print(struct.calcsize('P') * 8)" - which pip - pip --version + poetry run which python + poetry run python --version + poetry run python -c "import struct; print(struct.calcsize('P') * 8)" + poetry run which pip + poetry run pip --version - name: Install Python dependencies run: | + $env:Path += ";" + $env:APPDATA + "\Python\Scripts\" poetry self update poetry install poetry run pip install https://github.com/pyinstaller/pyinstaller/tarball/develop - name: Check Python dependencies run: | - poetry shell - python -c "from PySide6 import __version__; print(__version__)" - python -c "from PySide6.QtCore import __version__; print(__version__)" - python -c "from PySide6.QtCore import QLibraryInfo; print(QLibraryInfo.location(QLibraryInfo.LibrariesPath))" + $env:Path += ";" + $env:APPDATA + "\Python\Scripts\" + poetry run python -c "from PySide6 import __version__; print(__version__)" + poetry run python -c "from PySide6.QtCore import __version__; print(__version__)" + poetry run python -c "from PySide6.QtCore import QLibraryInfo; print(QLibraryInfo.location(QLibraryInfo.LibrariesPath))" - name: Setup Env Vars run: | @@ -188,9 +192,9 @@ jobs: - name: Build run: | - poetry shell - python create_pyinstaller_file.py - pyinstaller -w --noconfirm --hidden-import PySide6 ` + $env:Path += ";" + $env:APPDATA + "\Python\Scripts\" + poetry run python create_pyinstaller_file.py + poetry run pyinstaller -w --noconfirm --hidden-import PySide6 ` --add-data "${{ env.PROJ_DIR }}\resources;." ` -i ${{ env.PROJ_DIR }}\resources\icon.ico ` --hidden-import pkg_resources ` @@ -206,6 +210,7 @@ jobs: name: ${{ env.PROJECT_NAME }}_${{ env.VER }}-${{ matrix.os }}-zip path: | ${{ env.PROJECT_NAME }}-${{ env.VER }}-windows-x64.zip + retention-days: 1 - name: Release uses: softprops/action-gh-release@v1 @@ -225,7 +230,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Setup Homebrew run: | NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" @@ -239,6 +243,7 @@ jobs: - name: Setup Env Vars run: | export PATH="$HOME/.local/bin:$PATH" + echo "PATH=$PATH" >> $GITHUB_ENV echo "BUILD_DIR=build" >> $GITHUB_ENV echo "DIST_DIR=dist" >> $GITHUB_ENV FILE_LOC=$(find . -name info.py) @@ -259,12 +264,11 @@ jobs: - name: Check Python install run: | poetry self update - poetry shell - which python3 - python3 --version - which pip3 - pip3 --version - file python3 + poetry run which python3 + poetry run python3 --version + poetry run which pip3 + poetry run pip3 --version + poetry run file python3 - name: Install Python dependencies run: | @@ -277,7 +281,6 @@ jobs: CFLAGS: -arch x86_64 -arch arm64 ARCHFLAGS: -arch x86_64 -arch arm64 run: | - poetry shell poetry run pip3 uninstall cffi -y poetry run pip3 install --no-binary :all: cffi poetry run pip3 uninstall cryptography -y @@ -286,19 +289,17 @@ jobs: - name: Check Python dependencies run: | - poetry shell - python3 -c "from PySide6 import __version__; print(__version__)" - python3 -c "from PySide6.QtCore import __version__; print(__version__)" - python3 -c "from PySide6.QtCore import QLibraryInfo; print(QLibraryInfo.location(QLibraryInfo.LibrariesPath))" - python3 -c "import ssl; print(ssl)" - python3 -c "from py2app.recipes import pyside6" - python3 -c 'from distutils.sysconfig import get_config_var; print(get_config_var("LDLIBRARY"))' + poetry run python3 -c "from PySide6 import __version__; print(__version__)" + poetry run python3 -c "from PySide6.QtCore import __version__; print(__version__)" + poetry run python3 -c "from PySide6.QtCore import QLibraryInfo; print(QLibraryInfo.location(QLibraryInfo.LibrariesPath))" + poetry run python3 -c "import ssl; print(ssl)" + poetry run python3 -c "from py2app.recipes import pyside6" + poetry run python3 -c 'from distutils.sysconfig import get_config_var; print(get_config_var("LDLIBRARY"))' - name: Build run: | - poetry shell - python3 create_pyinstaller_file.py + poetry run python3 create_pyinstaller_file.py # py2app works better - python3 buildPy2app.py py2app + poetry run python3 buildPy2app.py py2app # pyinstaller -w --noconfirm --hidden-import PySide6 \ # --add-data "${{ env.PROJ_DIR }}/resources:." \ # --icon "${{ env.PROJ_DIR }}/resources/icon.icns" \ @@ -309,18 +310,17 @@ jobs: # --onefile -n "${{ env.PROJECT_NAME }}" pyinstaller.py mv "${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}.app" "${{ env.PROJECT_NAME }}.app" # Clean the directory so it's not full of python bytecode - pyclean "${{ env.PROJECT_NAME }}.app" - python3 ci/cleandist.py "${{ env.PROJECT_NAME }}.app" - python3 ci/codesign.py "${{ env.PROJECT_NAME }}.app" + poetry run pyclean "${{ env.PROJECT_NAME }}.app" + poetry run python3 ci/cleandist.py "${{ env.PROJECT_NAME }}.app" + poetry run python3 ci/codesign.py "${{ env.PROJECT_NAME }}.app" zip -ry "${{ env.PROJECT_NAME }}_${{ env.VER }}-macos-universal.zip" "${{ env.PROJECT_NAME }}.app" - name: Prepare for deployment run: | - poetry shell mkdir -p "${{ env.DIST_DIR }}/dmg" test -f "${{ env.PROJECT_NAME }}_${{ env.VER }}.dmg" && rm "${{ env.PROJECT_NAME }}_${{ env.VER }}.dmg" mv "${{ env.PROJECT_NAME }}.app" "${{ env.DIST_DIR}}/dmg/" - create-dmg \ + poetry run create-dmg \ --volname "${{ env.PROJECT_NAME }}-${{ env.VER }} Installer" \ --volicon "${{ env.PROJ_DIR }}/resources/icon.icns" \ --window-pos 200 120 \ @@ -339,6 +339,7 @@ jobs: name: ${{ env.PROJECT_NAME }}_${{ env.VER }}-${{ matrix.os }}-zip path: | ${{ env.PROJECT_NAME }}_${{ env.VER }}-macos-universal.zip + retention-days: 1 - name: Deploy DMG uses: actions/upload-artifact@v3 @@ -346,6 +347,7 @@ jobs: name: ${{ env.PROJECT_NAME }}_${{ env.VER }}-${{ matrix.os}}-dmg path: | ${{ env.PROJECT_NAME }}_${{ env.VER }}-universal.dmg + retention-days: 1 - name: Release uses: softprops/action-gh-release@v1