Skip to content

Attempt to install packages needed by pyqt6 for any system type #22

Attempt to install packages needed by pyqt6 for any system type

Attempt to install packages needed by pyqt6 for any system type #22

Workflow file for this run

name: Build GUI
on:
push:
branches: [ "develop"]
# paths: ['.github/workflows/**', 'build_gui.yaml']
pull_request:
branches: [ "develop"]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [windows-latest, macos-latest, ubuntu-latest]
os: [windows-latest]
python-version: ['3.10']
steps:
- name: Windows-specific step for enabling long paths
if: runner.os == 'Windows'
run: |
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
# Windows-specific commands here
- name: Configure Git for long paths
if: runner.os == 'Windows'
run: git config --global core.longpaths true
- uses: fastai/workflows/nbdev-ci@master
with:
version: '3.10'
skip_test: 'true'
# The following installation is for some packages needed by PyQt6
- name: Install system dependencies
uses: ConorMacBride/install-package@v1
with:
apt: libgl1-mesa-glx libegl1-mesa libxkbcommon-x11-0 libdbus-1-3 # For Ubuntu
brew: qt # Example for macOS, replace with actual dependencies if needed
choco: vcredist140 # Example for Windows, replace with actual dependencies if needed
- name: test
if: runner.os == 'Linux'
run: |
ls
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
- name: Copy __init__.py to root as trouver_gui.py
run: |
# Copy the file in a cross-platform way
if [[ "$RUNNER_OS" == "Windows" ]]; then
copy .\trouver\app\__init__.py .\trouver_gui.py
else
cp ./trouver/app/__init__.py ./trouver_gui.py
fi
- name: Replace relative imports in trouver_gui.py
run: |
if [[ "$RUNNER_OS" == "Windows" ]]; then
powershell -Command "(Get-Content .\trouver_gui.py) -replace '^from \.\.', 'from trouver' | Set-Content .\trouver_gui.py"
else
sed -i 's/^from \.\./from trouver/' trouver_gui.py
fi
- name: Build with PyInstaller
run: pyinstaller --onefile trouver_gui.py
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: trouver-${{ matrix.os }}
path: dist/trouver*