Skip to content

Commit b4fb859

Browse files
authored
Merge pull request #144 from sco1/test-me-tk
Add tk installation option
2 parents 46e471f + 1a9ece5 commit b4fb859

4 files changed

Lines changed: 24 additions & 2 deletions

File tree

.github/workflows/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ jobs:
1212
- {python: '3.7', debug: true, nogil: false}
1313
- {python: '3.12-dev', debug: false, nogil: false}
1414
- {python: '3.13-dev', debug: false, nogil: true}
15+
- {python: '3.13-dev', debug: false, nogil: false, tk: true}
1516
steps:
1617
- uses: actions/checkout@v4
1718
- uses: ./.
1819
with:
1920
python-version: ${{ matrix.python }}
2021
debug: ${{ matrix.debug }}
2122
nogil: ${{ matrix.nogil }}
23+
tk: ${{ matrix.tk }}
24+
25+
- name: check tk
26+
if: matrix.tk
27+
run: python -c 'import tkinter'

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,9 @@ The `nogil` input can be used instead of `debug` to install an *experimental*
5252
free-threaded build of the selected Python version, by adding `nogil: true`
5353
Only available for Python 3.13 and later.
5454

55+
The action's `tk` input can be used to install Tkinter, which is not included
56+
by default. If `debug` is set then `tk-dbg` will be used. If `nogil` is set
57+
then `tk-nogil` will be used; only available for Python 3.13 and later.
58+
5559
[available nightly versions]: https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly/+packages
5660
[available versions]: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa/+packages

action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ inputs:
1212
description: use free-threaded version of python
1313
required: false
1414
default: false
15+
tk:
16+
description: include Tkinter
17+
required: false
18+
default: false
1519
runs:
1620
using: composite
1721
steps:
18-
- name: add deadsnakes ppa and install ${{ inputs.python-version }} ${{ inputs.debug == 'true' && '(debug)' || '' }}
19-
run: ${{ github.action_path }}/bin/install-python ${{ inputs.python-version }} ${{ inputs.debug == 'true' && '--debug' || '' }} ${{ inputs.nogil == 'true' && '--nogil' || '' }}
22+
- name: add deadsnakes ppa and install ${{ inputs.python-version }} ${{ inputs.debug == 'true' && '(debug)' || '' }} ${{ inputs.tk == 'true' && '(tk)' || '' }}
23+
run: ${{ github.action_path }}/bin/install-python ${{ inputs.python-version }} ${{ inputs.debug == 'true' && '--debug' || '' }} ${{ inputs.nogil == 'true' && '--nogil' || '' }} ${{ inputs.tk == 'true' && '--tk' || '' }}
2024
shell: bash

bin/install-python

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def main() -> int:
3939
mut = parser.add_mutually_exclusive_group()
4040
mut.add_argument('--debug', action='store_true')
4141
mut.add_argument('--nogil', action='store_true')
42+
parser.add_argument('--tk', action='store_true')
4243
args = parser.parse_args()
4344

4445
if args.version.endswith('-dev'):
@@ -62,6 +63,13 @@ def main() -> int:
6263
py_executable = f'{py}-nogil'
6364
else:
6465
py_executable = py
66+
if args.tk:
67+
if args.debug:
68+
packages.append(f'{py}-tk-dbg')
69+
elif args.nogil:
70+
packages.append(f'{py}-tk-nogil')
71+
else:
72+
packages.append(f'{py}-tk')
6573

6674
envdir = os.path.expanduser(f'~/venv-{version}')
6775
bindir = os.path.join(envdir, 'bin')

0 commit comments

Comments
 (0)