Skip to content

Commit 6ba4cdd

Browse files
cpsievertschloerke
andauthored
Fix CI install failures on Windows (#1651)
Co-authored-by: Barret Schloerke <[email protected]>
1 parent 8e68524 commit 6ba4cdd

File tree

2 files changed

+30
-6
lines changed

2 files changed

+30
-6
lines changed

pyproject.toml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["setuptools>=60", "wheel", "setuptools_scm>=8.0"]
33
build-backend = "setuptools.build_meta"
44

55
[tool.setuptools]
6-
packages = {find = {include = ["shiny", "shiny.*"]}}
6+
packages = { find = { include = ["shiny", "shiny.*"] } }
77

88
[tool.setuptools_scm]
99
write_to = "shiny/_version.py"
@@ -12,13 +12,11 @@ local_scheme = "no-local-version"
1212
[project]
1313
name = "shiny"
1414
dynamic = ["version"]
15-
authors = [
16-
{name = "Winston Chang", email = "[email protected]"},
17-
]
15+
authors = [{ name = "Winston Chang", email = "[email protected]" }]
1816
description = "A web development framework for Python."
1917
readme = "README.md"
2018
requires-python = ">=3.8"
21-
license = {text = "MIT"}
19+
license = { text = "MIT" }
2220
classifiers = [
2321
"Development Status :: 5 - Production/Stable",
2422
"Intended Audience :: Developers",
@@ -67,7 +65,7 @@ test = [
6765
"psutil",
6866
"astropy",
6967
"suntime",
70-
"timezonefinder",
68+
"timezonefinder ; platform_system != 'Windows'",
7169
"ipyleaflet",
7270
"shinywidgets",
7371
"seaborn",
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,35 @@
1+
import sys
2+
13
import pytest
24
from example_apps import get_apps, reruns, reruns_delay, validate_example
35
from playwright.sync_api import Page
46

7+
is_windows = sys.platform.startswith("win")
8+
59

610
@pytest.mark.flaky(reruns=reruns, reruns_delay=reruns_delay)
711
@pytest.mark.parametrize("ex_app_path", get_apps("examples"))
812
def test_examples(page: Page, ex_app_path: str) -> None:
13+
14+
skip_on_windows_with_timezonefinder(ex_app_path)
15+
916
validate_example(page, ex_app_path)
17+
18+
19+
def skip_on_windows_with_timezonefinder(ex_app_path: str) -> None:
20+
if not is_windows:
21+
return
22+
if ex_app_path != "examples/airmass/app.py":
23+
return
24+
25+
try:
26+
import timezonefinder # noqa: F401 # pyright: ignore
27+
28+
# Future proofing: if timezonefinder is actually available on windows, raise an error
29+
raise RuntimeError(
30+
"This code believes timezonefinder is not available on windows. Please remove this check if it is no longer true."
31+
)
32+
except ImportError:
33+
pytest.skip(
34+
"timezonefinder has difficulty compiling on windows. Skipping example app. posit-dev/py-shiny#1651"
35+
)

0 commit comments

Comments
 (0)