Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit700a47f

Browse files
committed
fix: add extra for aiohttp
1 parent58516ef commit700a47f

File tree

4 files changed

+25
-14
lines changed

4 files changed

+25
-14
lines changed

‎google/api_core/rest_streaming_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
importgoogle.auth.aio.transport
2323
exceptImportErrorase:# pragma: NO COVER
2424
raiseImportError(
25-
"google-auth>=2.35.0 is required to use asynchronous rest streaming."
25+
"google-api-core[async_rest] is required to use asynchronous rest streaming."
2626
)frome
2727

2828
importgoogle.protobuf.message

‎noxfile.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def install_prerelease_dependencies(session, constraints_path):
110110
session.install(*other_deps)
111111

112112

113-
defdefault(session,install_grpc=True,prerelease=False,install_auth_aio=False):
113+
defdefault(session,install_grpc=True,prerelease=False,install_async_rest=False):
114114
"""Default unit test session.
115115
116116
This is intended to be run **without** an interpreter set, so
@@ -136,20 +136,28 @@ def default(session, install_grpc=True, prerelease=False, install_auth_aio=False
136136
session,f"{constraints_dir}/constraints-{PYTHON_VERSIONS[0]}.txt"
137137
)
138138
# This *must* be the last install command to get the package from source.
139-
session.install("-e",".","--no-deps")
139+
session.install(
140+
"-e","."+ ("[async_rest]"ifinstall_async_restelse""),"--no-deps"
141+
)
140142
else:
141143
session.install(
142144
"-e",
143-
".[grpc]"ifinstall_grpcelse".",
145+
"."
146+
+ (
147+
"[grpc,async_rest]"
148+
ifinstall_grpcandinstall_async_rest
149+
else (
150+
"[grpc]"
151+
ifinstall_grpc
152+
else"[async_rest]"
153+
ifinstall_async_rest
154+
else""
155+
)
156+
),
144157
"-c",
145158
f"{constraints_dir}/constraints-{session.python}.txt",
146159
)
147160

148-
ifinstall_auth_aio:
149-
session.install(
150-
"google-auth @ git+https://git@github.com/googleapis/google-auth-library-python@8833ad6f92c3300d6645355994c7db2356bd30ad"
151-
)
152-
153161
# Print out package versions of dependencies
154162
session.run(
155163
"python","-c","import google.protobuf; print(google.protobuf.__version__)"
@@ -236,9 +244,9 @@ def unit_wo_grpc(session):
236244

237245

238246
@nox.session(python=PYTHON_VERSIONS)
239-
defunit_with_auth_aio(session):
240-
"""Run the unit test suite withgoogle.auth.aio installed"""
241-
default(session,install_auth_aio=True)
247+
defunit_with_async_rest_extra(session):
248+
"""Run the unit test suite withthe `async_rest` extra"""
249+
default(session,install_async_rest=True)
242250

243251

244252
@nox.session(python=DEFAULT_PYTHON_VERSION)
@@ -261,7 +269,7 @@ def mypy(session):
261269
"""Run type-checking."""
262270
# TODO(https://github.com/googleapis/python-api-core/issues/682):
263271
# Use the latest version of mypy instead of mypy<1.11.0
264-
session.install(".[grpc]","mypy<1.11.0")
272+
session.install(".[grpc,async_rest]","mypy<1.11.0")
265273
session.install(
266274
"types-setuptools",
267275
"types-requests",

‎setup.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
"requests >= 2.18.0, < 3.0.0.dev0",
3737
]
3838
extras= {
39+
"async_rest": [
40+
"google-auth[aiohttp] >= 2.35.0, < 3.0.dev0",
41+
],
3942
"grpc": [
4043
"grpcio >= 1.33.2, < 2.0dev",
4144
"grpcio >= 1.49.1, < 2.0dev; python_version>='3.11'",

‎tests/asyncio/test_rest_streaming_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
ifnotAUTH_AIO_INSTALLED:# pragma: NO COVER
3737
pytest.skip(
38-
"google-auth>=2.35.0 is required to use asynchronous rest streaming.",
38+
"google-api-core[async_rest] is required to use asynchronous rest streaming.",
3939
allow_module_level=True,
4040
)
4141

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp