Skip to content

Commit 224b223

Browse files
committed
Add a composite action to set the ETS_TOOLKIT environment variable
1 parent 1721dbe commit 224b223

File tree

2 files changed

+45
-3
lines changed

2 files changed

+45
-3
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Set ETS_TOOLKIT
2+
description: 'Set the ETS_TOOLKIT environment variable'
3+
inputs:
4+
toolkit:
5+
required: true
6+
description: 'The GUI toolkit to use (wx, null, pyqt5, pyqt6, pyside2, pyside6)'
7+
kiva:
8+
default: 'image'
9+
description: 'The kiva toolkit to set'
10+
shell:
11+
default: 'bash'
12+
runs:
13+
using: composite
14+
steps:
15+
- name: Null toolkit
16+
if: inputs.toolkit == 'null'
17+
run: echo "ETS_TOOLKIT=null.${{ inputs.kiva }}" >> $GITHUB_ENV
18+
shell: ${{ inputs.shell }}
19+
- name: WxPython toolkit
20+
if: inputs.toolkit == 'wx'
21+
run: echo "ETS_TOOLKIT=wx.${{ inputs.kiva }}" >> $GITHUB_ENV
22+
shell: ${{ inputs.shell }}
23+
- name: PyQT5 toolkit
24+
if: inputs.toolkit == 'pyqt5'
25+
run: echo "ETS_TOOLKIT=qt.${{ inputs.kiva }}" >> $GITHUB_ENV
26+
run: echo "QT_API=pyqt5" >> $GITHUB_ENV
27+
shell: ${{ inputs.shell }}
28+
- name: PyQT6 toolkit
29+
if: inputs.toolkit == 'pyqt6'
30+
run: echo "ETS_TOOLKIT=qt.${{ inputs.kiva }}" >> $GITHUB_ENV
31+
run: echo "QT_API=pyqt6" >> $GITHUB_ENV
32+
shell: ${{ inputs.shell }}
33+
- name: PySide2 toolkit
34+
if: inputs.toolkit == 'pyside2'
35+
run: echo "ETS_TOOLKIT=qt.${{ inputs.kiva }}" >> $GITHUB_ENV
36+
run: echo "QT_API=pyside2" >> $GITHUB_ENV
37+
shell: ${{ inputs.shell }}
38+
- name: PySide6 toolkit
39+
if: inputs.toolkit == 'pyside6'
40+
run: echo "ETS_TOOLKIT=qt.${{ inputs.kiva }}" >> $GITHUB_ENV
41+
run: echo "QT_API=pyside6" >> $GITHUB_ENV
42+
shell: ${{ inputs.shell }}

.github/workflows/test-with-pip.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
16-
toolkit: ['pyside2', 'pyside6', 'pyqt5', 'wx']
16+
toolkit: ['pyside2', 'pyside6', 'pyqt5', 'wx', 'null']
1717
kiva-backend: ['image']
1818
python-version: ['3.10', '3.11']
1919
exclude:
@@ -27,8 +27,6 @@ jobs:
2727
- os: 'macos-latest'
2828
toolkit: 'pyside2'
2929
runs-on: ${{ matrix.os }}
30-
env:
31-
ETS_TOOLKIT: ${{ matrix.toolkit }}.${{ matrix.kiva-backend }}
3230
steps:
3331
- name: Check out
3432
uses: actions/checkout@v4
@@ -46,6 +44,8 @@ jobs:
4644
run: pip install ".[tests,${{ matrix.toolkit }}]"
4745
- name: Sanity check package version
4846
run: pip list
47+
- run: ./.github/actions/ets_toolkit
48+
toolkit: ${{ matrix.toolkit }}
4949
- name: Run chaco test suite (Linux)
5050
env:
5151
PYTHONFAULTHANDLER: 1

0 commit comments

Comments
 (0)