@@ -82,7 +82,15 @@ def unit(session):
8282 "grpcio-status" ,
8383 "proto-plus" ,
8484 )
85- session .install ("-e" , "." )
85+ session .install ("setuptools<70.0.0" , "wheel" )
86+ session .run ("uv" , "build" , "--wheel" , "--out-dir" , "/tmp/wheels" , "../google-api-core" )
87+ session .run ("uv" , "build" , "--wheel" , "--out-dir" , "/tmp/wheels" , "../google-auth" )
88+ session .run (
89+ "uv" , "pip" , "install" ,
90+ "/tmp/wheels/google_api_core-2.40.0-py3-none-any.whl" ,
91+ "/tmp/wheels/google_auth-2.59.1-py3-none-any.whl"
92+ )
93+ session .run ("uv" , "pip" , "install" , "." )
8694 session .run (
8795 "py.test" ,
8896 * (
@@ -98,6 +106,9 @@ def unit(session):
98106 path .join ("tests" , "unit" ),
99107 ]
100108 ),
109+ # `test_utils` is not part of the installed package (only `gapic` is
110+ # included in setup.py), but it is needed for running tests.
111+ env = {"PYTHONPATH" : "." },
101112 )
102113
103114
@@ -150,7 +161,7 @@ def __call__(self, frag):
150161
151162 # Install the generated fragment library.
152163 if self .use_ads_templates :
153- self .session .install (tmp_dir , "-e" , " ." , "-qqq" )
164+ self .session .install (tmp_dir , "." , "-qqq" )
154165 else :
155166 # Use the constraints file for the specific python runtime version.
156167 # We do this to make sure that we're testing against the lowest
@@ -161,7 +172,7 @@ def __call__(self, frag):
161172 constraints_path = str (
162173 f"{ tmp_dir } /testing/constraints-{ self .session .python } .txt"
163174 )
164- self .session .install (tmp_dir , "-e" , " ." , "-qqq" , "-r" , constraints_path )
175+ self .session .install (tmp_dir , "." , "-qqq" , "-r" , constraints_path )
165176
166177 # Run the fragment's generated unit tests.
167178 # Don't bother parallelizing them: we already parallelize
@@ -191,7 +202,7 @@ def fragment(session, use_ads_templates=False):
191202 "pytest-asyncio" ,
192203 "grpcio-tools" ,
193204 )
194- session .install ("-e" , " ." )
205+ session .install ("." )
195206
196207 frag_files = (
197208 [Path (f ) for f in session .posargs ] if session .posargs else FRAGMENT_FILES
@@ -273,7 +284,7 @@ def showcase_library(
273284 session .log ("-" * 70 )
274285
275286 # Install gapic-generator-python
276- session .install ("-e" , " ." )
287+ session .install ("." )
277288
278289 # Install grpcio-tools for protoc
279290 session .install ("grpcio-tools" )
@@ -445,7 +456,7 @@ def showcase(
445456 session .error (
446457 f"INSTALL_LOCAL_CORE is set to 'true' but { local_core } does not exist."
447458 )
448- session .install ("-e" , str (local_core ))
459+ session .install (str (local_core ))
449460
450461 # Use pytest-asyncio<1.0.0 while we investigate the recent failure described in
451462 # https://github.com/googleapis/gapic-generator-python/issues/2399
@@ -491,7 +502,7 @@ def showcase_w_rest_async(
491502 session .error (
492503 f"INSTALL_LOCAL_CORE is set to 'true' but { local_core } does not exist."
493504 )
494- session .install ("-e" , str (local_core ))
505+ session .install (str (local_core ))
495506
496507 # Use pytest-asyncio<1.0.0 while we investigate the recent failure described in
497508 # https://github.com/googleapis/gapic-generator-python/issues/2399
@@ -743,7 +754,7 @@ def snippetgen(session):
743754 )
744755
745756 # Install gapic-generator-python
746- session .install ("-e" , " ." )
757+ session .install ("." )
747758
748759 session .install ("grpcio-tools" , "pytest" , "pytest-asyncio" )
749760
@@ -754,8 +765,15 @@ def snippetgen(session):
754765def docs (session ):
755766 """Build the docs for this generator."""
756767
757- session .install ("-e" , "." )
758-
768+ session .install ("setuptools<70.0.0" , "wheel" )
769+ session .run ("uv" , "build" , "--wheel" , "--out-dir" , "/tmp/wheels" , "../google-api-core" )
770+ session .run ("uv" , "build" , "--wheel" , "--out-dir" , "/tmp/wheels" , "../google-auth" )
771+ session .run (
772+ "uv" , "pip" , "install" ,
773+ "/tmp/wheels/google_api_core-2.40.0-py3-none-any.whl" ,
774+ "/tmp/wheels/google_auth-2.59.1-py3-none-any.whl"
775+ )
776+ session .run ("uv" , "pip" , "install" , "." )
759777 session .install (
760778 # We need to pin to specific versions of the `sphinxcontrib-*` packages
761779 # which still support sphinx 4.x.
@@ -790,7 +808,7 @@ def docs(session):
790808def docfx (session ):
791809 """Build the docfx yaml files for this library."""
792810
793- session .install ("-e" , " ." )
811+ session .install ("." )
794812 session .install (
795813 # We need to pin to specific versions of the `sphinxcontrib-*` packages
796814 # which still support sphinx 4.x.
@@ -843,7 +861,14 @@ def mypy(session):
843861 "types-dataclasses" ,
844862 "click==8.1.3" ,
845863 )
846- session .install ("." )
864+ session .run ("uv" , "build" , "--wheel" , "--out-dir" , "/tmp/wheels" , "../google-api-core" )
865+ session .run ("uv" , "build" , "--wheel" , "--out-dir" , "/tmp/wheels" , "../google-auth" )
866+ session .run (
867+ "uv" , "pip" , "install" ,
868+ "/tmp/wheels/google_api_core-2.40.0-py3-none-any.whl" ,
869+ "/tmp/wheels/google_auth-2.59.1-py3-none-any.whl"
870+ )
871+ session .run ("uv" , "pip" , "install" , "." )
847872 session .run ("mypy" , f"--config-file={ MYPY_CONFIG_FILE } " , "-p" , "gapic" )
848873
849874
0 commit comments