Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

chore(python): use black==22.3.0 #70

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba
digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,10 @@
intersphinx_mapping = {
"python": ("https://python.readthedocs.org/en/latest/", None),
"google-auth": ("https://googleapis.dev/python/google-auth/latest/", None),
"google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,),
"google.api_core": (
"https://googleapis.dev/python/google-api-core/latest/",
None,
),
"grpc": ("https://grpc.github.io/grpc/python/", None),
"proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None),
"protobuf": ("https://googleapis.dev/python/protobuf/latest/", None),
Expand Down
146 changes: 119 additions & 27 deletions google/cloud/source_context_v1/types/source_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,28 @@ class SourceContext(proto.Message):
"""

cloud_repo = proto.Field(
proto.MESSAGE, number=1, oneof="context", message="CloudRepoSourceContext",
proto.MESSAGE,
number=1,
oneof="context",
message="CloudRepoSourceContext",
)
cloud_workspace = proto.Field(
proto.MESSAGE, number=2, oneof="context", message="CloudWorkspaceSourceContext",
proto.MESSAGE,
number=2,
oneof="context",
message="CloudWorkspaceSourceContext",
)
gerrit = proto.Field(
proto.MESSAGE, number=3, oneof="context", message="GerritSourceContext",
proto.MESSAGE,
number=3,
oneof="context",
message="GerritSourceContext",
)
git = proto.Field(
proto.MESSAGE, number=6, oneof="context", message="GitSourceContext",
proto.MESSAGE,
number=6,
oneof="context",
message="GitSourceContext",
)


Expand All @@ -93,8 +105,16 @@ class ExtendedSourceContext(proto.Message):
Labels with user defined metadata.
"""

context = proto.Field(proto.MESSAGE, number=1, message="SourceContext",)
labels = proto.MapField(proto.STRING, proto.STRING, number=2,)
context = proto.Field(
proto.MESSAGE,
number=1,
message="SourceContext",
)
labels = proto.MapField(
proto.STRING,
proto.STRING,
number=2,
)


class AliasContext(proto.Message):
Expand All @@ -114,8 +134,15 @@ class Kind(proto.Enum):
MOVABLE = 2
OTHER = 4

kind = proto.Field(proto.ENUM, number=1, enum=Kind,)
name = proto.Field(proto.STRING, number=2,)
kind = proto.Field(
proto.ENUM,
number=1,
enum=Kind,
)
name = proto.Field(
proto.STRING,
number=2,
)


class CloudRepoSourceContext(proto.Message):
Expand Down Expand Up @@ -146,11 +173,26 @@ class CloudRepoSourceContext(proto.Message):
This field is a member of `oneof`_ ``revision``.
"""

repo_id = proto.Field(proto.MESSAGE, number=1, message="RepoId",)
revision_id = proto.Field(proto.STRING, number=2, oneof="revision",)
alias_name = proto.Field(proto.STRING, number=3, oneof="revision",)
repo_id = proto.Field(
proto.MESSAGE,
number=1,
message="RepoId",
)
revision_id = proto.Field(
proto.STRING,
number=2,
oneof="revision",
)
alias_name = proto.Field(
proto.STRING,
number=3,
oneof="revision",
)
alias_context = proto.Field(
proto.MESSAGE, number=4, oneof="revision", message="AliasContext",
proto.MESSAGE,
number=4,
oneof="revision",
message="AliasContext",
)


Expand All @@ -166,8 +208,15 @@ class CloudWorkspaceSourceContext(proto.Message):
most recent snapshot.
"""

workspace_id = proto.Field(proto.MESSAGE, number=1, message="CloudWorkspaceId",)
snapshot_id = proto.Field(proto.STRING, number=2,)
workspace_id = proto.Field(
proto.MESSAGE,
number=1,
message="CloudWorkspaceId",
)
snapshot_id = proto.Field(
proto.STRING,
number=2,
)


class GerritSourceContext(proto.Message):
Expand Down Expand Up @@ -202,12 +251,29 @@ class GerritSourceContext(proto.Message):
This field is a member of `oneof`_ ``revision``.
"""

host_uri = proto.Field(proto.STRING, number=1,)
gerrit_project = proto.Field(proto.STRING, number=2,)
revision_id = proto.Field(proto.STRING, number=3, oneof="revision",)
alias_name = proto.Field(proto.STRING, number=4, oneof="revision",)
host_uri = proto.Field(
proto.STRING,
number=1,
)
gerrit_project = proto.Field(
proto.STRING,
number=2,
)
revision_id = proto.Field(
proto.STRING,
number=3,
oneof="revision",
)
alias_name = proto.Field(
proto.STRING,
number=4,
oneof="revision",
)
alias_context = proto.Field(
proto.MESSAGE, number=5, oneof="revision", message="AliasContext",
proto.MESSAGE,
number=5,
oneof="revision",
message="AliasContext",
)


Expand All @@ -223,8 +289,14 @@ class GitSourceContext(proto.Message):
required.
"""

url = proto.Field(proto.STRING, number=1,)
revision_id = proto.Field(proto.STRING, number=2,)
url = proto.Field(
proto.STRING,
number=1,
)
revision_id = proto.Field(
proto.STRING,
number=2,
)


class RepoId(proto.Message):
Expand All @@ -251,9 +323,16 @@ class RepoId(proto.Message):
"""

project_repo_id = proto.Field(
proto.MESSAGE, number=1, oneof="id", message="ProjectRepoId",
proto.MESSAGE,
number=1,
oneof="id",
message="ProjectRepoId",
)
uid = proto.Field(
proto.STRING,
number=2,
oneof="id",
)
uid = proto.Field(proto.STRING, number=2, oneof="id",)


class ProjectRepoId(proto.Message):
Expand All @@ -268,8 +347,14 @@ class ProjectRepoId(proto.Message):
default repo.
"""

project_id = proto.Field(proto.STRING, number=1,)
repo_name = proto.Field(proto.STRING, number=2,)
project_id = proto.Field(
proto.STRING,
number=1,
)
repo_name = proto.Field(
proto.STRING,
number=2,
)


class CloudWorkspaceId(proto.Message):
Expand All @@ -286,8 +371,15 @@ class CloudWorkspaceId(proto.Message):
the Source API's CreateWorkspace method.
"""

repo_id = proto.Field(proto.MESSAGE, number=1, message="RepoId",)
name = proto.Field(proto.STRING, number=2,)
repo_id = proto.Field(
proto.MESSAGE,
number=1,
message="RepoId",
)
name = proto.Field(
proto.STRING,
number=2,
)


__all__ = tuple(sorted(__protobuf__.manifest))
9 changes: 6 additions & 3 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import nox


BLACK_VERSION = "black==19.10b0"
BLACK_VERSION = "black==22.3.0"
BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]

DEFAULT_PYTHON_VERSION = "3.8"
Expand Down Expand Up @@ -57,7 +57,9 @@ def lint(session):
"""
session.install("flake8", BLACK_VERSION)
session.run(
"black", "--check", *BLACK_PATHS,
"black",
"--check",
*BLACK_PATHS,
)
session.run("flake8", "google", "tests")

Expand All @@ -67,7 +69,8 @@ def blacken(session):
"""Run black. Format code to uniform standard."""
session.install(BLACK_VERSION)
session.run(
"black", *BLACK_PATHS,
"black",
*BLACK_PATHS,
)


Expand Down