From d5620552d386e255447f781e89fc768f1e833b23 Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Wed, 29 Jan 2025 11:02:13 -0600 Subject: [PATCH] Fix CI (#1830) Co-authored-by: Garrick Aden-Buie --- pyproject.toml | 6 ++++++ shiny/_autoreload.py | 1 - tests/playwright/deploys/plotly/app_requirements.txt | 1 + tests/pytest/test_chat.py | 8 +++++--- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 291849ea2..b5410ec46 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,6 +75,7 @@ test = [ "seaborn", "plotnine", "plotly", + "anywidget", "duckdb", "holoviews", "bokeh", @@ -116,6 +117,11 @@ dev = [ "anthropic", "google-generativeai;python_version>='3.9'", "langchain_core", + # langsmith (needed for langchain_core) versions >= 0.3 + # (up to at least 0.3.2 as of 2025-01-29) + # cause an `argparse.ArgumentError` when running `pytest`. + # https://github.com/posit-dev/py-shiny/issues/1829 + "langsmith<0.3", "openai", "ollama", "tokenizers", diff --git a/shiny/_autoreload.py b/shiny/_autoreload.py index 634554608..a00692183 100644 --- a/shiny/_autoreload.py +++ b/shiny/_autoreload.py @@ -251,7 +251,6 @@ async def process_request( status_code=http.HTTPStatus.MOVED_PERMANENTLY, reason_phrase="Moved Permanently", headers=websockets.Headers(Location=app_url), - body=None, ) else: return None diff --git a/tests/playwright/deploys/plotly/app_requirements.txt b/tests/playwright/deploys/plotly/app_requirements.txt index ee8efdb25..7df8afb67 100644 --- a/tests/playwright/deploys/plotly/app_requirements.txt +++ b/tests/playwright/deploys/plotly/app_requirements.txt @@ -1,5 +1,6 @@ pandas plotly +anywidget htmltools git+https://github.com/posit-dev/py-shinywidgets.git#egg=shinywidgets diff --git a/tests/pytest/test_chat.py b/tests/pytest/test_chat.py index 4fb9e167c..2fca1a8ef 100644 --- a/tests/pytest/test_chat.py +++ b/tests/pytest/test_chat.py @@ -206,7 +206,7 @@ def test_google_normalization(): if sys.version_info < (3, 9): return - from google.generativeai import ( # pyright: ignore[reportMissingTypeStubs] + from google.generativeai.generative_models import ( # pyright: ignore[reportMissingTypeStubs] GenerativeModel, ) @@ -382,7 +382,7 @@ def test_as_google_message(): if sys.version_info < (3, 9): return - from google.generativeai import ( # pyright: ignore[reportMissingTypeStubs] + from google.generativeai.generative_models import ( # pyright: ignore[reportMissingTypeStubs] GenerativeModel, ) @@ -403,7 +403,9 @@ def test_as_google_message(): def test_as_langchain_message(): - from langchain_core.language_models.base import LanguageModelInput + from langchain_core.language_models.base import ( + LanguageModelInput, + ) from langchain_core.language_models.base import ( Sequence as LangchainSequence, # pyright: ignore[reportPrivateImportUsage] )