Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit d27e699

Browse files
committed
nox -s blacken
1 parent 185fc03 commit d27e699

File tree

83 files changed

+1647
-601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1647
-601
lines changed

docs/conf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232
# Replace |version| in the docs with the actual version string.
3333
rst_epilog = """
3434
.. |version| replace:: {version}
35-
""".format(
36-
version=version
37-
)
35+
""".format(version=version)
3836

3937
# -- General configuration ---------------------------------------------------
4038

gapic/cli/generate.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import typing
1818

1919
import click
20-
2120
from google.protobuf.compiler import plugin_pb2
2221

2322
from gapic import generator
@@ -38,7 +37,7 @@
3837
"--output",
3938
type=click.File("wb"),
4039
default=sys.stdout.buffer,
41-
help="Where to output the `CodeGeneratorResponse`. " "Defaults to stdout.",
40+
help="Where to output the `CodeGeneratorResponse`. Defaults to stdout.",
4241
)
4342
def generate(request: typing.BinaryIO, output: typing.BinaryIO) -> None:
4443
"""Generate a full API client description."""

gapic/configurable_snippetgen/configured_snippet.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
import inflection
1919
import libcst
2020

21-
from gapic.configurable_snippetgen import libcst_utils
22-
from gapic.configurable_snippetgen import snippet_config_language_pb2
21+
from gapic.configurable_snippetgen import libcst_utils, snippet_config_language_pb2
2322
from gapic.schema import api
2423

2524

gapic/configurable_snippetgen/snippet_config_language_pb2.py

Lines changed: 10 additions & 7 deletions
Large diffs are not rendered by default.

gapic/configurable_snippetgen/snippet_config_language_pb2.pyi

Lines changed: 1193 additions & 158 deletions
Large diffs are not rendered by default.

gapic/generator/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@
2020

2121
from .generator import Generator
2222

23-
2423
__all__ = ("Generator",)

gapic/generator/generator.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,31 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import jinja2
16-
import yaml
1715
import itertools
18-
import re
1916
import os
2017
import pathlib
18+
import re
2119
import typing
22-
from typing import Any, DefaultDict, Dict, Mapping, Optional, Tuple
23-
from hashlib import sha256
2420
from collections import OrderedDict, defaultdict
21+
from hashlib import sha256
22+
from typing import Any, DefaultDict, Dict, Mapping, Optional, Tuple
23+
24+
import jinja2
25+
import yaml
26+
from google.protobuf.compiler.plugin_pb2 import CodeGeneratorResponse
27+
28+
from gapic import utils
29+
from gapic.generator import formatter
30+
from gapic.samplegen import manifest, samplegen
31+
from gapic.samplegen_utils import snippet_index, snippet_metadata_pb2
32+
from gapic.samplegen_utils.types import DuplicateSample
2533
from gapic.samplegen_utils.utils import (
2634
coerce_response_name,
2735
is_valid_sample_cfg,
2836
render_format_string,
2937
)
30-
from gapic.samplegen_utils.types import DuplicateSample
31-
from gapic.samplegen_utils import snippet_index, snippet_metadata_pb2
32-
from gapic.samplegen import manifest, samplegen
33-
from gapic.generator import formatter
3438
from gapic.schema import api
35-
from gapic import utils
3639
from gapic.utils import Options
37-
from google.protobuf.compiler.plugin_pb2 import CodeGeneratorResponse
3840

3941

4042
class Generator:
@@ -131,9 +133,7 @@ def get_response(self, api_schema: api.API, opts: Options) -> CodeGeneratorRespo
131133
)
132134

133135
# Return the CodeGeneratorResponse output.
134-
res = CodeGeneratorResponse(
135-
file=[i for i in output_files.values()]
136-
) # type: ignore
136+
res = CodeGeneratorResponse(file=[i for i in output_files.values()]) # type: ignore
137137
res.supported_features |= CodeGeneratorResponse.Feature.FEATURE_PROTO3_OPTIONAL # type: ignore
138138
return res
139139

gapic/samplegen/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from gapic.samplegen import samplegen
16-
from gapic.samplegen import manifest
15+
from gapic.samplegen import manifest, samplegen
1716

1817
__all__ = (
1918
"manifest",

gapic/samplegen/samplegen.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,13 @@
1414

1515
import dataclasses
1616
import itertools
17-
import jinja2
1817
import json
1918
import keyword
2019
import os
2120
import re
2221
import time
23-
import yaml
24-
25-
from gapic import utils
26-
27-
from gapic.samplegen_utils import types, snippet_metadata_pb2 # type: ignore
28-
from gapic.samplegen_utils.utils import is_valid_sample_cfg
29-
from gapic.schema import api
30-
from gapic.schema import wrappers
31-
32-
from collections import defaultdict, namedtuple, ChainMap as chainmap
22+
from collections import ChainMap as chainmap
23+
from collections import defaultdict, namedtuple
3324
from typing import (
3425
Any,
3526
ChainMap,
@@ -43,10 +34,18 @@
4334
Tuple,
4435
)
4536

37+
import jinja2
38+
import yaml
39+
4640
# There is no library stub file for this module, so ignore it.
4741
from google.api import resource_pb2 # type: ignore
4842
from google.protobuf import descriptor_pb2
4943

44+
from gapic import utils
45+
from gapic.samplegen_utils import snippet_metadata_pb2, types # type: ignore
46+
from gapic.samplegen_utils.utils import is_valid_sample_cfg
47+
from gapic.schema import api, wrappers
48+
5049
# Outstanding issues:
5150
# * In real sample configs, many variables are
5251
# defined with an _implicit_ $resp variable.

gapic/samplegen_utils/snippet_index.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
# limitations under the License.
1414

1515
import re
16-
from typing import Optional, Dict
16+
from typing import Dict, Optional
1717

1818
from google.protobuf import json_format
1919

20+
from gapic.samplegen_utils import (
21+
snippet_metadata_pb2, # type: ignore
22+
types,
23+
)
2024
from gapic.schema import api, metadata
21-
from gapic.samplegen_utils import snippet_metadata_pb2 # type: ignore
22-
from gapic.samplegen_utils import types
23-
2425

2526
CLIENT_INIT_RE = re.compile(r"^\s+# Create a client")
2627
REQUEST_INIT_RE = re.compile(r"^\s+# Initialize request argument\(s\)")
@@ -117,7 +118,9 @@ def __init__(self, api_schema: api.API):
117118
self.metadata_index.client_library.name = (
118119
api_schema.naming.warehouse_package_name
119120
)
120-
self.metadata_index.client_library.language = snippet_metadata_pb2.Language.PYTHON # type: ignore
121+
self.metadata_index.client_library.language = (
122+
snippet_metadata_pb2.Language.PYTHON
123+
) # type: ignore
121124

122125
self.metadata_index.client_library.version = api_schema.gapic_version
123126

0 commit comments

Comments
 (0)