From ed7d6383a8777f91207ea8dbea9ed170c076a650 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Jul 2025 18:10:48 +0000 Subject: [PATCH 1/6] Initial plan From 7553ecae55b1808f3cfdb4a6f8c0641ab7614eb6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Jul 2025 18:20:00 +0000 Subject: [PATCH 2/6] Replace deprecated appdirs with platformdirs Co-authored-by: karangattu <4220325+karangattu@users.noreply.github.com> --- pyproject.toml | 2 +- shiny/_static.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0a5ef7e76..c9d69d6d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ dependencies = [ "markdown-it-py>=1.1.0", "mdit-py-plugins>=0.3.0", "linkify-it-py>=1.0", - "appdirs>=1.4.4", + "platformdirs>=3.0.0", "asgiref>=3.5.2", "packaging>=20.9", "watchfiles>=0.18.0;platform_system!='Emscripten'", diff --git a/shiny/_static.py b/shiny/_static.py index 96d00c6ef..34c98e597 100644 --- a/shiny/_static.py +++ b/shiny/_static.py @@ -36,12 +36,12 @@ def remove_shinylive_local( def get_default_shinylive_dir() -> Path: - import appdirs + import platformdirs return ( Path( - appdirs.user_cache_dir( # pyright: ignore[reportUnknownMemberType, reportUnknownArgumentType] - "shiny" + platformdirs.user_cache_dir( # pyright: ignore[reportUnknownMemberType, reportUnknownArgumentType] + appname="shiny" ) ) / "shinylive" From 92c1e6e3a8a2180b666b3ec4367e6520937cd799 Mon Sep 17 00:00:00 2001 From: Karan Gathani Date: Wed, 16 Jul 2025 00:24:16 +0530 Subject: [PATCH 3/6] Update Makefile to use platformdirs instead of appdirs Replaces references to 'appdirs' with 'platformdirs' for type stub generation using pyright. Updates the pyright-typings target and related commands accordingly. --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 215ef4cb4..bb6f1bae9 100644 --- a/Makefile +++ b/Makefile @@ -56,9 +56,9 @@ clean-test: FORCE rm -fr .pytest_cache rm -rf typings/ -typings/appdirs: - @echo "Creating appdirs stubs" - pyright --createstub appdirs +typings/platformdirs: + @echo "Creating platformdirs stubs" + pyright --createstub platformdirs typings/folium: @echo "Creating folium stubs" pyright --createstub folium @@ -75,7 +75,7 @@ typings/matplotlib/__init__.pyi: mv typings/python-type-stubs/stubs/matplotlib typings/ rm -rf typings/python-type-stubs -pyright-typings: typings/appdirs typings/folium typings/uvicorn typings/seaborn typings/matplotlib/__init__.pyi +pyright-typings: typings/platformdirs typings/folium typings/uvicorn typings/seaborn typings/matplotlib/__init__.pyi check: check-format check-lint check-types check-tests ## check code, style, types, and test (basic CI) check-fix: format check-lint check-types check-tests ## check and format code, style, types, and test From 14b2dac96589df7774c3c2ed0ede6917fe2ca6ab Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Mon, 21 Jul 2025 14:44:24 -0400 Subject: [PATCH 4/6] reduce version requirement --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c9d69d6d8..4dbcd5f47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ dependencies = [ "markdown-it-py>=1.1.0", "mdit-py-plugins>=0.3.0", "linkify-it-py>=1.0", - "platformdirs>=3.0.0", + "platformdirs>=2.1.0", "asgiref>=3.5.2", "packaging>=20.9", "watchfiles>=0.18.0;platform_system!='Emscripten'", From 33e6798d8d6fdc2a9e31af52487ac879b499f72d Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Mon, 21 Jul 2025 14:44:56 -0400 Subject: [PATCH 5/6] no need to make typings for a typed package --- Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Makefile b/Makefile index bb6f1bae9..b9f880343 100644 --- a/Makefile +++ b/Makefile @@ -56,9 +56,6 @@ clean-test: FORCE rm -fr .pytest_cache rm -rf typings/ -typings/platformdirs: - @echo "Creating platformdirs stubs" - pyright --createstub platformdirs typings/folium: @echo "Creating folium stubs" pyright --createstub folium @@ -75,7 +72,7 @@ typings/matplotlib/__init__.pyi: mv typings/python-type-stubs/stubs/matplotlib typings/ rm -rf typings/python-type-stubs -pyright-typings: typings/platformdirs typings/folium typings/uvicorn typings/seaborn typings/matplotlib/__init__.pyi +pyright-typings: typings/folium typings/uvicorn typings/seaborn typings/matplotlib/__init__.pyi check: check-format check-lint check-types check-tests ## check code, style, types, and test (basic CI) check-fix: format check-lint check-types check-tests ## check and format code, style, types, and test From 1c8b7fb2924eb63f375727a754eb124dfc7919f7 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Mon, 21 Jul 2025 14:45:26 -0400 Subject: [PATCH 6/6] cosmetic --- shiny/_static.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/shiny/_static.py b/shiny/_static.py index 34c98e597..17f10c2c9 100644 --- a/shiny/_static.py +++ b/shiny/_static.py @@ -38,14 +38,8 @@ def remove_shinylive_local( def get_default_shinylive_dir() -> Path: import platformdirs - return ( - Path( - platformdirs.user_cache_dir( # pyright: ignore[reportUnknownMemberType, reportUnknownArgumentType] - appname="shiny" - ) - ) - / "shinylive" - ) + user_cache_dir = platformdirs.user_cache_dir("shinylive") + return Path(user_cache_dir) / "shinylive" def _installed_shinylive_versions(shinylive_dir: Optional[Path] = None) -> list[str]: