8000 chore: [autoapprove] Update `black` and `isort` to latest versions (#… · googleapis/python-logging@38106f3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 38106f3

Browse files
chore: [autoapprove] Update black and isort to latest versions (#795)
Source-Link: googleapis/synthtool@0c7b033 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:08e34975760f002746b1d8c86fdc90660be45945ee6d9db914d1508acdf9a547 Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 0656474 commit 38106f3

19 files changed

+33
-59
lines changed

.github/.OwlBot.lock.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
# limitations under the License.
1414
docker:
1515
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
16-
digest: sha256:fac304457974bb530cc5396abd4ab25d26a469cd3bc97cbfb18c8d4324c584eb
17-
# created: 2023-10-02T21:31:03.517640371Z
16+
digest: sha256:08e34975760f002746b1d8c86fdc90660be45945ee6d9db914d1508acdf9a547
17+
# created: 2023-10-09T14:06:13.397766266Z

.kokoro/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,9 @@ typing-extensions==4.4.0 \
467467
--hash=sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa \
468468
--hash=sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e
469469
# via -r requirements.in
470-
urllib3==1.26.12 \
471-
--hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \
472-
--hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997
470+
urllib3==1.26.17 \
471+
--hash=sha256:24d6a242c28d29af46c3fae832c36db3bbebcc533dd1bb549172cd739c82df21 \
472+
--hash=sha256:94a757d178c9be92ef5539b8840d48dc9cf1b2709c9d6b588232a055c524458b
473473
# via
474474
# requests
475475
# twine

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repos:
2222
- id: end-of-file-fixer
2323
- id: check-yaml
2424
- repo: https://github.com/psf/black
25-
rev: 22.3.0
25+
rev: 23.7.0
2626
hooks:
2727
- id: black
2828
- repo: https://github.com/pycqa/flake8

google/cloud/logging_v2/_http.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727

2828
class Connection(_http.JSONConnection):
29-
3029
DEFAULT_API_ENDPOINT = "https://logging.googleapis.com"
3130

3231
def __init__(self, client, *, client_info=None, api_endpoint=DEFAULT_API_ENDPOINT):

google/cloud/logging_v2/handlers/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def _infer_source_location(record):
7070
("function", "funcName"),
7171
]
7272
output = {}
73-
for (gcp_name, std_lib_name) in name_map:
73+
for gcp_name, std_lib_name in name_map:
7474
value = getattr(record, std_lib_name, None)
7575
if value is not None:
7676
output[gcp_name] = value

noxfile.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,55 +17,57 @@
1717
# Generated by synthtool. DO NOT EDIT!
1818

1919
from __future__ import absolute_import
20+
2021
import os
2122
import pathlib
2223
import re
2324
import shutil
25+
from typing import Dict, List
2426
import warnings
2527

2628
import nox
2729

2830
FLAKE8_VERSION = "flake8==6.1.0"
29-
BLACK_VERSION = "black==22.3.0"
30-
ISORT_VERSION = "isort==5.10.1"
31+
BLACK_VERSION = "black[jupyter]==23.7.0"
32+
ISORT_VERSION = "isort==5.11.0"
3133
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]
3234

3335
DEFAULT_PYTHON_VERSION = "3.8"
3436

35-
UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
37+
UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"]
3638
UNIT_TEST_STANDARD_DEPENDENCIES = [
3739
"mock",
3840
"asyncmock",
3941
"pytest",
4042
"pytest-cov",
4143
"pytest-asyncio",
4244
]
43-
UNIT_TEST_EXTERNAL_DEPENDENCIES = [
45+
UNIT_TEST_EXTERNAL_DEPENDENCIES: List[str] = [
4446
"flask",
4547
"webob",
4648
"django",
4749
]
48-
UNIT_TEST_LOCAL_DEPENDENCIES = []
49-
UNIT_TEST_DEPENDENCIES = []
50-
UNIT_TEST_EXTRAS = []
51-
UNIT_TEST_EXTRAS_BY_PYTHON = {}
50+
UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = []
51+
UNIT_TEST_DEPENDENCIES: List[str] = []
52+
UNIT_TEST_EXTRAS: List[str] = []
53+
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
5254

53-
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"]
54-
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
55+
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8"]
56+
SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [
5557
"mock",
5658
"pytest",
5759
"google-cloud-testutils",
5860
]
59-
SYSTEM_TEST_EXTERNAL_DEPENDENCIES = [
61+
SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = [
6062
"google-cloud-bigquery",
6163
"google-cloud-pubsub",
6264
"google-cloud-storage",
6365
"google-cloud-testutils",
6466
]
65-
SYSTEM_TEST_LOCAL_DEPENDENCIES = []
66-
SYSTEM_TEST_DEPENDENCIES = []
67-
SYSTEM_TEST_EXTRAS = []
68-
SYSTEM_TEST_EXTRAS_BY_PYTHON = {}
67+
SYSTEM_TEST_LOCAL_DEPENDENCIES: List[str] = []
68+
SYSTEM_TEST_DEPENDENCIES: List[str] = []
69+
SYSTEM_TEST_EXTRAS: List[str] = []
70+
SYSTEM_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}
6971

7072
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
7173

@@ -78,6 +80,7 @@
7880
"lint_setup_py",
7981
"blacken",
8082
"docs",
83+
"format",
8184
]
8285

