From 7415e24fc3dd91302696046df30a53e96cae73d0 Mon Sep 17 00:00:00 2001 From: Reinier van der Leer Date: Wed, 3 Jul 2024 23:26:37 +0200 Subject: [PATCH] fix(forge): Add `google-api-python-client-stubs` and fix type error (#7303) - Add `google-api-python-client-stubs` dev dependency - Add version specification to `google-api-python-client` dependency - Fix type error (by ignoring it) in forge/components/web/search.py --- autogpt/poetry.lock | 16 +++++++-------- forge/forge/components/web/search.py | 2 +- forge/poetry.lock | 29 +++++++++++++++++++++++++++- forge/pyproject.toml | 3 ++- 4 files changed, 39 insertions(+), 11 deletions(-) diff --git a/autogpt/poetry.lock b/autogpt/poetry.lock index c32c8da22..b5c134003 100644 --- a/autogpt/poetry.lock +++ b/autogpt/poetry.lock @@ -319,7 +319,7 @@ duckduckgo-search = "^6.1.7" en-core-web-sm = {url = "https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1-py3-none-any.whl"} fastapi = "^0.109.1" gitpython = "^3.1.32" -google-api-python-client = "*" +google-api-python-client = "^2.116" google-cloud-logging = "^3.8.0" google-cloud-storage = "^2.13.0" groq = "^0.8.0" @@ -350,7 +350,7 @@ watchdog = "4.0.0" webdriver-manager = "^4.0.1" [package.extras] -benchmark = ["agbenchmark @ file:///Users/czerwinski/Projects/AutoGPT/benchmark"] +benchmark = ["agbenchmark @ file:///home/reinier/code/agpt/AutoGPT/benchmark"] [package.source] type = "directory" @@ -1713,20 +1713,20 @@ grpcio-gcp = ["grpcio-gcp (>=0.2.2,<1.0.dev0)"] [[package]] name = "google-api-python-client" -version = "2.114.0" +version = "2.136.0" description = "Google API Client Library for Python" optional = false python-versions = ">=3.7" files = [ - {file = "google-api-python-client-2.114.0.tar.gz", hash = "sha256:e041bbbf60e682261281e9d64b4660035f04db1cccba19d1d68eebc24d1465ed"}, - {file = "google_api_python_client-2.114.0-py2.py3-none-any.whl", hash = "sha256:690e0bb67d70ff6dea4e8a5d3738639c105a478ac35da153d3b2a384064e9e1a"}, + {file = "google-api-python-client-2.136.0.tar.gz", hash = "sha256:161c722c8864e7ed39393e2b7eea76ef4e1c933a6a59f9d7c70409b6635f225d"}, + {file = "google_api_python_client-2.136.0-py2.py3-none-any.whl", hash = "sha256:5a554c8b5edf0a609b905d89d7ced82e8f6ac31da1e4d8d5684ef63dbc0e49f5"}, ] [package.dependencies] google-api-core = ">=1.31.5,<2.0.dev0 || >2.3.0,<3.0.0.dev0" -google-auth = ">=1.19.0,<3.0.0.dev0" -google-auth-httplib2 = ">=0.1.0" -httplib2 = ">=0.15.0,<1.dev0" +google-auth = ">=1.32.0,<2.24.0 || >2.24.0,<2.25.0 || >2.25.0,<3.0.0.dev0" +google-auth-httplib2 = ">=0.2.0,<1.0.0" +httplib2 = ">=0.19.0,<1.dev0" uritemplate = ">=3.0.1,<5" [[package]] diff --git a/forge/forge/components/web/search.py b/forge/forge/components/web/search.py index 73d2bc6f2..a381fd950 100644 --- a/forge/forge/components/web/search.py +++ b/forge/forge/components/web/search.py @@ -173,7 +173,7 @@ class WebSearchComponent( search_results = result.get("items", []) # Create a list of only the URLs from the search results - search_results_links = [item["link"] for item in search_results] + search_results_links = [item["link"] for item in search_results] # type: ignore # noqa except HttpError as e: # Handle errors in the API call diff --git a/forge/poetry.lock b/forge/poetry.lock index b4b063dd7..127d6efa8 100644 --- a/forge/poetry.lock +++ b/forge/poetry.lock @@ -1978,6 +1978,22 @@ google-auth-httplib2 = ">=0.2.0,<1.0.0" httplib2 = ">=0.19.0,<1.dev0" uritemplate = ">=3.0.1,<5" +[[package]] +name = "google-api-python-client-stubs" +version = "1.25.0" +description = "Type stubs for google-api-python-client" +optional = false +python-versions = ">=3.7,<4.0" +files = [ + {file = "google_api_python_client_stubs-1.25.0-py3-none-any.whl", hash = "sha256:2eff1e27b0b2980843f0ed242e430e29a2f7a2808d7b90e971f23e4ea73827a7"}, + {file = "google_api_python_client_stubs-1.25.0.tar.gz", hash = "sha256:f4d219012afb35e3dfbdcfffcb0b347179045f9f48a8d59ef9d45cc743f300d4"}, +] + +[package.dependencies] +google-api-python-client = ">=2.122.0" +types-httplib2 = ">=0.22.0.2" +typing-extensions = ">=3.10.0" + [[package]] name = "google-auth" version = "2.26.2" @@ -6308,6 +6324,17 @@ files = [ {file = "types_html5lib-1.1.11.20240228-py3-none-any.whl", hash = "sha256:af5de0125cb0fe5667543b158db83849b22e25c0e36c9149836b095548bf1020"}, ] +[[package]] +name = "types-httplib2" +version = "0.22.0.20240310" +description = "Typing stubs for httplib2" +optional = false +python-versions = ">=3.8" +files = [ + {file = "types-httplib2-0.22.0.20240310.tar.gz", hash = "sha256:1eda99fea18ec8a1dc1a725ead35b889d0836fec1b11ae6f1fe05440724c1d15"}, + {file = "types_httplib2-0.22.0.20240310-py3-none-any.whl", hash = "sha256:8cd706fc81f0da32789a4373a28df6f39e9d5657d1281db4d2fd22ee29e83661"}, +] + [[package]] name = "types-pillow" version = "10.2.0.20240520" @@ -7002,4 +7029,4 @@ benchmark = ["agbenchmark"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "ae056efba5ba4bf69ae1fe9aa84169e20b89368fbd982c7812c3b0f41d46c666" +content-hash = "5b8cca9caced2687d88fc61dc263054f15c49f2daa1560fa4d94fb5b38d461aa" diff --git a/forge/pyproject.toml b/forge/pyproject.toml index 996ad768b..991012014 100644 --- a/forge/pyproject.toml +++ b/forge/pyproject.toml @@ -25,7 +25,7 @@ duckduckgo-search = "^6.1.7" en-core-web-sm = { url = "https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1-py3-none-any.whl" } fastapi = "^0.109.1" gitpython = "^3.1.32" -google-api-python-client = "*" +google-api-python-client = "^2.116" google-cloud-logging = "^3.8.0" google-cloud-storage = "^2.13.0" groq = "^0.8.0" @@ -67,6 +67,7 @@ pre-commit = "^3.3.3" # Type stubs boto3-stubs = { extras = ["s3"], version = "^1.33.6" } +google-api-python-client-stubs = "^1.24" types-beautifulsoup4 = "*" types-Pillow = "*" types-requests = "^2.31.0.2"