diff --git a/pyproject.toml b/pyproject.toml index d92c64de1..243e2838e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -95,7 +95,7 @@ dev = [ "Flake8-pyproject>=1.2.3", "isort>=5.10.1", "libsass>=0.23.0", - "pyright==1.1.369", + "pyright>=1.1.383", "pre-commit>=2.15.0", "wheel", "matplotlib", diff --git a/shiny/_utils.py b/shiny/_utils.py index aff24044b..a52997d72 100644 --- a/shiny/_utils.py +++ b/shiny/_utils.py @@ -85,7 +85,7 @@ def guess_mime_type( if url: # Work around issue #1601, some installations of Windows 10 return text/plain # as the mime type for .js files - _, ext = os.path.splitext(os.fspath(url)) + _, ext = os.path.splitext(os.fspath(str(url))) if ext.lower() in [".js", ".mjs", ".cjs"]: return "text/javascript" return mimetypes.guess_type(url, strict)[0] or default diff --git a/tests/playwright/shiny/components/data_frame/edit/app.py b/tests/playwright/shiny/components/data_frame/edit/app.py index c759bf9d7..2f8707e39 100644 --- a/tests/playwright/shiny/components/data_frame/edit/app.py +++ b/tests/playwright/shiny/components/data_frame/edit/app.py @@ -89,7 +89,11 @@ def gt_styles(df_gt: gt.GT) -> list[StyleInfo]: ret: list[StyleInfo] = [] for style in styles: location = style.locname - location = "body" if location == "data" else location + location = ( + "body" + if location == "data" # pyright: ignore[reportUnnecessaryComparison] + else location + ) assert location == "body", f"`style.locname` is {location}, expected 'body'" rows = style.rownum assert rows is not None diff --git a/tests/playwright/shiny/components/data_frame/styles/great_tables_test_utils.py b/tests/playwright/shiny/components/data_frame/styles/great_tables_test_utils.py index eb0213417..3ec41f236 100644 --- a/tests/playwright/shiny/components/data_frame/styles/great_tables_test_utils.py +++ b/tests/playwright/shiny/components/data_frame/styles/great_tables_test_utils.py @@ -23,7 +23,11 @@ def gt_styles(df_gt: gt.GT) -> list[StyleInfo]: ret: list[StyleInfo] = [] for style in styles: location = style.locname - location = "body" if location == "data" else location + location = ( + "body" + if location == "data" # pyright: ignore[reportUnnecessaryComparison] + else location + ) assert location == "body", f"`style.locname` is {location}, expected 'body'" rows = style.rownum assert rows is not None @@ -39,7 +43,7 @@ def gt_styles(df_gt: gt.GT) -> list[StyleInfo]: ) ret.append( { - "location": location, + "location": location, # pyright: ignore[reportArgumentType] "rows": rows, "cols": cols, "style": style_obj, diff --git a/tests/playwright/shiny/deprecated/output_transformer/app.py b/tests/playwright/shiny/deprecated/output_transformer/app.py index 725d9f6f1..3ec9dfe38 100644 --- a/tests/playwright/shiny/deprecated/output_transformer/app.py +++ b/tests/playwright/shiny/deprecated/output_transformer/app.py @@ -1,3 +1,9 @@ +# pyright: reportUntypedFunctionDecorator=false +# pyright: reportUnknownParameterType=false +# pyright: reportUnknownMemberType=false +# pyright: reportInvalidTypeForm=false +# pyright: reportUnknownArgumentType=false +# pyright: reportArgumentType=false from __future__ import annotations import warnings diff --git a/tests/playwright/shiny/server/output_transformer/app.py b/tests/playwright/shiny/server/output_transformer/app.py index 8c988cc62..37d1063dc 100644 --- a/tests/playwright/shiny/server/output_transformer/app.py +++ b/tests/playwright/shiny/server/output_transformer/app.py @@ -1,3 +1,8 @@ +# pyright: reportUntypedFunctionDecorator=false +# pyright: reportUnknownMemberType=false +# pyright: reportInvalidTypeForm=false +# pyright: reportUnknownParameterType=false +# pyright: reportUnknownArgumentType=false from __future__ import annotations from typing import Optional, overload diff --git a/tests/pytest/test_output_transformer.py b/tests/pytest/test_output_transformer.py index 0ae494b0c..afd69811a 100644 --- a/tests/pytest/test_output_transformer.py +++ b/tests/pytest/test_output_transformer.py @@ -1,3 +1,9 @@ +# pyright: reportUnknownParameterType=false +# pyright: reportUnknownMemberType=false +# pyright: reportInvalidTypeForm=false +# pyright: reportUntypedFunctionDecorator=false +# pyright: reportUnknownArgumentType=false +# pyright: reportFunctionMemberAccess=false from __future__ import annotations import asyncio