From 2a3856518961d1be53b4096f4b592be5e739dae1 Mon Sep 17 00:00:00 2001 From: Carson Date: Tue, 27 Aug 2024 18:49:18 -0500 Subject: [PATCH 1/9] Install setuptools before building wheel --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f89477142..64820125b 100644 --- a/Makefile +++ b/Makefile @@ -188,7 +188,7 @@ release: dist ## package and upload a release twine upload dist/* dist: clean ## builds source and wheel package - pip install build + pip install build setuptools python -m build --sdist python -m build --wheel ls -l dist From 97c184ee07a238b25c2ebff9a48840e38dea9ca1 Mon Sep 17 00:00:00 2001 From: Carson Date: Tue, 27 Aug 2024 18:56:15 -0500 Subject: [PATCH 2/9] Install setuptools before installing htmltools --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f317a6d61..56cc5aeeb 100644 --- a/Makefile +++ b/Makefile @@ -188,7 +188,7 @@ release: dist ## package and upload a release twine upload dist/* dist: clean ## builds source and wheel package - pip install build setuptools + pip install build python -m build --sdist python -m build --wheel ls -l dist @@ -209,6 +209,7 @@ ci-install-wheel: dist FORCE install-deps: FORCE ## install dependencies pip install -e ".[dev,test]" --upgrade ci-install-deps: FORCE + uv pip install setuptools uv pip install "htmltools @ git+https://github.com/posit-dev/py-htmltools.git" uv pip install -e ".[dev,test]" From ec048b7a4675b2addcfcf5d07dafda0a15d190bb Mon Sep 17 00:00:00 2001 From: Carson Date: Tue, 27 Aug 2024 19:04:06 -0500 Subject: [PATCH 3/9] Try without uv --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 56cc5aeeb..3c8ba5833 100644 --- a/Makefile +++ b/Makefile @@ -211,7 +211,7 @@ install-deps: FORCE ## install dependencies ci-install-deps: FORCE uv pip install setuptools uv pip install "htmltools @ git+https://github.com/posit-dev/py-htmltools.git" - uv pip install -e ".[dev,test]" + pip install -e ".[dev,test]" install-docs: FORCE pip install -e ".[dev,test,doc]" From 60638fda0a4929c962fd284027dedb01724632bc Mon Sep 17 00:00:00 2001 From: Carson Date: Tue, 27 Aug 2024 19:22:00 -0500 Subject: [PATCH 4/9] Try --no-build-isolation --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3c8ba5833..726cfc5b7 100644 --- a/Makefile +++ b/Makefile @@ -209,8 +209,9 @@ ci-install-wheel: dist FORCE install-deps: FORCE ## install dependencies pip install -e ".[dev,test]" --upgrade ci-install-deps: FORCE - uv pip install setuptools uv pip install "htmltools @ git+https://github.com/posit-dev/py-htmltools.git" + uv pip install setuptools poetry cffi + pip install -v --no-build-isolation timezonefinder pip install -e ".[dev,test]" install-docs: FORCE From b21cd3a367c4fcb7718ae33b6b41ca442a7b2de9 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 27 Aug 2024 22:06:06 -0400 Subject: [PATCH 5/9] Revert uv installation on CI --- Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 726cfc5b7..22a67d7cd 100644 --- a/Makefile +++ b/Makefile @@ -210,9 +210,7 @@ install-deps: FORCE ## install dependencies pip install -e ".[dev,test]" --upgrade ci-install-deps: FORCE uv pip install "htmltools @ git+https://github.com/posit-dev/py-htmltools.git" - uv pip install setuptools poetry cffi - pip install -v --no-build-isolation timezonefinder - pip install -e ".[dev,test]" + uv pip install -e ".[dev,test]" install-docs: FORCE pip install -e ".[dev,test,doc]" From 3ee8a301ea499e9f51ce2fef8fe4be6862ba36af Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 27 Aug 2024 22:06:52 -0400 Subject: [PATCH 6/9] Update pyproject.toml --- pyproject.toml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5689e8697..fcc3214ce 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", From 663e6d4818af4d6771fdb7289a1b10ab6273fbbc Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 27 Aug 2024 22:16:10 -0400 Subject: [PATCH 7/9] Only install timezonefinder on non windows platforms --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fcc3214ce..ca94dbb50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,7 +65,7 @@ test = [ "psutil", "astropy", "suntime", - "timezonefinder", + "timezonefinder ; platform_system != 'Windows'", "ipyleaflet", "shinywidgets", "seaborn", From 5337455f16cf7f71e180f01015f73168181722cb Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 27 Aug 2024 22:16:36 -0400 Subject: [PATCH 8/9] Update test to skip airmass on windows as timezonefinder can not be installed --- tests/playwright/examples/test_examples.py | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/playwright/examples/test_examples.py b/tests/playwright/examples/test_examples.py index 60117d7df..b316bf666 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 as _ # noqa: F401 + + # 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" + ) From a011ed2db38cb12633237d8d0e9bac018ef10a1f Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 27 Aug 2024 22:25:51 -0400 Subject: [PATCH 9/9] Ignore all the pyright things --- tests/playwright/examples/test_examples.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/playwright/examples/test_examples.py b/tests/playwright/examples/test_examples.py index b316bf666..6977f77c8 100644 --- a/tests/playwright/examples/test_examples.py +++ b/tests/playwright/examples/test_examples.py @@ -23,7 +23,7 @@ def skip_on_windows_with_timezonefinder(ex_app_path: str) -> None: return try: - import timezonefinder as _ # noqa: F401 + import timezonefinder # noqa: F401 # pyright: ignore # Future proofing: if timezonefinder is actually available on windows, raise an error raise RuntimeError(