Skip to content

Commit ca3526c

Browse files
authored
Merge pull request #92 from beeware/dependabot/github_actions/actions/upload-artifact-4.4.0
Bump actions/upload-artifact from 4.3.6 to 4.4.0
2 parents 7b4cfd3 + 6bbd45c commit ca3526c

File tree

3 files changed

+42
-7
lines changed

3 files changed

+42
-7
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- "windows-app"
4646
- "iOS"
4747
- "android"
48-
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
48+
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
4949
include:
5050
- runs-on: ubuntu-latest
5151
- pre-command:
@@ -138,7 +138,7 @@ jobs:
138138
run: briefcase package ${{ matrix.briefcase-target }} --update --adhoc-sign
139139

140140
- name: Upload Logs
141-
uses: actions/upload-artifact@v4.3.6
141+
uses: actions/upload-artifact@v4.4.0
142142
if: failure()
143143
with:
144144
name: build-failure-logs-${{ matrix.backend }}-${{ matrix.python-version }}

pyproject.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ sources = ["src/testbed"]
1919
test_sources = ["tests"]
2020

2121
requires = [
22-
"cryptography",
23-
"lru_dict",
24-
"pillow",
25-
"numpy",
26-
"pandas",
22+
# Binary wheels on iOS all need to be updated for the new sysconfig platform tag.
23+
"cryptography; platform_system != 'iOS'",
24+
"lru_dict; platform_system != 'iOS'",
25+
"pillow; platform_system != 'iOS'",
26+
"numpy; platform_system != 'iOS'",
27+
"pandas; platform_system != 'iOS'",
2728
]
2829
test_requires = [
2930
"pytest",

tests/test_thirdparty.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,39 @@
33
###########################################################################
44
import os
55
import sys
6+
from importlib.metadata import PackageNotFoundError, metadata
67
from pathlib import Path
78

89
import pytest
910

1011

12+
def xfail_if_not_installed(package_name):
13+
"""A test decorator that xfails a test if the named package isn't installed.
14+
The third-party tests are dependant on packages being built. During pre-release some
15+
packages won't be compilable. So - the pyproject.toml installs third party packages
16+
with some conditional gating.
17+
18+
This decorator checks for app metadata (which is an indicator that the package has
19+
been installed). If the metadata exists, the test is executed; if it isn't we XFAIL
20+
the test because it *can't* pass.
21+
"""
22+
23+
def _xfail_if_not_installed(fn):
24+
def _testfunc(*args, **kwargs):
25+
try:
26+
metadata(package_name)
27+
except PackageNotFoundError:
28+
pytest.xfail(f"{package_name} is not installed")
29+
30+
# Actually run the test
31+
fn(*args, **kwargs)
32+
33+
return _testfunc
34+
35+
return _xfail_if_not_installed
36+
37+
38+
@xfail_if_not_installed("pillow")
1139
def test_module_paths():
1240
"Third party binary modules have meaningful __file__ attributes"
1341
import PIL
@@ -22,6 +50,7 @@ def test_module_paths():
2250

2351

2452
@pytest.mark.skipif(sys.platform == "win32", reason="cffi not available on windows")
53+
@xfail_if_not_installed("cffi")
2554
def test_cffi():
2655
"CFFI can be used as an alternative FFI interface"
2756
from cffi import FFI
@@ -32,6 +61,7 @@ def test_cffi():
3261
assert lib.strlen(ffi.new("char[]", b"hello world")) == 11
3362

3463

64+
@xfail_if_not_installed("cryptography")
3565
def test_cryptography():
3666
"The cryptography module can be used"
3767
# Cryptography is a common binary library that uses cffi and OpenSSL internally
@@ -87,6 +117,7 @@ def test_cryptography():
87117
assert "www.android.com" == domain
88118

89119

120+
@xfail_if_not_installed("lru-dict")
90121
def test_lru_dict():
91122
"The LRUDict binary module can be used"
92123
# lru-dict is the simplest possible example of a third-party module.
@@ -107,6 +138,7 @@ def test_lru_dict():
107138
assert lru_dict[f"item_{i}"] == i
108139

109140

141+
@xfail_if_not_installed("pillow")
110142
def test_pillow():
111143
"Pillow can be used to load images"
112144
# Pillow is a module that has dependencies on other libraries (libjpeg, libft2)
@@ -122,6 +154,7 @@ def test_pillow():
122154
image.close()
123155

124156

157+
@xfail_if_not_installed("numpy")
125158
def test_numpy():
126159
"Numpy Arrays can be created"
127160
from numpy import array
@@ -130,6 +163,7 @@ def test_numpy():
130163
assert [4, 7] == (array([1, 2]) + array([3, 5])).tolist()
131164

132165

166+
@xfail_if_not_installed("pandas")
133167
def test_pandas():
134168
"Pandas DataFrames can be created"
135169
from pandas import DataFrame, __version__

0 commit comments

Comments
 (0)