Skip to content

Commit 00c3cf9

Browse files
authored
Merge pull request #57 from UniversityRadioYork/ash-linux-updates
chore: updates to build on latest python/linux
2 parents 6d7c3aa + 046fd3e commit 00c3cf9

18 files changed

+4947
-125
lines changed

.github/workflows/build.yaml

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,42 @@ name: Package
22
on: [push]
33

44
jobs:
5-
build-macos:
5+
# build-macos:
66

7-
runs-on: macos-latest
8-
timeout-minutes: 15
9-
strategy:
10-
fail-fast: false
11-
matrix:
12-
python-version: ['3.9']
13-
node-version: ['14']
7+
# runs-on: macos-latest
8+
# timeout-minutes: 15
9+
# strategy:
10+
# fail-fast: false
11+
# matrix:
12+
# python-version: ['3.9', '3.11']
13+
# node-version: ['20']
1414

15-
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up Python ${{ matrix.python-version }}
18-
uses: actions/setup-python@v2
19-
with:
20-
python-version: ${{ matrix.python-version }}
21-
- uses: actions/checkout@v2
22-
- name: Set up Node ${{ matrix.node-version }}
23-
uses: actions/setup-node@v2
24-
with:
25-
node-version: ${{ matrix.node-version }}
26-
- name: Build .app
27-
run: |
28-
npm run presenter-make
29-
build/build-macos.sh
30-
zip -r build/output/BAPSicle.zip build/output/BAPSicle.app
31-
- name: Extract branch name
32-
shell: bash
33-
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
34-
id: extract_branch
35-
- name: Archive Build
36-
uses: actions/upload-artifact@v2
37-
with:
38-
name: BAPSicle-${{ steps.extract_branch.outputs.branch }}-${{github.sha}}-MacOS
39-
path: |
40-
build/output/BAPSicle.zip
15+
# steps:
16+
# - uses: actions/checkout@v2
17+
# - name: Set up Python ${{ matrix.python-version }}
18+
# uses: actions/setup-python@v2
19+
# with:
20+
# python-version: ${{ matrix.python-version }}
21+
# - uses: actions/checkout@v2
22+
# - name: Set up Node ${{ matrix.node-version }}
23+
# uses: actions/setup-node@v2
24+
# with:
25+
# node-version: ${{ matrix.node-version }}
26+
# - name: Build .app
27+
# run: |
28+
# npm run presenter-make
29+
# build/build-macos.sh
30+
# zip -r build/output/BAPSicle.zip build/output/BAPSicle.app
31+
# - name: Extract branch name
32+
# shell: bash
33+
# run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
34+
# id: extract_branch
35+
# - name: Archive Build
36+
# uses: actions/upload-artifact@v2
37+
# with:
38+
# name: BAPSicle-${{ steps.extract_branch.outputs.branch }}-${{github.sha}}-MacOS
39+
# path: |
40+
# build/output/BAPSicle.zip
4141

4242
build-ubuntu:
4343

@@ -46,15 +46,17 @@ jobs:
4646
strategy:
4747
fail-fast: false
4848
matrix:
49-
python-version: ['3.8','3.9']
50-
node-version: ['14']
49+
python-version: ['3.8','3.9', '3.11']
50+
node-version: ['20']
5151

5252
steps:
5353
- uses: actions/checkout@v2
5454
- name: Set up Python ${{ matrix.python-version }}
5555
uses: actions/setup-python@v2
5656
with:
5757
python-version: ${{ matrix.python-version }}
58+
- name: Setup poetry
59+
uses: Gr1N/setup-poetry@v8
5860
- uses: actions/checkout@v2
5961
- name: Set up Node ${{ matrix.node-version }}
6062
uses: actions/setup-node@v2
@@ -69,9 +71,9 @@ jobs:
6971
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
7072
id: extract_branch
7173
- name: Archive Build
72-
uses: actions/upload-artifact@v2
74+
uses: actions/upload-artifact@v4
7375
with:
74-
name: BAPSicle-${{ steps.extract_branch.outputs.branch }}-${{github.sha}}-Ubuntu
76+
name: BAPSicle-${{ steps.extract_branch.outputs.branch }}-${{github.sha}}-Ubuntu-python${{matrix.python-version}}-node${{matrix.node-version}}
7577
path: |
7678
build/output/BAPSicle
7779
@@ -82,15 +84,17 @@ jobs:
8284
strategy:
8385
fail-fast: false
8486
matrix:
85-
python-version: ['3.9']
86-
node-version: ['14']
87+
python-version: ['3.9', '3.11']
88+
node-version: ['20']
8789

8890
steps:
8991
- uses: actions/checkout@v2
9092
- name: Set up Python ${{ matrix.python-version }}
9193
uses: actions/setup-python@v2
9294
with:
9395
python-version: ${{ matrix.python-version }}
96+
- name: Setup poetry
97+
uses: Gr1N/setup-poetry@v8
9498
- uses: actions/checkout@v2
9599
- name: Set up Node ${{ matrix.node-version }}
96100
uses: actions/setup-node@v2
@@ -105,9 +109,9 @@ jobs:
105109
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF##*/})"
106110
id: extract_branch
107111
- name: Archive Build
108-
uses: actions/upload-artifact@v2
112+
uses: actions/upload-artifact@v4
109113
with:
110-
name: BAPSicle-${{ steps.extract_branch.outputs.branch }}-${{github.sha}}-Windows
114+
name: BAPSicle-${{ steps.extract_branch.outputs.branch }}-${{github.sha}}-Windows-python${{matrix.python-version}}-node${{matrix.node-version}}
111115
path: |
112116
build/output/BAPSicle.exe
113117
install/

.github/workflows/test.yaml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,33 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
python-version: [3.8, 3.9]
13+
python-version: [3.8, 3.9, 3.11]
1414

