8000 chore: [autoapprove] Update `black` and `isort` to latest versions by gcf-owl-bot[bot] · Pull Request #795 · googleapis/python-logging · GitHub
[go: up one dir, main page]

Skip to content

chore: [autoapprove] Update black and isort to latest versions #795

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
4 changes: 2 additions & 2 deletions .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
# limitations under the License.
docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:fac304457974bb530cc5396abd4ab25d26a469cd3bc97cbfb18c8d4324c584eb
# created: 2023-10-02T21:31:03.517640371Z
digest: sha256:08e34975760f002746b1d8c86fdc90660be45945ee6d9db914d1508acdf9a547
# created: 2023-10-09T14:06:13.397766266Z
6 changes: 3 additions & 3 deletions .kokoro/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,9 @@ typing-extensions==4.4.0 \
--hash=sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa \
--hash=sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e
# via -r requirements.in
urllib3==1.26.12 \
--hash=sha256:3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e \
--hash=sha256:b930dd878d5a8afb066a637fbb35144fe7901e3b209d1cd4f524bd0e9deee997
urllib3==1.26.17 \
--hash=sha256:24d6a242c28d29af46c3fae832c36db3bbebcc533dd1bb549172cd739c82df21 \
--hash=sha256:94a757d178c9be92ef5539b8840d48dc9cf1b2709c9d6b588232a055c524458b
# via
# requests
# twine
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
Expand Down
1 change: 0 additions & 1 deletion google/cloud/logging_v2/_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@


class Connection(_http.JSONConnection):

DEFAULT_API_ENDPOINT = "https://logging.googleapis.com"

def __init__(self, client, *, client_info=None, api_endpoint=DEFAULT_API_ENDPOINT):
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/logging_v2/handlers/handlers.py
E864
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _infer_source_location(record):
("function", "funcName"),
]
output = {}
for (gcp_name, std_lib_name) in name_map:
for gcp_name, std_lib_name in name_map:
value = getattr(record, std_lib_name, None)
if value is not None:
output[gcp_name] = value
Expand Down
34 changes: 18 additions & 16 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,55 +17,57 @@
# Generated by synthtool. DO NOT EDIT!

from __future__ import absolute_import

import os
import pathlib
import re
import shutil
from typing import Dict, List
import warnings

import nox

FLAKE8_VERSION = "flake8==6.1.0"
BLACK_VERSION = "black==22.3.0"
ISORT_VERSION = "isort==5.10.1"
BLACK_VERSION = "black[jupyter]==23.7.0"
ISORT_VERSION = "isort==5.11.0"
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]

DEFAULT_PYTHON_VERSION = "3.8"

UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11"]
UNIT_TEST_PYTHON_VERSIONS: List[str] = ["3.7", "3.8", "3.9", "3.10", "3.11"]
UNIT_TEST_STANDARD_DEPENDENCIES = [
"mock",
"asyncmock",
"pytest",
"pytest-cov",
"pytest-asyncio",
]
UNIT_TEST_EXTERNAL_DEPENDENCIES = [
UNIT_TEST_EXTERNAL_DEPENDENCIES: List[str] = [
"flask",
"webob",
"django",
]
UNIT_TEST_LOCAL_DEPENDENCIES = []
UNIT_TEST_DEPENDENCIES = []
UNIT_TEST_EXTRAS = []
UNIT_TEST_EXTRAS_BY_PYTHON = {}
UNIT_TEST_LOCAL_DEPENDENCIES: List[str] = []
UNIT_TEST_DEPENDENCIES: List[str] = []
UNIT_TEST_EXTRAS: List[str] = []
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}

SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"]
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.8"]
SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [
"mock",
"pytest",
"google-cloud-testutils",
]
SYSTEM_TEST_EXTERNAL_DEPENDENCIES = [
SYSTEM_TEST_EXTERNAL_DEPENDENCIES: List[str] = [
"google-cloud-bigquery",
"google-cloud-pubsub",
"google-cloud-storage",
"google-cloud-testutils",
]
SYSTEM_TEST_LOCAL_DEPENDENCIES = []
SYSTEM_TEST_DEPENDENCIES = []
SYSTEM_TEST_EXTRAS = []
SYSTEM_TEST_EXTRAS_BY_PYTHON = {}
SYSTEM_TEST_LOCAL_DEPENDENCIES: List[str] = []
SYSTEM_TEST_DEPENDENCIES: List[str] = []
SYSTEM_TEST_EXTRAS: List[str] = []
SYSTEM_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}

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

