From 503cbf04d786c06df80a644a6bad18d6effd265d Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 5 Sep 2023 12:29:53 +0800 Subject: [PATCH 01/14] Make sure the test suite prints preamble and creates a dummy app. --- src/testbed/__main__.py | 1 + src/testbed/android.py | 4 ---- src/testbed/app.py | 5 ++--- src/testbed/darwin.py | 15 +-------------- src/testbed/ios.py | 4 ---- src/testbed/linux.py | 13 +------------ src/testbed/win32.py | 20 +------------------- tests/test_common.py | 6 ++++-- tests/testbed.py | 5 +++++ 9 files changed, 15 insertions(+), 58 deletions(-) diff --git a/src/testbed/__main__.py b/src/testbed/__main__.py index 00c3da2..d30759a 100644 --- a/src/testbed/__main__.py +++ b/src/testbed/__main__.py @@ -2,3 +2,4 @@ if __name__ == "__main__": main() + print("Did you forget to invoke with --test?") diff --git a/src/testbed/android.py b/src/testbed/android.py index d2f47ad..5100da9 100644 --- a/src/testbed/android.py +++ b/src/testbed/android.py @@ -22,7 +22,3 @@ def __init__(self, app): self._impl = app MainActivity.setPythonApp(self) print("Python app launched & stored in Android Activity class") - - -def main_loop(): - pass diff --git a/src/testbed/app.py b/src/testbed/app.py index dcd28b3..8796772 100644 --- a/src/testbed/app.py +++ b/src/testbed/app.py @@ -14,7 +14,6 @@ def main(): module_path = ".android" else: module_path = f".{sys.platform}" - platform_module = importlib.import_module(module_path, "testbed") - # Run the main_loop() for the platform - platform_module.main_loop() + # Import the platform module, so we get any import side effects. + importlib.import_module(module_path, "testbed") diff --git a/src/testbed/darwin.py b/src/testbed/darwin.py index b5e6ad9..0a84e0f 100644 --- a/src/testbed/darwin.py +++ b/src/testbed/darwin.py @@ -1,16 +1,3 @@ ###################################################################### -# macOS App main loop +# No macOS App main loop required ####################################################################### -from rubicon.objc import ObjCClass -from rubicon.objc.runtime import load_library - -appkit = load_library("AppKit") - -NSApplication = ObjCClass("NSApplication") -NSApplication.declare_class_property("sharedApplication") - - -def main_loop(): - app = NSApplication.sharedApplication - app.setActivationPolicy(0) - app.run() diff --git a/src/testbed/ios.py b/src/testbed/ios.py index d0a90cb..0b9ff64 100644 --- a/src/testbed/ios.py +++ b/src/testbed/ios.py @@ -11,7 +11,3 @@ class PythonAppDelegate(UIResponder): pass - - -def main_loop(): - pass diff --git a/src/testbed/linux.py b/src/testbed/linux.py index b5ff236..251377f 100644 --- a/src/testbed/linux.py +++ b/src/testbed/linux.py @@ -1,14 +1,3 @@ ###################################################################### -# Linux App main loop +# No Linux App main loop required ####################################################################### -import gi - -gi.require_version("Gtk", "3.0") -from gi.repository import Gtk # noqa; E402 - - -def main_loop(): - win = Gtk.Window() - win.connect("destroy", Gtk.main_quit) - win.show_all() - Gtk.main() diff --git a/src/testbed/win32.py b/src/testbed/win32.py index 12dd7b0..cd6cad1 100644 --- a/src/testbed/win32.py +++ b/src/testbed/win32.py @@ -1,21 +1,3 @@ ###################################################################### -# Windows App main loop +# No Windows App main loop required ####################################################################### -import clr - -clr.AddReference("System.Windows.Forms") - -import System.Windows.Forms as WinForms # noqa; E402 - - -class TestBed(WinForms.Form): - def __init__(self): - super().__init__() - - def run(self): - WinForms.Application.Run(self) - - -def main_loop(): - form = TestBed() - WinForms.Application.Run(form) diff --git a/tests/test_common.py b/tests/test_common.py index ac7e6ac..36395f9 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -184,10 +184,12 @@ def test_dbm_dumb(): @pytest.mark.skipif( - hasattr(sys, "getandroidapilevel"), reason="NDBM not available on Android" + hasattr(sys, "getandroidapilevel"), + reason="NDBM not available on Android", ) @pytest.mark.skipif( - sys.platform == "linux", reason="NDBM not universally available on Linux" + sys.platform == "linux", + reason="NDBM not universally available on Linux", ) @pytest.mark.skipif(sys.platform == "win32", reason="NDBM not available on Windows") def test_dbm_ndbm(): diff --git a/tests/testbed.py b/tests/testbed.py index dd03054..9ed11af 100644 --- a/tests/testbed.py +++ b/tests/testbed.py @@ -4,6 +4,8 @@ import pytest +from testbed.app import main as app_main + def run_tests(): project_path = Path(__file__).parent.parent @@ -25,4 +27,7 @@ def run_tests(): if __name__ == "__main__": + # Run the app main to stimulate app creation and logging of test conditions. + app_main() + # Run the actual test suite. run_tests() From 0323720c21b5a17f263a21480762807e330d5f88 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 5 Sep 2023 12:31:47 +0800 Subject: [PATCH 02/14] Update Pandas test to use 1.5 API. --- tests/test_thirdparty.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/test_thirdparty.py b/tests/test_thirdparty.py index e6796bf..74e2d9e 100644 --- a/tests/test_thirdparty.py +++ b/tests/test_thirdparty.py @@ -3,7 +3,6 @@ ########################################################################### import os import sys -import warnings import pytest @@ -21,7 +20,7 @@ def test_cffi(): def test_cryptography(): "The cryptography module can be used" - # Cryptography is a common binary library that uses cffi and OpenSSL (1.1.1) internally + # Cryptography is a common binary library that uses cffi and OpenSSL internally from textwrap import dedent from cryptography import x509 @@ -126,10 +125,6 @@ def test_pandas(): [("alpha", 1), ("bravo", 2), ("charlie", 3)], columns=["Letter", "Number"] ) - with warnings.catch_warnings(): - # Pandas 1.5 changed the `line_terminator` argument to `lineterminator` - warnings.filterwarnings("ignore", category=FutureWarning) - - assert ( - ",Letter,Number\n" "0,alpha,1\n" "1,bravo,2\n" "2,charlie,3\n" - ) == df.to_csv(line_terminator="\n") + assert ( + ",Letter,Number\n" "0,alpha,1\n" "1,bravo,2\n" "2,charlie,3\n" + ) == df.to_csv(lineterminator="\n") From 92c542c4de750dd9a0c521fa44f24113fe37c933 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 5 Sep 2023 12:32:38 +0800 Subject: [PATCH 03/14] Add an explicit test of the `__file__` attribute on binary modules. --- tests/test_thirdparty.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_thirdparty.py b/tests/test_thirdparty.py index 74e2d9e..15efcae 100644 --- a/tests/test_thirdparty.py +++ b/tests/test_thirdparty.py @@ -3,10 +3,24 @@ ########################################################################### import os import sys +from pathlib import Path import pytest +def test_module_paths(): + "Third party binary modules have meaningful __file__ attributes" + import PIL + from PIL import _imaging + + # iOS and Android both play shenanigans with binary locations. + # Make sure the __file__ attribute on the binary module reflects + # the actual location in the file system. The base PIL module is + # pure Python; the binary module for PIL._imaging should be in + # the same folder. + assert Path(_imaging.__file__).parent == Path(PIL.__file__).parent + + @pytest.mark.skipif(sys.platform == "win32", reason="cffi not available on windows") def test_cffi(): "CFFI can be used as an alternative FFI interface" From 8d1202f517a0ce333d55f1601bdb8ea46a7d8dd1 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 5 Sep 2023 13:57:06 +0800 Subject: [PATCH 04/14] Restore pre-1.5 Pandas test. --- tests/test_thirdparty.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/test_thirdparty.py b/tests/test_thirdparty.py index 15efcae..12538fa 100644 --- a/tests/test_thirdparty.py +++ b/tests/test_thirdparty.py @@ -132,13 +132,19 @@ def test_numpy(): def test_pandas(): "Pandas DataFrames can be created" - from pandas import DataFrame + from pandas import DataFrame, __version__ # Another high profile package, with a dependency on numpy df = DataFrame( [("alpha", 1), ("bravo", 2), ("charlie", 3)], columns=["Letter", "Number"] ) - assert ( - ",Letter,Number\n" "0,alpha,1\n" "1,bravo,2\n" "2,charlie,3\n" - ) == df.to_csv(lineterminator="\n") + # Pandas 1.5 changed the API for to_csv() + if tuple(int(v) for v in __version__.split(".")) < (1, 5): + assert ( + ",Letter,Number\n" "0,alpha,1\n" "1,bravo,2\n" "2,charlie,3\n" + ) == df.to_csv(line_terminator="\n") + else: + assert ( + ",Letter,Number\n" "0,alpha,1\n" "1,bravo,2\n" "2,charlie,3\n" + ) == df.to_csv(lineterminator="\n") From 7c87ccf0afa1758190776d941ff90a9696e8b253 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 5 Sep 2023 13:59:28 +0800 Subject: [PATCH 05/14] Update project config to address Briefcase changes. --- .github/workflows/ci.yml | 12 +++++++++--- .gitignore | 8 ++------ CHANGELOG | 5 +++++ pyproject.toml | 23 ++++++++++++++++++++++- 4 files changed, 38 insertions(+), 10 deletions(-) create mode 100644 CHANGELOG diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1ccd2d..7bceb9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,7 @@ jobs: backend: - "macOS-Xcode" - "macOS-app" + - "linux-system" - "linux-appimage" - "linux-flatpak" - "windows-VisualStudio" @@ -35,7 +36,7 @@ jobs: - "android" python-version: [ "3.8", "3.9", "3.10", "3.11" ] include: - - runs-on: ubuntu-latest + - runs-on: ubuntu-22.04 - pre-command: - briefcase-target: - briefcase-run-args: @@ -48,13 +49,18 @@ jobs: runs-on: macos-latest briefcase-target: "macOS app" + - backend: linux-system + runs-on: ubuntu-22.04 + pre-command: "sudo apt-get update -y && sudo apt-get install -y python3-gi python3-gi-cairo gir1.2-gtk-3.0 python3-dev libgirepository1.0-dev libcairo2-dev pkg-config" + briefcase-target: "linux system" + - backend: linux-appimage - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 pre-command: "sudo apt-get update -y && sudo apt-get install -y python3-gi python3-gi-cairo gir1.2-gtk-3.0 python3-dev libgirepository1.0-dev libcairo2-dev pkg-config libfuse2" briefcase-target: "linux appimage" - backend: linux-flatpak - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 pre-command: "sudo apt-get update -y && sudo apt-get install -y python3-gi python3-gi-cairo gir1.2-gtk-3.0 python3-dev libgirepository1.0-dev libcairo2-dev pkg-config flatpak flatpak-builder" briefcase-target: "linux flatpak" diff --git a/.gitignore b/.gitignore index 14a2f47..47f07ba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,5 @@ __pycache__/ .idea *.dist-info/ -macOS -iOS -android -windows -linux -briefcase.*.log +build/ +logs/ diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000..feb9990 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,5 @@ +# Python Support Testbed Release Notes + +## 1.0.0 + +* Rolling release. diff --git a/pyproject.toml b/pyproject.toml index ed69cbf..98ac34d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,8 +44,25 @@ requires=[ 'pygobject', ] +[tool.briefcase.app.testbed.linux.system.debian] +system_requires = [ + # Needed to compile pycairo wheel + "libcairo2-dev", + # Needed to compile PyGObject wheel + "libgirepository1.0-dev", +] + +system_runtime_requires = [ + # Needed to provide GTK and its GI bindings + "gir1.2-gtk-3.0", + "libgirepository-1.0-1", + # Dependencies that GTK looks for at runtime + "libcanberra-gtk3-module", +] + [tool.briefcase.app.testbed.linux.appimage] -requires=[ +manylinux = "manylinux_2_17" +requires = [ '--no-binary', ':all:' ] @@ -78,6 +95,10 @@ ENV PATH="/home/brutus/.cargo/bin:${PATH}" # template = "../../templates/briefcase-linux-appimage-template" [tool.briefcase.app.testbed.linux.flatpak] +flatpak_runtime = "org.gnome.Platform" +flatpak_runtime_version = "44" +flatpak_sdk = "org.gnome.Sdk" + # template = "../../templates/briefcase-linux-flatpak-template" [tool.briefcase.app.testbed.windows] From f614ce81ff56844ee1aa1570a013569805c1e870 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 5 Sep 2023 14:26:58 +0800 Subject: [PATCH 06/14] Tweaks for Linux builds --- .github/workflows/ci.yml | 13 ++++++------- pyproject.toml | 2 +- tests/test_linux.py | 1 + 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7bceb9a..47fde39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,6 @@ jobs: backend: - "macOS-Xcode" - "macOS-app" - - "linux-system" - "linux-appimage" - "linux-flatpak" - "windows-VisualStudio" @@ -36,7 +35,7 @@ jobs: - "android" python-version: [ "3.8", "3.9", "3.10", "3.11" ] include: - - runs-on: ubuntu-22.04 + - runs-on: ubuntu-latest - pre-command: - briefcase-target: - briefcase-run-args: @@ -50,17 +49,17 @@ jobs: briefcase-target: "macOS app" - backend: linux-system - runs-on: ubuntu-22.04 - pre-command: "sudo apt-get update -y && sudo apt-get install -y python3-gi python3-gi-cairo gir1.2-gtk-3.0 python3-dev libgirepository1.0-dev libcairo2-dev pkg-config" - briefcase-target: "linux system" + runs-on: ubuntu-latest + python-version: "3.10" + briefcase-target: "linux system --target ubuntu:22.04" - backend: linux-appimage - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest pre-command: "sudo apt-get update -y && sudo apt-get install -y python3-gi python3-gi-cairo gir1.2-gtk-3.0 python3-dev libgirepository1.0-dev libcairo2-dev pkg-config libfuse2" briefcase-target: "linux appimage" - backend: linux-flatpak - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest pre-command: "sudo apt-get update -y && sudo apt-get install -y python3-gi python3-gi-cairo gir1.2-gtk-3.0 python3-dev libgirepository1.0-dev libcairo2-dev pkg-config flatpak flatpak-builder" briefcase-target: "linux flatpak" diff --git a/pyproject.toml b/pyproject.toml index 98ac34d..7501465 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,7 +61,7 @@ system_runtime_requires = [ ] [tool.briefcase.app.testbed.linux.appimage] -manylinux = "manylinux_2_17" +manylinux = "manylinux_2_28" requires = [ '--no-binary', ':all:' ] diff --git a/tests/test_linux.py b/tests/test_linux.py index 1f9a97f..4e53a2c 100644 --- a/tests/test_linux.py +++ b/tests/test_linux.py @@ -10,6 +10,7 @@ pytest.skip("Skipping Linux-only tests", allow_module_level=True) +@pytest.skip("GNU DBM not provided by Standalone Python") def test_dbm_gdbm(): "The GNU DBM module has been compiled and works" import tempfile From 8cd405be578076c9767732c42314dee63f22ea5f Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 5 Sep 2023 14:45:17 +0800 Subject: [PATCH 07/14] Yet more linux tweaks. --- .github/workflows/ci.yml | 6 ++++-- pyproject.toml | 23 +++++++++++------------ tests/test_linux.py | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47fde39..e261863 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,8 +50,9 @@ jobs: - backend: linux-system runs-on: ubuntu-latest - python-version: "3.10" - briefcase-target: "linux system --target ubuntu:22.04" + python-version: "system" + pre-command: "sudo apt-get update -y && sudo apt-get install -y python3-gi python3-gi-cairo gir1.2-gtk-3.0 python3-dev libgirepository1.0-dev libcairo2-dev pkg-config" + briefcase-target: "linux system" - backend: linux-appimage runs-on: ubuntu-latest @@ -96,6 +97,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4.7.0 + if: matrix.python-version != 'system' with: python-version: ${{ matrix.python-version }} diff --git a/pyproject.toml b/pyproject.toml index 7501465..7db25f1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,18 +67,17 @@ requires = [ ] system_requires = [ - # Required for GTK/PyGObject tests - 'gir1.2-gtk-3.0', - 'libgirepository1.0-dev', - # Required for pycairo - 'libcairo2-dev', - # Required for Pillow - 'libjpeg-dev', - 'libpng-dev', - 'libtiff-dev', - # Required to install Rust - 'curl', - 'libssl-dev', + # Needed to compile pycairo wheel + "cairo-gobject-devel", + # Needed to compile PyGObject wheel + "gobject-introspection-devel", + # Needed to provide GTK + "gtk3-devel", + # Dependencies that GTK looks for at runtime, that need to be + # in the build environment to be picked up by linuxdeploy + "libcanberra-gtk3", + "PackageKit-gtk3-module", + "gvfs-client", ] linuxdeploy_plugins = [ diff --git a/tests/test_linux.py b/tests/test_linux.py index 4e53a2c..630dc6e 100644 --- a/tests/test_linux.py +++ b/tests/test_linux.py @@ -10,7 +10,7 @@ pytest.skip("Skipping Linux-only tests", allow_module_level=True) -@pytest.skip("GNU DBM not provided by Standalone Python") +@pytest.mark.skip("GNU DBM not provided by Standalone Python") def test_dbm_gdbm(): "The GNU DBM module has been compiled and works" import tempfile From dba56d5da26bb589e94244feee458e5b4a1bf05c Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 5 Sep 2023 14:50:34 +0800 Subject: [PATCH 08/14] Added a long description to satisfy Linux system packaging. --- pyproject.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7db25f1..3662d9f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,6 +10,10 @@ author_email = "russell@beeware.org" [tool.briefcase.app.testbed] formal_name = "Testbed" description = "A testbed for the Apple Support packages." +long_description = """A test of common use cases and known problems with bundled apps. + +Validates 3rd party module loading, as well as basic app packaging. +""" icon = "src/testbed/resources/testbed" sources = ["src/testbed"] test_sources = ["tests"] @@ -63,7 +67,7 @@ system_runtime_requires = [ [tool.briefcase.app.testbed.linux.appimage] manylinux = "manylinux_2_28" requires = [ - '--no-binary', ':all:' + '--no-binary', ':all:', ] system_requires = [ From 2205fdde8739bbe9fc80e10864503bf97c6b2c59 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 5 Sep 2023 20:00:16 +0800 Subject: [PATCH 09/14] Add configurations to allow AppImages to complete builds. --- pyproject.toml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3662d9f..45d3f9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,6 +82,8 @@ system_requires = [ "libcanberra-gtk3", "PackageKit-gtk3-module", "gvfs-client", + # Needed to compile Pillow + "libjpeg-devel", ] linuxdeploy_plugins = [ @@ -91,7 +93,18 @@ linuxdeploy_plugins = [ dockerfile_extra_content = """ # Install Rust (required for cryptography) RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -ENV PATH="/home/brutus/.cargo/bin:${PATH}" +# Set up C++ compiler (required for numpy) +ENV CXX="g++ -pthread" +ENV AR=ar +# Add a symlink for python->python3 (needed for pandas) +# Pandas *requires* that the Python binary be called `python`, not `python3`. +# However, Python-standalone *only* provides `python3`, and at runtime, we +# only need `python3`. We can't (easily) reconfigure the Meson build for Pandas, +# so we put a symlink in `brutus`'s bin path. +RUN mkdir -p /home/brutus/bin +RUN ln -si /app/Testbed.AppDir/usr/python/bin/python3 /home/brutus/bin/python +# Set the path to include all the things we've installed. +ENV PATH="/home/brutus/bin:/home/brutus/.cargo/bin:${PATH}" """ # support_package = "../Python-linux-support/dist/Python-3.10-linux-x86_64-support.custom.tar.gz" From 3a27cbcb822c22aa626b1e79646caf6592791bbb Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 6 Sep 2023 06:45:27 +0800 Subject: [PATCH 10/14] Add OpenSSL system requirement. --- pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 45d3f9b..cae380a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,6 +84,8 @@ system_requires = [ "gvfs-client", # Needed to compile Pillow "libjpeg-devel", + # Needed to compile Cryptography + "openssl-devel", ] linuxdeploy_plugins = [ From 6ccc59599ba603e05475fb0ae9785da8cbdcf969 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 6 Sep 2023 07:38:10 +0800 Subject: [PATCH 11/14] Disable AppImage builds. --- .github/workflows/ci.yml | 14 +++++++++----- pyproject.toml | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e261863..8e66200 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,11 @@ jobs: backend: - "macOS-Xcode" - "macOS-app" - - "linux-appimage" + # AppImage builds (a) take over an hour, because the need to compile Numpy and + # Pandas from source, and (b) are only here as a light validation that + # Standalone Python is working. A Flatpak build also validates this, but + # completes in minutes. + # - "linux-appimage" - "linux-flatpak" - "windows-VisualStudio" - "windows-app" @@ -54,10 +58,10 @@ jobs: pre-command: "sudo apt-get update -y && sudo apt-get install -y python3-gi python3-gi-cairo gir1.2-gtk-3.0 python3-dev libgirepository1.0-dev libcairo2-dev pkg-config" briefcase-target: "linux system" - - backend: linux-appimage - runs-on: ubuntu-latest - pre-command: "sudo apt-get update -y && sudo apt-get install -y python3-gi python3-gi-cairo gir1.2-gtk-3.0 python3-dev libgirepository1.0-dev libcairo2-dev pkg-config libfuse2" - briefcase-target: "linux appimage" + # - backend: linux-appimage + # runs-on: ubuntu-latest + # pre-command: "sudo apt-get update -y && sudo apt-get install -y python3-gi python3-gi-cairo gir1.2-gtk-3.0 python3-dev libgirepository1.0-dev libcairo2-dev pkg-config libfuse2" + # briefcase-target: "linux appimage" - backend: linux-flatpak runs-on: ubuntu-latest diff --git a/pyproject.toml b/pyproject.toml index cae380a..c6ccb27 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,7 +95,7 @@ linuxdeploy_plugins = [ dockerfile_extra_content = """ # Install Rust (required for cryptography) RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -# Set up C++ compiler (required for numpy) +# Set up compilers (required for numpy) ENV CXX="g++ -pthread" ENV AR=ar # Add a symlink for python->python3 (needed for pandas) From 16af449ff2133b1139ee82ee34cc8c2e39aa8548 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 7 Sep 2023 10:10:04 +0800 Subject: [PATCH 12/14] Remove comment references to main loop. --- src/testbed/android.py | 5 +---- src/testbed/darwin.py | 2 +- src/testbed/ios.py | 5 +---- src/testbed/linux.py | 2 +- src/testbed/win32.py | 2 +- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/testbed/android.py b/src/testbed/android.py index 5100da9..b04ade5 100644 --- a/src/testbed/android.py +++ b/src/testbed/android.py @@ -1,8 +1,5 @@ ###################################################################### -# Android App main loop -# -# The main loop itself is a no-op; however we need a PythonAppDelegate -# to satisfy the app stub. +# Android App configuration ####################################################################### from rubicon.java import JavaClass, JavaInterface diff --git a/src/testbed/darwin.py b/src/testbed/darwin.py index 0a84e0f..b1b1731 100644 --- a/src/testbed/darwin.py +++ b/src/testbed/darwin.py @@ -1,3 +1,3 @@ ###################################################################### -# No macOS App main loop required +# No macOS App configuration required ####################################################################### diff --git a/src/testbed/ios.py b/src/testbed/ios.py index 0b9ff64..4b044fc 100644 --- a/src/testbed/ios.py +++ b/src/testbed/ios.py @@ -1,8 +1,5 @@ ###################################################################### -# iOS App main loop -# -# The main loop itself is a no-op; however we need a PythonAppDelegate -# to satisfy the app stub. +# iOS App configuration ####################################################################### from rubicon.objc import ObjCClass diff --git a/src/testbed/linux.py b/src/testbed/linux.py index 251377f..6f342ad 100644 --- a/src/testbed/linux.py +++ b/src/testbed/linux.py @@ -1,3 +1,3 @@ ###################################################################### -# No Linux App main loop required +# No Linux App configuration required ####################################################################### diff --git a/src/testbed/win32.py b/src/testbed/win32.py index cd6cad1..5165dbd 100644 --- a/src/testbed/win32.py +++ b/src/testbed/win32.py @@ -1,3 +1,3 @@ ###################################################################### -# No Windows App main loop required +# No Windows App configuration required ####################################################################### From ce385cedab29db2da075c1075416cbd1d62478e7 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 7 Sep 2023 10:12:18 +0800 Subject: [PATCH 13/14] Clarified the module path differences on iOS/Android. --- tests/test_thirdparty.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_thirdparty.py b/tests/test_thirdparty.py index 12538fa..8d8f6a1 100644 --- a/tests/test_thirdparty.py +++ b/tests/test_thirdparty.py @@ -15,9 +15,9 @@ def test_module_paths(): # iOS and Android both play shenanigans with binary locations. # Make sure the __file__ attribute on the binary module reflects - # the actual location in the file system. The base PIL module is - # pure Python; the binary module for PIL._imaging should be in - # the same folder. + # its package's location in the file system. The base PIL module is + # pure Python; the binary module for PIL._imaging should *appear* + # to be in the same folder (although in practice, it may not be). assert Path(_imaging.__file__).parent == Path(PIL.__file__).parent From 288675b0a7f6c73d6b524c872c492e90295d1148 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Thu, 7 Sep 2023 10:14:12 +0800 Subject: [PATCH 14/14] Simpify pandas test. --- tests/test_thirdparty.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_thirdparty.py b/tests/test_thirdparty.py index 8d8f6a1..be10cf2 100644 --- a/tests/test_thirdparty.py +++ b/tests/test_thirdparty.py @@ -141,10 +141,10 @@ def test_pandas(): # Pandas 1.5 changed the API for to_csv() if tuple(int(v) for v in __version__.split(".")) < (1, 5): - assert ( - ",Letter,Number\n" "0,alpha,1\n" "1,bravo,2\n" "2,charlie,3\n" - ) == df.to_csv(line_terminator="\n") + kwargs = dict(line_terminator="\n") else: - assert ( - ",Letter,Number\n" "0,alpha,1\n" "1,bravo,2\n" "2,charlie,3\n" - ) == df.to_csv(lineterminator="\n") + kwargs = dict(lineterminator="\n") + + assert ( + ",Letter,Number\n" "0,alpha,1\n" "1,bravo,2\n" "2,charlie,3\n" + ) == df.to_csv(**kwargs)