1515
steps:
1616
- uses: actions/checkout@v2
1717
- name: Set up Python ${{ matrix.python-version }}
1818
uses: actions/setup-python@v2
1919
with:
2020
python-version: ${{ matrix.python-version }}
21+
- name: Setup poetry
22+
uses: Gr1N/setup-poetry@v8
2123
- name: Install Python dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install -r build/requirements-dev.txt
25-
pip install -r build/requirements.txt
26-
pip install -r build/requirements-macos.txt
27-
- name: Install bapsicle as module
28-
run: |
29-
pip install -e .
24+
run: poetry install --with=dev
3025
- name: Lint with flake8
3126
run: |
3227
# stop the build if there are Python syntax errors or undefined names
33-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
28+
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
3429
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
35-
flake8 . --count --ignore=E402,E226,E24,W50,W690 --max-complexity=25 --max-line-length=127 --statistics
30+
poetry run flake8 . --count --ignore=E402,E226,E24,W50,W690 --max-complexity=25 --max-line-length=127 --statistics
3631
- name: Test with unittest
3732
if: ${{ always() }}
3833
timeout-minutes: 10
3934
run: |
40-
python -m sounddevice
41-
python -m unittest
35+
poetry run python -m sounddevice
36+
poetry run python -m unittest
4237
- name: Archive test logs
4338
if: ${{ always() }}
44-
uses: actions/upload-artifact@v2
39+
uses: actions/upload-artifact@v4
4540
with:
4641
name: Logs - Python ${{ matrix.python-version }}
4742
path: |

build/build-exe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
file.close()
77

88
if isLinux():
9-
cmd_str = "python3 -m PyInstaller "
9+
cmd_str = "poetry run python3 -m PyInstaller "
1010
else:
11-
cmd_str = "pyinstaller "
11+
cmd_str = "poetry run pyinstaller "
1212

1313
json_dests = ["icon_file", "clean_build"]
1414
pyi_dests = ["icon", "clean"]

build/build-linux.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,13 @@ echo "BRANCH: str = \"$build_branch\"" >> ../build.py
1111
sudo apt install libportaudio2
1212
sudo apt install python3-pip python3-venv ffmpeg
1313

14-
python3 -m venv ../venv
15-
source ../venv/bin/activate
14+
poetry install
1615

17-
pip3 install wheel
18-
pip3 install -r requirements.txt
19-
pip3 install -r requirements-linux.txt
20-
pip3 install -e ../
21-
22-
python3 ./generate-build-exe-config.py
16+
poetry run python3 ./generate-build-exe-config.py
2317

2418
chmod +x output/BAPSicle
2519

26-
python3 ./build-exe.py
20+
poetry run python3 ./build-exe.py
2721

2822
bash ./build-exe-pyinstaller-command.sh
2923

build/build-macos.sh

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,18 @@ build_branch="$(git branch --show-current)"
88
echo "BUILD: str = \"$build_commit\"" > ../build.py
99
echo "BRANCH: str = \"$build_branch\"" >> ../build.py
1010

11-
python3 -m venv ../venv
12-
source ../venv/bin/activate
11+
poetry install
1312

14-
pip3 install wheel
15-
pip3 install -r requirements.txt
16-
pip3 install -r requirements-macos.txt
17-
pip3 install -e ..\
13+
poetry run python3 ./generate-build-exe-config.py
1814

19-
python3 ./generate-build-exe-config.py
20-
21-
python3 ./build-exe.py
15+
poetry run python3 ./build-exe.py
2216

2317
bash ./build-exe-pyinstaller-command.sh
2418

2519
rm ./*.spec
2620

2721
cd ../
28-
python3 build/generate-platypus-config.py
22+
poetry run python3 build/generate-platypus-config.py
2923
cd build
3024

3125
brew install platypus

build/build-windows.bat

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,14 @@ SET build_branch=%%F
1010
echo BUILD: str = "%build_commit%"> ..\build.py
1111
echo BRANCH: str = "%build_branch%">> ..\build.py
1212

13-
if "%1" == "no-venv" goto skip-venv
14-
15-
py -m venv ..\venv
16-
..\venv\Scripts\activate
17-
18-
:skip-venv
19-
20-
pip install wheel
21-
pip install -r requirements.txt
22-
pip install -r requirements-windows.txt
23-
pip install -e ..\
13+
poetry install
2414

2515
: Generate the json config in case you wanted to use the gui to regenerate the command below manually.
26-
python generate-build-exe-config.py
16+
poetry run python generate-build-exe-config.py
2717

2818
: auto-py-to-exe -c build-exe-config.json -o ../install
2919

30-
python build-exe.py
20+
poetry run python build-exe.py
3121

3222
build-exe-pyinstaller-command.bat
3323

build/requirements-dev.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

build/requirements-linux.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/requirements-macos.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/requirements-windows.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

build/requirements.txt

Lines changed: 0 additions & 17 deletions
This file was deleted.

dev/install-githook.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
pip3 install autopep8
2+
poetry install
33
cd "$(dirname "$0")"
44
cp "./pre-commit" "../.git/hooks/"
55

helpers/device_manager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ def getAudioOutputs(cls) -> Tuple[List[Dict]]:
6464
def getAudioDevices(cls) -> List[str]:
6565
mixer.init(44100, -16, 2, 1024)
6666
is_capture = 0 # zero to request playback devices, non-zero to request recording devices
67-
num = sdl2.get_num_audio_devices(is_capture)
68-
names = [str(sdl2.get_audio_device_name(i, is_capture), encoding="utf-8") for i in range(num)]
67+
names = sdl2.audio.get_audio_device_names(is_capture)
6968
mixer.quit()
7069
return names
7170

package-lock.json

Lines changed: 20 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)