Skip to content

Commit 646916d

Browse files
committed
chore: update post processing scripts
1 parent 28000bf commit 646916d

File tree

9 files changed

+52
-5
lines changed

9 files changed

+52
-5
lines changed

.librarian/generator-input/client-post-processing/storage-integration.yaml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ replacements:
44
packages/google-cloud-storage/noxfile.py,
55
]
66
before: |
7-
UNIT_TEST_EXTRAS: List\[str\] = \[\]
7+
UNIT_TEST_DEPENDENCIES: List\[str\] = \[\]
88
after: |
9-
UNIT_TEST_EXTRAS: List[str] = [
9+
UNIT_TEST_DEPENDENCIES: List[str] = [
1010
"brotli",
1111
"grpcio",
12+
"grpc-google-iam-v1",
1213
"opentelemetry-api",
1314
"opentelemetry-sdk",
1415
]
@@ -642,6 +643,8 @@ replacements:
642643
[\s\S]*?grpc-google-iam-v1==0.14.0
643644
after: |
644645
google-auth==2.26.1
646+
# cryptography is a direct dependency of google-auth
647+
cryptography
645648
google-api-core==2.27.0
646649
google-cloud-core==2.4.2
647650
google-resumable-media==2.7.2
@@ -661,6 +664,8 @@ replacements:
661664
[\s\S]*?grpc-google-iam-v1
662665
after: |
663666
google-auth
667+
# cryptography is a direct dependency of google-auth
668+
cryptography
664669
google-api-core
665670
google-cloud-core
666671
google-resumable-media
@@ -679,6 +684,8 @@ replacements:
679684
[\s\S]*?grpc-google-iam-v1>=0
680685
after: |
681686
google-auth
687+
# cryptography is a direct dependency of google-auth
688+
cryptography
682689
google-api-core
683690
google-cloud-core
684691
google-resumable-media
@@ -759,4 +766,22 @@ replacements:
759766
Official Google Cloud Storage How-to Guides <https://cloud.google.com/storage/docs/how-to>
760767
Official Google Cloud Storage Samples <https://cloud.google.com/storage/docs/samples>
761768
count: 1
769+
- paths: [
770+
packages/google-cloud-storage/tests/unit/__init__.py
771+
]
772+
before: "#\n$"
773+
after: |
774+
import io
775+
import json
776+
import os
777+
778+
779+
def _read_local_json(json_file):
780+
here = os.path.dirname(__file__)
781+
json_path = os.path.abspath(os.path.join(here, json_file))
782+
with io.open(json_path, "r", encoding="utf-8-sig") as fileobj:
783+
return json.load(fileobj)
784+
count: 1
785+
786+
762787

packages/google-cloud-storage/noxfile.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,14 @@
6060
]
6161
UNIT_TEST_EXTERNAL_DEPENDENCIES: List[str] = []
6262
UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = []
63-
UNIT_TEST_DEPENDENCIES: List[str] = []
64-
UNIT_TEST_EXTRAS: List[str] = [
63+
UNIT_TEST_DEPENDENCIES: List[str] = [
6564
"brotli",
6665
"grpcio",
66+
"grpc-google-iam-v1",
6767
"opentelemetry-api",
6868
"opentelemetry-sdk",
6969
]
70+
UNIT_TEST_EXTRAS: List[str] = []
7071
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
7172

7273
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ALL_PYTHON

packages/google-cloud-storage/testing/constraints-3.10.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# This constraints file is required for unit tests.
33
# List all library dependencies and extras in this file.
44
google-auth
5+
# cryptography is a direct dependency of google-auth
6+
cryptography
57
google-api-core
68
google-cloud-core
79
google-resumable-media

packages/google-cloud-storage/testing/constraints-3.11.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# This constraints file is required for unit tests.
33
# List all library dependencies and extras in this file.
44
google-auth
5+
# cryptography is a direct dependency of google-auth
6+
cryptography
57
google-api-core
68
google-cloud-core
79
google-resumable-media

packages/google-cloud-storage/testing/constraints-3.12.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# This constraints file is required for unit tests.
33
# List all library dependencies and extras in this file.
44
google-auth
5+
# cryptography is a direct dependency of google-auth
6+
cryptography
57
google-api-core
68
google-cloud-core
79
google-resumable-media

packages/google-cloud-storage/testing/constraints-3.13.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
77
# Then this file should have google-cloud-foo>=1
88
google-auth
9+
# cryptography is a direct dependency of google-auth
10+
cryptography
911
google-api-core
1012
google-cloud-core
1113
google-resumable-media

packages/google-cloud-storage/testing/constraints-3.14.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
77
# Then this file should have google-cloud-foo>=1
88
google-auth
9+
# cryptography is a direct dependency of google-auth
10+
cryptography
911
google-api-core
1012
google-cloud-core
1113
google-resumable-media

packages/google-cloud-storage/testing/constraints-3.9.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
77
# then this file should have google-cloud-foo==1.14.0
88
google-auth==2.26.1
9+
# cryptography is a direct dependency of google-auth
10+
cryptography
911
google-api-core==2.27.0
1012
google-cloud-core==2.4.2
1113
google-resumable-media==2.7.2

packages/google-cloud-storage/tests/unit/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,13 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
#
15+
import io
16+
import json
17+
import os
18+
19+
20+
def _read_local_json(json_file):
21+
here = os.path.dirname(__file__)
22+
json_path = os.path.abspath(os.path.join(here, json_file))
23+
with io.open(json_path, "r", encoding="utf-8-sig") as fileobj:
24+
return json.load(fileobj)

0 commit comments

Comments
 (0)