Skip to content

Commit 48b094b

Browse files
authored
Modify handling of travertino dependency in example apps, CI and testbed. (beeware#3155)
* Modifies the CI configuration so that Travertino is installed by pip finding the wheel in the dist folder, rather than by explicitly installing the package from the source directory. * Modifies the testbed to look in the `dist` folder for prerelease wheels, but *doesn't* modify the platform configurations to use those wheels. This is so that local testing continues to work. However, the Textual backend *will* use the `dist` folder to install packages, so there is at least *some* testing of wheel usage by Briefcase. * Updates all the examples and the demo app to include an explicit install of Travertino. * Includes a hard version pin of PyGObject 3.50.0 to work around beeware#3143. * Includes a conditional coverage tweak that I noticed being reported on each of the standalone core test runs. This wasn't an issue for overall coverage, but it helps to keep local single-Python version test results clean.
1 parent 8e222c2 commit 48b094b

File tree

53 files changed

+102
-37
lines changed

Some content is hidden

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

53 files changed

+102
-37
lines changed

.github/workflows/ci.yml

+28-10
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,17 @@ jobs:
3434
name: Pre-commit checks
3535
uses: beeware/.github/.github/workflows/pre-commit-run.yml@main
3636
with:
37-
pre-commit-source: "./core[dev]"
37+
# Although we only want to install the dev dependencies, we have to install the
38+
# core, which means we need travertino as well.
39+
pre-commit-source: "./travertino ./core[dev]"
3840

3941
towncrier:
4042
name: Check towncrier
4143
uses: beeware/.github/.github/workflows/towncrier-run.yml@main
4244
with:
43-
tox-source: "./core[dev]"
45+
# Although we only want to install the dev dependencies, we have to install the
46+
# core, which means we need travertino as well.
47+
tox-source: "./travertino ./core[dev]"
4448

4549
package:
4650
name: Package Toga
@@ -119,9 +123,12 @@ jobs:
119123

120124
- name: Test
121125
run: |
122-
# The $(ls ...) shell expansion is done in the Github environment;
123-
# the value of TOGA_INSTALL_COMMAND will be a literal string without any shell expansions to perform
124-
TOGA_INSTALL_COMMAND="python -m pip install ../$(ls dist/toga_core-*.whl)[dev] ../$(ls dist/toga_dummy-*.whl) ../$(ls dist/travertino-*.whl)"
126+
# The $(ls ...) shell expansion is done in the Github environment; the value of
127+
# TOGA_INSTALL_COMMAND will be a literal string without any shell expansions to
128+
# perform. We don't *explicitly* install the Travertino wheel; we provide the
129+
# dist dir as a source of wheels, and rely on pip to resolve the explicit
130+
# version match to the Travertino wheel in that folder.
131+
export TOGA_INSTALL_COMMAND="python -m pip install --find-links ../dist ../$(ls dist/toga_core-*.whl)[dev] ../$(ls dist/toga_dummy-*.whl)"
125132
tox -e py-cov${{ matrix.tox-suffix }}
126133
tox -qe coverage$(tr -dc "0-9" <<< "${{ matrix.python-version }}")${{ matrix.tox-suffix }}
127134
mv ${{ matrix.package }}/.coverage ${{ matrix.package }}/.coverage.${{ matrix.platform }}.${{ matrix.python-version }}
@@ -184,7 +191,11 @@ jobs:
184191

185192
- name: Test
186193
run: |
187-
pip install dist/toga_core-*.whl dist/travertino-*.whl
194+
# We don't *explicitly* install the Travertino wheel; we provide the dist dir
195+
# as a source of wheels, and rely on pip to resolve the explicit version match
196+
# to the travertino wheel in that folder.
197+
pip install --find-links ./dist dist/toga_core-*.whl
198+
188199
site_packages=$(python -c '
189200
import sys
190201
print([path for path in sys.path if "site-packages" in path][0])
@@ -247,7 +258,7 @@ jobs:
247258

248259
testbed:
249260
name: Testbed
250-
needs: core-and-travertino
261+
needs: [ package, core-and-travertino ]
251262
runs-on: ${{ matrix.runs-on }}
252263
strategy:
253264
fail-fast: false
@@ -373,21 +384,21 @@ jobs:
373384
platform: "linux"
374385
runs-on: "ubuntu-latest"
375386
setup-python: false # Use the system Python packages
376-
briefcase-run-args: --config 'requires=["../core","../textual", "../travertino"]' --config 'console_app=true'
387+
briefcase-run-args: --config 'requires=["toga-core", "toga-textual"]' --config 'console_app=true'
377388
app-user-data-path: "$HOME/.local/share/testbed"
378389
# install the meta-package build-essential since Briefcase explicitly checks for it
379390
pre-command: sudo apt update -y && sudo apt install -y build-essential
380391

381392
- backend: "textual-macOS"
382393
platform: "macOS"
383394
runs-on: "macos-latest"
384-
briefcase-run-args: --config 'requires=["../core","../textual", "../travertino"]' --config 'console_app=true'
395+
briefcase-run-args: --config 'requires=["toga-core", "toga-textual"]' --config 'console_app=true'
385396
app-user-data-path: "$HOME/Library/Application Support/org.beeware.toga.testbed"
386397

387398
- backend: "textual-windows"
388399
platform: "windows"
389400
runs-on: "windows-latest"
390-
briefcase-run-args: --config 'requires=["../core","../textual", "../travertino"]' --config 'console_app=true'
401+
briefcase-run-args: --config 'requires=["toga-core", "toga-textual"]' --config 'console_app=true'
391402
app-user-data-path: '$HOME\AppData\Local\Tiberius Yak\Toga Testbed\Data'
392403

393404
- backend: "windows"
@@ -444,6 +455,13 @@ jobs:
444455
python -m pip install -U pip
445456
python -m pip install git+https://github.com/beeware/briefcase.git
446457
458+
- name: Get Packages
459+
uses: actions/[email protected]
460+
with:
461+
pattern: ${{ format('{0}-*', needs.package.outputs.artifact-basename) }}
462+
merge-multiple: true
463+
path: dist
464+
447465
- name: Test App
448466
working-directory: testbed
449467
timeout-minutes: 15

.readthedocs.yaml

+5-3
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ sphinx:
2727
formats:
2828
- pdf
2929

30-
# Install extras for build - dev is needed to run tox
30+
# Install extras for build. Order is significant; each entry is a separate call to
31+
# `pip`, and we need Travertino to exist before core is installed. core[dev] is needed
32+
# to run `tox -e docs-lint` as a pre-build step.
3133
python:
3234
install:
35+
- method: pip
36+
path: travertino
3337
- method: pip
3438
path: core
3539
extra_requirements:
3640
- dev
3741
- docs
38-
- method: pip
39-
path: travertino

changes/3154.misc.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The handling of the Travertino dependency in examples, CI and testbed was modified.

core/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ requires = [
77
build-backend = "setuptools.build_meta"
88

99
[project]
10-
dynamic = ["version"]
10+
dynamic = ["version", "dependencies"]
1111
name = "toga-core"
1212
description = "A Python native, OS native GUI toolkit."
1313
readme = "README.rst"

core/src/toga/platform.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
# Emulate the Python 3.10+ entry_points API on older Python versions.
1212
def entry_points(*, group):
13-
if sys.version_info < (3, 10):
13+
if sys.version_info < (3, 10): # pragma: no-cover-if-gte-py310
1414
return metadata.entry_points()[group]
15-
else:
15+
else: # pragma: no-cover-if-lt-py310
1616
return metadata.entry_points(group=group)
1717

1818

demo/pyproject.toml

-16
Original file line numberDiff line numberDiff line change
@@ -83,33 +83,17 @@ author_email = "[email protected]"
8383
formal_name = "Toga Demo"
8484
description = "A demonstration of the capabilities of the Toga widget toolkit."
8585
sources = ["toga_demo"]
86-
requires = ["../core"]
8786

8887
[tool.briefcase.app.toga-demo.macOS]
89-
requires = [
90-
"../cocoa",
91-
]
9288

9389
[tool.briefcase.app.toga-demo.linux]
94-
requires = [
95-
"../gtk",
96-
]
9790

9891
[tool.briefcase.app.toga-demo.windows]
99-
requires = [
100-
"../winforms",
101-
]
10292

10393
# Mobile deployments
10494
[tool.briefcase.app.toga-demo.iOS]
105-
requires = [
106-
"../iOS",
107-
]
10895

10996
[tool.briefcase.app.toga-demo.android]
110-
requires = [
111-
"../android",
112-
]
11397

11498
base_theme = "Theme.MaterialComponents.Light.DarkActionBar"
11599

examples/activityindicator/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["activityindicator"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/beeliza/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["beeliza"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/box/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["box"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/button/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["button"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/canvas/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["canvas"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/colors/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["colors"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/command/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["command"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/date_and_time/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["date_and_time"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/detailedlist/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["detailedlist"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/dialogs/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["dialogs"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/divider/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["divider"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/documentapp/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["documentapp"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/examples_overview/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["examples_overview"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/focus/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["focus"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/font/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["font"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/font_size/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["font_size"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122
[tool.briefcase.app.font_size.macOS]

examples/handlers/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["handlers"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
"httpx",
2021
]
2122

examples/imageview/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["imageview"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/layout/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["layout"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/multilinetextinput/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["multilinetextinput"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/numberinput/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["numberinput"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/optioncontainer/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["optioncontainer"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/positron-django/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ icon = "src/positron/resources/positron"
1717
sources = ["src/positron", "src/webapp"]
1818
requires = [
1919
"../../core",
20+
"../../travertino",
2021
"django~=4.1",
2122
]
2223

examples/positron-static/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ icon = "src/positron/resources/positron"
1717
sources = ["src/positron"]
1818
requires = [
1919
"../../core",
20+
"../../travertino",
2021
]
2122

2223

examples/progressbar/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["progressbar"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/resize/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["resize"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

examples/screenshot/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["screenshot"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
"pillow",
2021
]
2122

examples/scrollcontainer/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ description = "A testing app"
1616
sources = ["scrollcontainer"]
1717
requires = [
1818
"../../core",
19+
"../../travertino",
1920
]
2021

2122

0 commit comments

Comments
 (0)