diff --git a/.github/workflows/build-wheels-version.yml b/.github/workflows/build-wheels-version.yml index 0a9fe12..20c466f 100644 --- a/.github/workflows/build-wheels-version.yml +++ b/.github/workflows/build-wheels-version.yml @@ -79,7 +79,7 @@ on: description: | Packages (comma-separated) or 'ALL' to select all available recipes: required: false - default: "pydantic-core:,numpy:,pillow:" + default: "lru-dict:,pydantic-core:,numpy:" prebuild_recipes: description: | Recipes (comma-separated; typically flet-lib*) to build FIRST and seed into @@ -454,6 +454,7 @@ jobs: env: PKG_NAME: ${{ steps.detect-tests.outputs.pkg_name }} PKG_VERSION: ${{ steps.detect-tests.outputs.pkg_version }} + INPUT_PYTHON_VERSION: ${{ inputs.python_version }} run: | set -euxo pipefail @@ -479,7 +480,7 @@ jobs: ./tests/recipe-tester/stage_recipe.sh "$PKG_NAME" "$PKG_VERSION" cd tests/recipe-tester PIP_FIND_LINKS="$GITHUB_WORKSPACE/dist-test" \ - uvx --with flet-cli flet build apk --arch x86_64 -vv --yes + uvx --prerelease allow --with 'flet-cli>=0.86.0.dev0' --with 'flet>=0.86.0.dev0' flet build apk -vv --yes --python-version "$(echo "$INPUT_PYTHON_VERSION" | cut -d. -f1-2)" - name: Test on Android emulator (API 28, x86_64) if: matrix.platform == 'android' && steps.detect-tests.outputs.has_tests == 'true' @@ -501,6 +502,7 @@ jobs: env: PKG_NAME: ${{ steps.detect-tests.outputs.pkg_name }} PKG_VERSION: ${{ steps.detect-tests.outputs.pkg_version }} + INPUT_PYTHON_VERSION: ${{ inputs.python_version }} run: | set -euxo pipefail @@ -519,7 +521,7 @@ jobs: ./tests/recipe-tester/stage_recipe.sh "$PKG_NAME" "$PKG_VERSION" cd tests/recipe-tester PIP_FIND_LINKS="$GITHUB_WORKSPACE/dist-test" \ - uvx --with flet-cli flet build ios-simulator -v --yes + uvx --prerelease allow --with 'flet-cli>=0.86.0.dev0' --with 'flet>=0.86.0.dev0' flet build ios-simulator -vv --yes --python-version "$(echo "$INPUT_PYTHON_VERSION" | cut -d. -f1-2)" - name: Test on iOS Simulator if: matrix.platform == 'ios' && steps.detect-tests.outputs.has_tests == 'true' diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index e519714..620fca3 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -50,7 +50,7 @@ on: packages: type: string required: false - default: "pydantic-core:,numpy:,pillow:" + default: "lru-dict:,pydantic-core:,numpy:" prebuild_recipes: type: string required: false @@ -81,7 +81,7 @@ env: # Used as the fallback recipe set when `packages` input is empty # (workflow_dispatch/workflow_call) or when no `recipes/**` paths # changed in the triggering event (push/pull_request). - SMOKE_TEST_PACKAGES: "pydantic-core:,numpy:,pillow:" + SMOKE_TEST_PACKAGES: "lru-dict:,pydantic-core:,numpy:" permissions: contents: read diff --git a/tests/recipe-tester/main.py b/tests/recipe-tester/main.py index bd05d66..092e80f 100644 --- a/tests/recipe-tester/main.py +++ b/tests/recipe-tester/main.py @@ -44,19 +44,28 @@ def _run_pytest() -> None: until the next loop iteration. """ global EXIT_CODE, DONE + import os import pytest + # Anchor the tests dir to THIS module's location, not the cwd. Flet 0.86's + # iOS packaging runs the app with cwd = /Library/Application + # Support/data, while `recipe_tests/` is bundled next to this file — so a + # relative "recipe_tests" resolves against the wrong dir and pytest reports + # "directory not found" (EXIT 4). An absolute __file__-relative path is + # correct on every platform / Flet version. + tests_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "recipe_tests") + EXIT_CODE = pytest.main( [ "-v", "--rootdir", - "recipe_tests", # don't walk the bundled stdlib zip looking for conftest.py + tests_dir, # don't walk the bundled stdlib zip looking for conftest.py "-p", "no:cacheprovider", # don't try to write .pytest_cache/ on a potentially read-only mobile FS "--capture=no", # let test prints reach console.log too (default pytest capture hides stdout) "--no-header", "--tb=short", # compact output for console.log - "recipe_tests/", + tests_dir, ] ) diff --git a/tests/recipe-tester/pyproject.toml.tpl b/tests/recipe-tester/pyproject.toml.tpl index 796f51c..2158140 100644 --- a/tests/recipe-tester/pyproject.toml.tpl +++ b/tests/recipe-tester/pyproject.toml.tpl @@ -5,7 +5,7 @@ description = "Generic in-app pytest runner for mobile-forge recipe wheels." requires-python = ">=3.10" dependencies = [ - "flet", + "flet>=0.86.0.dev0", "pytest", # `stage_recipe.sh` rewrites the line below to pin the recipe under test (e.g. `"numpy==2.2.2"`), # and replaces the token line after it with any test-only deps declared in @@ -16,11 +16,18 @@ dependencies = [ [dependency-groups] dev = [ - "flet[all]", + "flet[all]>=0.86.0.dev0", ] [tool.flet] artifact = "recipe-tester" +# Flet >=0.86 compiles the app to .pyc and strips the source by default, but pytest +# only collects .py test files — so the bundled recipe_tests would report "0 items" +# (EXIT 5). Keep the app source (main.py + recipe_tests/*.py) as .py. This only +# affects the app; bundled/package dependencies still get compiled. +[tool.flet.compile] +app = false + [tool.flet.app] path = "."