diff --git a/pyproject.toml b/pyproject.toml index 5689e8697..ca94dbb50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=60", "wheel", "setuptools_scm>=8.0"] build-backend = "setuptools.build_meta" [tool.setuptools] -packages = {find = {include = ["shiny", "shiny.*"]}} +packages = { find = { include = ["shiny", "shiny.*"] } } [tool.setuptools_scm] write_to = "shiny/_version.py" @@ -12,13 +12,11 @@ local_scheme = "no-local-version" [project] name = "shiny" dynamic = ["version"] -authors = [ - {name = "Winston Chang", email = "winston@posit.co"}, -] +authors = [{ name = "Winston Chang", email = "winston@posit.co" }] description = "A web development framework for Python." readme = "README.md" requires-python = ">=3.8" -license = {text = "MIT"} +license = { text = "MIT" } classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", @@ -67,7 +65,7 @@ test = [ "psutil", "astropy", "suntime", - "timezonefinder", + "timezonefinder ; platform_system != 'Windows'", "ipyleaflet", "shinywidgets", "seaborn", diff --git a/tests/playwright/examples/test_examples.py b/tests/playwright/examples/test_examples.py index 60117d7df..6977f77c8 100644 --- a/tests/playwright/examples/test_examples.py +++ b/tests/playwright/examples/test_examples.py @@ -1,9 +1,35 @@ +import sys + import pytest from example_apps import get_apps, reruns, reruns_delay, validate_example from playwright.sync_api import Page +is_windows = sys.platform.startswith("win") + @pytest.mark.flaky(reruns=reruns, reruns_delay=reruns_delay) @pytest.mark.parametrize("ex_app_path", get_apps("examples")) def test_examples(page: Page, ex_app_path: str) -> None: + + skip_on_windows_with_timezonefinder(ex_app_path) + validate_example(page, ex_app_path) + + +def skip_on_windows_with_timezonefinder(ex_app_path: str) -> None: + if not is_windows: + return + if ex_app_path != "examples/airmass/app.py": + return + + try: + import timezonefinder # noqa: F401 # pyright: ignore + + # Future proofing: if timezonefinder is actually available on windows, raise an error + raise RuntimeError( + "This code believes timezonefinder is not available on windows. Please remove this check if it is no longer true." + ) + except ImportError: + pytest.skip( + "timezonefinder has difficulty compiling on windows. Skipping example app. posit-dev/py-shiny#1651" + )