Skip to content

Commit 7206f2a

Browse files
committed
Remove Qt feature from PyInstaller test
1 parent d359c85 commit 7206f2a

File tree

5 files changed

+38
-137
lines changed

5 files changed

+38
-137
lines changed

.github/workflows/test.yml

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ defaults:
1212
shell: bash
1313

1414
env:
15-
TEST_IMG_OUTPUT_PATH: 'dist'
1615
PYTHONIOENCODING: 'utf-8' # For log color
1716
PY_COLORS: 1 # For log color with pytest
1817

@@ -33,11 +32,12 @@ jobs:
3332
- {py: '3.9', qt-lib: 'pyside', qt: 'PySide6-Essentials'}
3433
- {py: '3.10', qt-lib: 'pyqt', qt: 'PyQt6'}
3534
- {py: '3.10', qt-lib: 'pyside', qt: 'PySide6-Essentials'}
36-
- {py: '3.11', qt-lib: 'pyqt', qt: 'PyQt6', os: ubuntu-latest}
37-
- {py: '3.11', qt-lib: 'pyqt', qt: 'PyQt6', os: macOS-latest}
38-
- {py: '3.11', qt-lib: 'pyqt', qt: 'PyQt6', os: windows-latest}
35+
- {os: ubuntu-latest, py: '3.11', qt-lib: 'pyqt', qt: 'PyQt6'}
36+
- {os: macOS-latest, py: '3.11', qt-lib: 'pyqt', qt: 'PyQt6'}
37+
- {os: windows-latest, py: '3.11', qt-lib: 'pyqt', qt: 'PyQt6'}
38+
env:
39+
TEST_IMG_OUTPUT_PATH: 'dist'
3940
runs-on: ${{ matrix.os }}
40-
name: ${{ matrix.os }} py-${{ matrix.py }} qt-${{ matrix.qt }}
4141

4242
steps:
4343
- uses: actions/checkout@v3
@@ -99,13 +99,13 @@ jobs:
9999
run: |
100100
poetry run python ./tools/capture.py \
101101
-i ${{runner.os}}-py${{matrix.py}}-${{matrix.qt}} \
102-
-d ${{ env.TEST_IMG_OUTPUT_PATH}}
102+
-d ${{ env.TEST_IMG_OUTPUT_PATH }}
103103
104104
- name: Archive WidgetGallery img
105105
uses: actions/upload-artifact@v3
106106
with:
107107
name: widget-img
108-
path: ./${{ env.TEST_IMG_OUTPUT_PATH}}/*.png
108+
path: ./${{ env.TEST_IMG_OUTPUT_PATH }}/*.png
109109

110110

111111
# Python version does not affect tests without Qt.
@@ -116,7 +116,6 @@ jobs:
116116
matrix:
117117
os: [ubuntu-latest, macOS-latest, windows-latest]
118118
runs-on: ${{ matrix.os }}
119-
name: ${{ matrix.os }}
120119

121120
steps:
122121
- uses: actions/checkout@v3
@@ -140,9 +139,8 @@ jobs:
140139
${{ steps.setup-python.outputs.python-version }}-\
141140
${{ hashFiles('**/poetry.lock') }}"
142141

143-
- name: Install dependencies
142+
- run: poetry install --only github-actions,test,main
144143
if: steps.cache-venv.outputs.cache-hit != 'true'
145-
run: poetry install --only github-actions,test,main
146144

147145
- name: Run pytest without Qt lib
148146
run: |
@@ -161,7 +159,9 @@ jobs:
161159
token: ${{ secrets.CODECOV_TOKEN }}
162160

163161

164-
pyinstaller:
162+
PyInstaller:
163+
env:
164+
TEST_FILE_NAME: test_with_PyInstaller.py
165165
runs-on: ubuntu-latest
166166
steps:
167167
- uses: actions/checkout@v3
@@ -183,7 +183,29 @@ jobs:
183183
if: steps.cache-venv.outputs.cache-hit != 'true'
184184

185185
- name: Install Python dependencies
186-
run: python -m pip install -U PyInstaller PyQt6
186+
run: .venv/bin/python -m pip install -U . PyInstaller
187+
188+
- name: Make test file
189+
run: |
190+
cat <<'EOL' >> ${{ env.TEST_FILE_NAME }}
191+
import logging
192+
import qdarktheme
193+
logging.basicConfig(level=logging.INFO)
194+
logging.info("qdarktheme version: %s", qdarktheme.__version__)
195+
logging.info("Available themes: %s", qdarktheme.get_themes())
196+
logging.info("Checking load_stylesheet() ...")
197+
qdarktheme.load_stylesheet()
198+
logging.info("Checking clear_cache() ...")
199+
qdarktheme.clear_cache()
200+
EOL
201+
cat -n ${{ env.TEST_FILE_NAME }}
202+
203+
- name: Build test app
204+
run: |
205+
.venv/bin/python -m PyInstaller -y --onefile \
206+
${{ env.TEST_FILE_NAME }} \
207+
--name test_app \
208+
--distpath ./dist
187209
188-
- name: Test PyInstaller
189-
run: python -m tools.test_freezing_lib
210+
- name: Test build app
211+
run: ./dist/test_app

.vscode/settings.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
"backticks",
3030
"cmpfiles",
3131
"codecov",
32-
"cxfreeze",
3332
"darkdetect",
33+
"distpath",
3434
"docstrings",
3535
"Duquesnoy",
3636
"filecmp",
@@ -48,12 +48,12 @@
4848
"markdownlint",
4949
"maxdepth",
5050
"ncipollo",
51+
"onefile",
5152
"pflake",
5253
"pformat",
5354
"pipx",
5455
"Pixmaps",
5556
"pydata",
56-
"pyinstaller",
5757
"pypi",
5858
"pyproject",
5959
"pyqt",
@@ -68,7 +68,6 @@
6868
"qdarktheme",
6969
"QLCD",
7070
"qproperty",
71-
"qresource",
7271
"qtbot",
7372
"qtpy",
7473
"randr",

tools/test_freezing_lib/__main__.py

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

tools/test_freezing_lib/demo_app.py

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

tools/test_freezing_lib/main.py

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

0 commit comments

Comments
 (0)