Expand All @@ -78,6 +80,7 @@
"lint_setup_py",
"blacken",
"docs",
"format",
]

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


def install_systemtest_dependencies(session, *constraints):

# Use pre-release gRPC for system tests.
# Exclude version 1.52.0rc1 which has a known issue.
# See https://github.com/grpc/grpc/issues/32163
Expand Down
1 change: 0 additions & 1 deletion tests/system/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ def setUpModule():


class TestLogging(unittest.TestCase):

JSON_PAYLOAD = {
"message": "System test: test_log_struct",
"weather": {
Expand Down
3 changes: 0 additions & 3 deletions tests/unit/handlers/test__monitored_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@


class Test_Create_Resources(unittest.TestCase):

PROJECT = "test-project"
LOCATION = "test-location"
NAME = "test-name"
Expand Down Expand Up @@ -135,7 +134,6 @@ def test_functions_resource_no_name(self):
self.assertEqual(func_resource.labels["function_name"], "")

def test_create_kubernetes_resource(self):

patch = mock.patch(
"google.cloud.logging_v2.handlers._monitored_resources.retrieve_metadata_server",
wraps=self._mock_metadata,
Expand Down Expand Up @@ -246,7 +244,6 @@ def test_with_no_project_from_server(self):


class Test_Resource_Detection(unittest.TestCase):

PROJECT = "test-project"

def _mock_k8s_metadata(self, endpoint):
Expand Down
4 changes: 1 addition & 3 deletions tests/unit/handlers/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@


class TestCloudLoggingFilter(unittest.TestCase):

PROJECT = "PROJECT"

@staticmethod
Expand Down Expand Up @@ -291,7 +290,6 @@ def test_user_overrides(self):


class TestCloudLoggingHandler(unittest.TestCase):

PROJECT = "PROJECT"

@staticmethod
Expand Down Expand Up @@ -859,7 +857,7 @@ def test_json_fields_input_unmodified(self):
_format_and_parse_message(record, handler)
# ensure json_fields has no side-effects
self.assertEqual(set(json_fields.keys()), set(json_fields_orig.keys()))
for (key, value) in json_fields_orig.items():
for key, value in json_fields_orig.items():
self.assertEqual(
value, json_fields[key], f"expected_payload[{key}] != result[{key}]"
)
Expand Down
14 changes: 7 additions & 7 deletions tests/unit/handlers/test_structured_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_format(self):
}
handler.filter(record)
result = json.loads(handler.format(record))
for (key, value) in expected_payload.items():
for key, value in expected_payload.items():
self.assertEqual(value, result[key])
self.assertEqual(
len(expected_payload.keys()),
Expand Down Expand Up @@ -121,7 +121,7 @@ def test_format_minimal(self):
handler.filter(record)
result = json.loads(handler.format(record))
self.assertEqual(set(expected_payload.keys()), set(result.keys()))
for (key, value) in expected_payload.items():
for key, value in expected_payload.items():
self.assertEqual(
value, result[key], f"expected_payload[{key}] != result[{key}]"
)
Expand Down Expand Up @@ -304,7 +304,7 @@ def test_format_with_reserved_json_field(self):
handler.filter(record)
result = json.loads(handler.format(record))
self.assertEqual(set(expected_payload.keys()), set(result.keys()))
for (key, value) in expected_payload.items():
for key, value in expected_payload.items():
self.assertEqual(
value, result[key], f"expected_payload[{key}] != result[{key}]"
)
Expand Down Expand Up @@ -417,7 +417,7 @@ def test_format_with_request(self):
):
handler.filter(record)
result = json.loads(handler.format(record))
for (key, value) in expected_payload.items():
for key, value in expected_payload.items():
self.assertEqual(value, result[key])

def test_format_with_traceparent(self):
Expand Down Expand Up @@ -452,7 +452,7 @@ def test_format_with_traceparent(self):
):
handler.filter(record)
result = json.loads(handler.format(record))
for (key, value) in expected_payload.items():
for key, value in expected_payload.items():
self.assertEqual(value, result[key])

def test_format_overrides(self):
Expand Down Expand Up @@ -509,7 +509,7 @@ def test_format_overrides(self):
)
handler.filter(record)
result = json.loads(handler.format(record))
for (key, value) in expected_payload.items():
for key, value in expected_payload.items():
self.assertEqual(value, result[key])