8386
# Error if a python version is missing
@@ -196,7 +199,6 @@ def unit(session):
196199

197200

198201
def install_systemtest_dependencies(session, *constraints):
199-
200202
# Use pre-release gRPC for system tests.
201203
# Exclude version 1.52.0rc1 which has a known issue.
202204
# See https://github.com/grpc/grpc/issues/32163

tests/system/test_system.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ def setUpModule():
118118

119119

120120
class TestLogging(unittest.TestCase):
121-
122121
JSON_PAYLOAD = {
123122
"message": "System test: test_log_struct",
124123
"weather": {

tests/unit/handlers/test__monitored_resources.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545

4646

4747
class Test_Create_Resources(unittest.TestCase):
48-
4948
PROJECT = "test-project"
5049
LOCATION = "test-location"
5150
NAME = "test-name"
@@ -135,7 +134,6 @@ def test_functions_resource_no_name(self):
135134
self.assertEqual(func_resource.labels["function_name"], "")
136135

137136
def test_create_kubernetes_resource(self):
138-
139137
patch = mock.patch(
140138
"google.cloud.logging_v2.handlers._monitored_resources.retrieve_metadata_server",
141139
wraps=self._mock_metadata,
@@ -246,7 +244,6 @@ def test_with_no_project_from_server(self):
246244

247245

248246
class Test_Resource_Detection(unittest.TestCase):
249-
250247
PROJECT = "test-project"
251248

252249
def _mock_k8s_metadata(self, endpoint):

tests/unit/handlers/test_handlers.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626

2727
class TestCloudLoggingFilter(unittest.TestCase):
28-
2928
PROJECT = "PROJECT"
3029

3130
@staticmethod
@@ -291,7 +290,6 @@ def test_user_overrides(self):
291290

292291

293292
class TestCloudLoggingHandler(unittest.TestCase):
294-
295293
PROJECT = "PROJECT"
296294

297295
@staticmethod
@@ -859,7 +857,7 @@ def test_json_fields_input_unmodified(self):
859857
_format_and_parse_message(record, handler)
860858
# ensure json_fields has no side-effects
861859
self.assertEqual(set(json_fields.keys()), set(json_fields_orig.keys()))
862-
for (key, value) in json_fields_orig.items():
860+
for key, value in json_fields_orig.items():
863861
self.assertEqual(
864862
value, json_fields[key], f"expected_payload[{key}] != result[{key}]"
865863
)

tests/unit/handlers/test_structured_log.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def test_format(self):
8686
}
8787
handler.filter(record)
8888
result = json.loads(handler.format(record))
89-
for (key, value) in expected_payload.items():
89+
for key, value in expected_payload.items():
9090
self.assertEqual(value, result[key])
9191
self.assertEqual(
9292
len(expected_payload.keys()),
@@ -121,7 +121,7 @@ def test_format_minimal(self):
121121
handler.filter(record)
122122
result = json.loads(handler.format(record))
123123
self.assertEqual(set(expected_payload.keys()), set(result.keys()))
124-
for (key, value) in expected_payload.items():
124+
for key, value in expected_payload.items():
125125
self.assertEqual(
126126
value, result[key], f"expected_payload[{key}] != result[{key}]"
127127
)
@@ -304,7 +304,7 @@ def test_format_with_reserved_json_field(self):
304304
handler.filter(record)
305305
result = json.loads(handler.format(record))
306306
self.assertEqual(set(expected_payload.keys()), set(result.keys()))
307-
for (key, value) in expected_payload.items():
307+
for key, value in expected_payload.items():
308308
self.assertEqual(
309309
value, result[key], f"expected_payload[{key}] != result[{key}]"
310310
)
@@ -417,7 +417,7 @@ def test_format_with_request(self):
417417
):
418418
handler.filter(record)
419419
result = json.loads(handler.format(record))
420-
for (key, value) in expected_payload.items():
420+
for key, value in expected_payload.items():
421421
self.assertEqual(value, result[key])
422422

423423
def test_format_with_traceparent(self):
@@ -452,7 +452,7 @@ def test_format_with_traceparent(self):
452452
):
453453
handler.filter(record)
454454
result = json.loads(handler.format(record))
455-
for (key, value) in expected_payload.items():
455+
for key, value in expected_payload.items():
456456
self.assertEqual(value, result[key])
457457

458458
def test_format_overrides(self):
@@ -509,7 +509,7 @@ def test_format_overrides(self):
509509
)
510510
handler.filter(record)
511511
result = json.loads(handler.format(record))
512-
for (key, value) in expected_payload.items():
512+
for key, value in expected_payload.items():
513513
self.assertEqual(value, result[key])
514514

515515
def test_format_with_json_fields(self):
@@ -590,7 +590,7 @@ def test_json_fields_input_unmodified(self):
590590
handler.format(record)
591591
# ensure json_fields has no side-effects
592592
self.assertEqual(set(json_fields.keys()), set(json_fields_orig.keys()))
593-
for (key, value) in json_fields_orig.items():
593+
for key, value in json_fields_orig.items():
594594
self.assertEqual(
595595
value, json_fields[key], f"expected_payload[{key}] != result[{key}]"
596596
)

0 commit comments

Comments
 (0)
0