Skip to content

Commit

Permalink
Merge branch 'main' into release-please--branches--main
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-sanche authored Aug 13, 2024
2 parents f8c41c3 + e5e5874 commit 1ac80ab
Show file tree
Hide file tree
Showing 25 changed files with 337 additions and 302 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
3 changes: 1 addition & 2 deletions .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:5a4c19d17e597b92d786e569be101e636c9c2817731f80a5adec56b2aa8fe070
# created: 2024-04-12T11:35:58.922854369Z
digest: sha256:5651442a6336971a2fb2df40fb56b3337df67cafa14c0809cc89cb34ccee1b8e
2 changes: 1 addition & 1 deletion .github/auto-label.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/docker/docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/populate-secrets.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2023 Google LLC.
# Copyright 2024 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/publish-docs.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/release.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
509 changes: 266 additions & 243 deletions .kokoro/requirements.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .kokoro/test-samples-against-head.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/test-samples-impl.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/test-samples.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/trampoline.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/trampoline_v2.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion .trampolinerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
61 changes: 46 additions & 15 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,6 +28,7 @@
import nox

FLAKE8_VERSION = "flake8==6.1.0"
PYTYPE_VERSION = "pytype==2020.7.24"
BLACK_VERSION = "black[jupyter]==23.7.0"
ISORT_VERSION = "isort==5.11.0"
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
Expand All @@ -40,7 +41,7 @@
"asyncmock",
"pytest",
"pytest-cov",
"pytest-asyncio",
"pytest-asyncio==0.21.2",
]
UNIT_TEST_EXTERNAL_DEPENDENCIES: List[str] = [
"aiounittest",
Expand All @@ -59,7 +60,7 @@
"google-cloud-testutils",
]
SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = [
"pytest-asyncio",
"pytest-asyncio==0.21.2",
"six",
]
SYSTEM_TEST_LOCAL_DEPENDENCIES: List[str] = []
Expand Down Expand Up @@ -186,14 +187,28 @@ def install_unittest_dependencies(session, *constraints):
session.install("-e", ".", *constraints)


def default(session):
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
@nox.parametrize(
"protobuf_implementation",
["python", "upb", "cpp"],
)
def unit(session, protobuf_implementation):
# Install all test dependencies, then install this package in-place.

if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12"):
session.skip("cpp implementation is not supported in python 3.11+")

constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
install_unittest_dependencies(session, "-c", constraints_path)

# TODO(https://github.com/googleapis/synthtool/issues/1976):
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
# The 'cpp' implementation requires Protobuf<4.
if protobuf_implementation == "cpp":
session.install("protobuf<4")

# Run py.test against the unit tests.
session.run(
"py.test",
Expand All @@ -207,15 +222,12 @@ def default(session):
"--cov-fail-under=0",
os.path.join("tests", "unit"),
*session.posargs,
env={
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
},
)


@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
def unit(session):
"""Run the unit test suite."""
default(session)


def install_systemtest_dependencies(session, *constraints):
# Use pre-release gRPC for system tests.
# Exclude version 1.52.0rc1 which has a known issue.
Expand Down Expand Up @@ -434,10 +446,17 @@ def docfx(session):
)


@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
def prerelease_deps(session):
@nox.session(python="3.12")
@nox.parametrize(
"protobuf_implementation",
["python", "upb", "cpp"],
)
def prerelease_deps(session, protobuf_implementation):
"""Run all tests with prerelease versions of dependencies installed."""

if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12"):
session.skip("cpp implementation is not supported in python 3.11+")

# Install all dependencies
session.install("-e", ".[all, tests, tracing]")
unit_deps_all = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_EXTERNAL_DEPENDENCIES
Expand Down Expand Up @@ -472,9 +491,9 @@ def prerelease_deps(session):
"protobuf",
# dependency of grpc
"six",
"grpc-google-iam-v1",
"googleapis-common-protos",
# Exclude version 1.52.0rc1 which has a known issue. See https://github.com/grpc/grpc/issues/32163
"grpcio!=1.52.0rc1",
"grpcio",
"grpcio-status",
"google-api-core",
"google-auth",
Expand All @@ -500,7 +519,13 @@ def prerelease_deps(session):
session.run("python", "-c", "import grpc; print(grpc.__version__)")
session.run("python", "-c", "import google.auth; print(google.auth.__version__)")

session.run("py.test", "tests/unit")
session.run(
"py.test",
"tests/unit",
env={
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
},
)

system_test_path = os.path.join("tests", "system.py")
system_test_folder_path = os.path.join("tests", "system")
Expand All @@ -513,6 +538,9 @@ def prerelease_deps(session):
f"--junitxml=system_{session.python}_sponge_log.xml",
system_test_path,
*session.posargs,
env={
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
},
)
if os.path.exists(system_test_folder_path):
session.run(
Expand All @@ -521,4 +549,7 @@ def prerelease_deps(session):
f"--junitxml=system_{session.python}_sponge_log.xml",
system_test_folder_path,
*session.posargs,
env={
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
},
)
24 changes: 3 additions & 21 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,33 +264,14 @@ def system_emulated(session):
""",
)

s.replace(
"setup.cfg",
"""\
universal = 1
""",
"""\
universal = 1
[pytype]
python_version = 3.8
inputs =
google/cloud/
exclude =
tests/
output = .pytype/
# Workaround for https://github.com/google/pytype/issues/150
disable = pyi-error
""",
)

s.replace(
"noxfile.py",
"""\
BLACK_VERSION = "black==22.3.0"
BLACK_VERSION = "black\[jupyter\]==23.7.0"
""",
"""\
PYTYPE_VERSION = "pytype==2020.7.24"
BLACK_VERSION = "black==22.3.0"
BLACK_VERSION = "black[jupyter]==23.7.0"
""",
)

Expand Down Expand Up @@ -353,3 +334,4 @@ def lint_setup_py(session):
Test Coverage"""
)

s.replace("noxfile.py", "\"pytest-asyncio\"", "\"pytest-asyncio==0.21.2\"")
2 changes: 1 addition & 1 deletion scripts/decrypt-secrets.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2023 Google LLC All rights reserved.
# Copyright 2024 Google LLC All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion scripts/readme-gen/readme_gen.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

# Copyright 2023 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion tests/system/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from google.cloud.firestore_v1.base_query import And, FieldFilter, Or
from google.cloud.firestore_v1.base_vector_query import DistanceMeasure
from google.cloud.firestore_v1.vector import Vector
from tests.system.test__helpers import (
from test__helpers import (
EMULATOR_CREDS,
FIRESTORE_CREDS,
FIRESTORE_EMULATOR,
Expand Down
2 changes: 1 addition & 1 deletion tests/system/test_system_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from google.cloud.firestore_v1.base_query import And, FieldFilter, Or
from google.cloud.firestore_v1.base_vector_query import DistanceMeasure
from google.cloud.firestore_v1.vector import Vector
from tests.system.test__helpers import (
from test__helpers import (
EMULATOR_CREDS,
FIRESTORE_CREDS,
FIRESTORE_EMULATOR,
Expand Down

0 comments on commit 1ac80ab

Please sign in to comment.