def test_format_with_json_fields(self):
Expand Down Expand Up @@ -590,7 +590,7 @@ def test_json_fields_input_unmodified(self):
handler.format(record)
# ensure json_fields has no side-effects
self.assertEqual(set(json_fields.keys()), set(json_fields_orig.keys()))
for (key, value) in json_fields_orig.items():
for key, value in json_fields_orig.items():
self.assertEqual(
value, json_fields[key], f"expected_payload[{key}] != result[{key}]"
)
Expand Down
1 change: 0 additions & 1 deletion tests/unit/handlers/transports/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


class TestBaseHandler(unittest.TestCase):

PROJECT = "PROJECT"

@staticmethod
Expand Down
1 change: 0 additions & 1 deletion tests/unit/handlers/transports/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@


class TestSyncHandler(unittest.TestCase):

PROJECT = "PROJECT"

@staticmethod
Expand Down
5 changes: 0 additions & 5 deletions tests/unit/test__http.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def _make_credentials():


class TestConnection(unittest.TestCase):

PROJECT = "project"
FILTER = "logName:syslog AND severity>=ERROR"

Expand Down Expand Up @@ -96,7 +95,6 @@ def test_extra_headers(self):


class Test_LoggingAPI(unittest.TestCase):

PROJECT = "project"
PROJECT_PATH = "projects/project"
LIST_ENTRIES_PATH = "entries:list"
Expand Down Expand Up @@ -354,7 +352,6 @@ def test_logger_delete(self):


class Test_SinksAPI(unittest.TestCase):

PROJECT = "project"
PROJECT_PATH = "projects/project"
FILTER = "logName:syslog AND severity>=ERROR"
Expand Down Expand Up @@ -636,7 +633,6 @@ def test_sink_delete_hit(self):


class Test_MetricsAPI(unittest.TestCase):

PROJECT = "project"
FILTER = "logName:syslog AND severity>=ERROR"
LIST_METRICS_PATH = "projects/%s/metrics" % (PROJECT,)
Expand Down Expand Up @@ -865,7 +861,6 @@ def test_metric_delete_hit(self):


class _Connection(object):

_called_with = None
_raise_conflict = False

Expand Down
1 change: 0 additions & 1 deletion tests/unit/test__instrumentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@


class TestInstrumentation(unittest.TestCase):

TEST_NAME = "python"
# LONG_NAME > 14 characters
LONG_NAME = TEST_NAME + "789ABCDEF"
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def _make_credentials():


class TestClient(unittest.TestCase):

PROJECT = "PROJECT"
PROJECT_PATH = f"projects/{PROJECT}"
LOGGER_NAME = "LOGGER_NAME"
Expand Down Expand Up @@ -903,7 +902,6 @@ def test_setup_logging_w_extra_kwargs(self):


class _Connection(object):

_called_with = None

def __init__(self, *responses):
Expand Down
4 changes: 0 additions & 4 deletions tests/unit/test_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def test_w_str(self):


class TestLogEntry(unittest.TestCase):

PROJECT = "PROJECT"
LOGGER_NAME = "LOGGER_NAME"

Expand Down Expand Up @@ -469,7 +468,6 @@ def test_to_api_repr_explicit(self):


class TestTextEntry(unittest.TestCase):

PROJECT = "PROJECT"
LOGGER_NAME = "LOGGER_NAME"

Expand Down Expand Up @@ -557,7 +555,6 @@ def test_to_api_repr_explicit(self):


class TestStructEntry(unittest.TestCase):

PROJECT = "PROJECT"
LOGGER_NAME = "LOGGER_NAME"

Expand Down Expand Up @@ -659,7 +656,6 @@ def test_to_api_repr_explicit(self):


class TestProtobufEntry(unittest.TestCase):

PROJECT = "PROJECT"
LOGGER_NAME = "LOGGER_NAME"

Expand Down
Loading
0