Skip to content

Commit

Permalink
chore(python): use black==22.3.0 (#70)
Browse files Browse the repository at this point in the history
Source-Link: googleapis/synthtool@6fab84a
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe
  • Loading branch information
gcf-owl-bot[bot] authored Mar 29, 2022
1 parent e2655cd commit 77579a1
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 32 deletions.
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 packages/google-cloud-source-context/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
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 packages/google-cloud-source-context/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

0 comments on commit 77579a1

Please sign in to comment.