Skip to content

Commit 4e62a23

Browse files
authored
Merge pull request #50 from androidWG/dev
Changes for 0.11.1
2 parents 225cd75 + 920ee62 commit 4e62a23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+4115
-831
lines changed

.github/workflows/test-build.yml

Lines changed: 46 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Build, test & upload new version
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches: [ "main" ]
67
pull_request:
@@ -9,53 +10,68 @@ on:
910
permissions:
1011
contents: read
1112

13+
env:
14+
PY_VERSION: 3.12
15+
PYTHONIOENCODING: utf-8:replace
16+
1217
jobs:
13-
build:
18+
test_and_build:
19+
name: Test and Build for distribution
1420
strategy:
21+
fail-fast: false
1522
matrix:
16-
os: [ ubuntu-latest, windows-latest ]
23+
os: [ windows-latest, ubuntu-latest ]
24+
include:
25+
- os: ubuntu-latest
26+
uv_cache: ~/.cache/uv
27+
uv_install: curl -LsSf https://astral.sh/uv/install.sh | sh
28+
- os: windows-latest
29+
uv_cache: C:\Users\runneradmin\AppData\Local\uv\cache
30+
uv_install: |
31+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
32+
export PATH=$PATH:"/C/Users/runneradmin/.local/bin"
33+
1734
1835
runs-on: ${{ matrix.os }}
1936

2037
steps:
2138
- uses: actions/checkout@v3
22-
- name: Set up Python 3.11
39+
- name: Cache Python and UV
40+
id: cache-python
41+
uses: actions/cache@v4
42+
env:
43+
cache-name: cache-python-uv
44+
with:
45+
path: |
46+
.venv
47+
${{ matrix.uv_cache }}
48+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('uv.lock') }}
49+
restore-keys: |
50+
${{ runner.os }}-test-${{ env.cache-name }}-
51+
${{ runner.os }}-test-
52+
${{ runner.os }}-
53+
- name: Set up Python ${{ env.PY_VERSION }}
2354
uses: actions/setup-python@v4
2455
with:
25-
python-version: "3.11"
26-
- name: Setup environment
56+
python-version: ${{ env.PY_VERSION }}
57+
- name: Install requirements
2758
shell: bash
2859
run: |
60+
${{ matrix.uv_install }}
61+
2962
if [ "$RUNNER_OS" == "Linux" ]; then
3063
sudo apt-get install libcairo-dev libgirepository1.0-dev python3-gi gobject-introspection gir1.2-gtk-3.0 gir1.2-appindicator3-0.1
3164
fi
32-
python -m pip install packaging pipenv psutil
33-
python setup.py setup
65+
66+
pip install packaging psutil
67+
- name: Run setup
68+
run: python setup.py setup
69+
- name: Run tests
70+
run: python setup.py test
3471
- name: Build
3572
run: python setup.py build
3673
- name: Upload files
37-
uses: actions/upload-artifact@v3
74+
uses: actions/upload-artifact@v4
3875
with:
3976
name: ${{ matrix.os }} dist files
40-
path: dist/discord.fm-*
41-
test:
42-
strategy:
43-
matrix:
44-
os: [ windows-latest, ubuntu-latest ]
45-
46-
runs-on: ${{ matrix.os }}
47-
48-
# TODO: Add cache support
49-
steps:
50-
- uses: actions/checkout@v3
51-
- name: Set up Python 3.11
52-
uses: actions/setup-python@v4
53-
with:
54-
python-version: "3.11"
55-
- name: Setup environment
56-
shell: bash
57-
run: |
58-
python -m pip install packaging pipenv psutil
59-
python setup.py setup
60-
- name: Run tests
61-
run: python setup.py test
77+
path: dist/discord.fm-*.*

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,11 @@ patches/mtime-cache.json
196196

197197
spec/fixtures/logo.png
198198

199-
electron/
200-
eel/
201199
*/bdist*/
202200
*.pid
203201
build/discord_fm*/
204202
build/settings_ui*/
205-
203+
build_temp/
206204
.flatpak-builder/
207205
.pipcache/
208206
com.androidWG.Discordfm.*

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

.run/Unit Tests.run.xml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
<component name="ProjectRunConfigurationManager">
22
<configuration default="false" name="Unit Tests" type="tests" factoryName="py.test">
33
<module name="Discord.fm" />
4+
<option name="ENV_FILES" value="" />
45
<option name="INTERPRETER_OPTIONS" value="" />
56
<option name="PARENT_ENVS" value="true" />
6-
<option name="SDK_HOME" value="C:\Users\samu-\.virtualenvs\Discord.fm-22DKCecQ\Scripts\python.exe" />
7-
<option name="SDK_NAME" value="Pipenv (Discord.fm)" />
7+
<envs>
8+
<env name="PYSTRAY_BACKEND" value="dummy" />
9+
</envs>
10+
<option name="SDK_HOME" value="" />
811
<option name="WORKING_DIRECTORY" value="" />
9-
<option name="IS_MODULE_SDK" value="false" />
12+
<option name="IS_MODULE_SDK" value="true" />
1013
<option name="ADD_CONTENT_ROOTS" value="true" />
1114
<option name="ADD_SOURCE_ROOTS" value="true" />
1215
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
1316
<option name="_new_keywords" value="&quot;&quot;" />
1417
<option name="_new_parameters" value="&quot;&quot;" />
1518
<option name="_new_additionalArguments" value="&quot;tests/&quot;" />
16-
<option name="_new_target" value="&quot;&quot;" />
17-
<option name="_new_targetType" value="&quot;CUSTOM&quot;" />
19+
<option name="_new_target" value="&quot;pytest&quot;" />
20+
<option name="_new_targetType" value="&quot;PYTHON&quot;" />
1821
<method v="2" />
1922
</configuration>
2023
</component>

.run/main.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<option name="ADD_SOURCE_ROOTS" value="true" />
3838
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
3939
<option name="SCRIPT_NAME" value="main.py" />
40-
<option name="PARAMETERS" value="--force-update" />
40+
<option name="PARAMETERS" value="" />
4141
<option name="SHOW_COMMAND_LINE" value="false" />
4242
<option name="EMULATE_TERMINAL" value="false" />
4343
<option name="MODULE_MODE" value="false" />

.run/setup debugging.run.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="setup debugging" type="PythonConfigurationType" factoryName="Python">
3+
<module name="Discord.fm" />
4+
<option name="ENV_FILES" value="" />
5+
<option name="INTERPRETER_OPTIONS" value="" />
6+
<option name="PARENT_ENVS" value="true" />
7+
<envs>
8+
<env name="PYTHONUNBUFFERED" value="1" />
9+
</envs>
10+
<option name="SDK_HOME" value="" />
11+
<option name="WORKING_DIRECTORY" value="" />
12+
<option name="IS_MODULE_SDK" value="true" />
13+
<option name="ADD_CONTENT_ROOTS" value="true" />
14+
<option name="ADD_SOURCE_ROOTS" value="true" />
15+
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
16+
<option name="SCRIPT_NAME" value="setup.py" />
17+
<option name="PARAMETERS" value="test" />
18+
<option name="SHOW_COMMAND_LINE" value="false" />
19+
<option name="EMULATE_TERMINAL" value="false" />
20+
<option name="MODULE_MODE" value="false" />
21+
<option name="REDIRECT_INPUT" value="false" />
22+
<option name="INPUT_FILE" value="" />
23+
<method v="2" />
24+
</configuration>
25+
</component>

0 commit comments

Comments
 (0)