Skip to content

Commit 3137c1f

Browse files
authored
Upgrade black (#802)
1 parent f4d09f9 commit 3137c1f

File tree

70 files changed

+352
-147
lines changed

Some content is hidden

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

70 files changed

+352
-147
lines changed

.python-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pylint<2.10
22
flake8~=3.7
33
isort~=5.6
4-
black>=19.3b0,==19.*
4+
black>=21.10b0
55
httpretty~=1.0
66
mypy==0.790
77
sphinx

docs/conf.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,22 @@ def getlistcfg(strval):
129129
if "class_references" in mcfg:
130130
class_references = getlistcfg(mcfg["class_references"])
131131
for class_reference in class_references:
132-
nitpick_ignore.append(("py:class", class_reference,))
132+
nitpick_ignore.append(
133+
(
134+
"py:class",
135+
class_reference,
136+
)
137+
)
133138

134139
if "anys" in mcfg:
135140
anys = getlistcfg(mcfg["anys"])
136141
for _any in anys:
137-
nitpick_ignore.append(("any", _any,))
142+
nitpick_ignore.append(
143+
(
144+
"any",
145+
_any,
146+
)
147+
)
138148

139149
# Add any paths that contain templates here, relative to this directory.
140150
templates_path = ["_templates"]

exporter/opentelemetry-exporter-datadog/src/opentelemetry/exporter/datadog/propagator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ def inject(
9696
return
9797
sampled = (trace.TraceFlags.SAMPLED & span.context.trace_flags) != 0
9898
setter.set(
99-
carrier, self.TRACE_ID_KEY, format_trace_id(span.context.trace_id),
99+
carrier,
100+
self.TRACE_ID_KEY,
101+
format_trace_id(span.context.trace_id),
100102
)
101103
setter.set(
102104
carrier, self.PARENT_ID_KEY, format_span_id(span.context.span_id)

exporter/opentelemetry-exporter-datadog/tests/test_datadog_exporter.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ def test_constructor_explicit(self):
7878
"""Test the constructor passing all the options."""
7979
agent_url = "http://localhost:8126"
8080
exporter = datadog.DatadogSpanExporter(
81-
agent_url=agent_url, service="explicit",
81+
agent_url=agent_url,
82+
service="explicit",
8283
)
8384

8485
self.assertEqual(exporter.agent_url, agent_url)
@@ -472,7 +473,8 @@ def test_span_processor_dropped_spans(self):
472473
tracer_provider.shutdown()
473474

474475
@mark.skipif(
475-
sys.platform == "win32", reason="unreliable test on windows",
476+
sys.platform == "win32",
477+
reason="unreliable test on windows",
476478
)
477479
def test_span_processor_scheduled_delay(self):
478480
"""Test that spans are exported each schedule_delay_millis"""

exporter/opentelemetry-exporter-richconsole/src/opentelemetry/exporter/richconsole/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ class RichConsoleSpanExporter(SpanExporter):
132132
"""
133133

134134
def __init__(
135-
self, service_name: Optional[str] = None,
135+
self,
136+
service_name: Optional[str] = None,
136137
):
137138
self.service_name = service_name
138139
self.console = Console()

instrumentation/opentelemetry-instrumentation-aiohttp-client/src/opentelemetry/instrumentation/aiohttp_client/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ async def on_request_start(
201201
request_span_name = f"HTTP {http_method}"
202202

203203
trace_config_ctx.span = trace_config_ctx.tracer.start_span(
204-
request_span_name, kind=SpanKind.CLIENT,
204+
request_span_name,
205+
kind=SpanKind.CLIENT,
205206
)
206207

207208
if callable(request_hook):

instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ def test_status_codes(self):
116116
(HTTPStatus.OK, StatusCode.UNSET),
117117
(HTTPStatus.TEMPORARY_REDIRECT, StatusCode.UNSET),
118118
(HTTPStatus.SERVICE_UNAVAILABLE, StatusCode.ERROR),
119-
(HTTPStatus.GATEWAY_TIMEOUT, StatusCode.ERROR,),
119+
(
120+
HTTPStatus.GATEWAY_TIMEOUT,
121+
StatusCode.ERROR,
122+
),
120123
):
121124
with self.subTest(status_code=status_code):
122125
host, port = self._http_request(
@@ -178,7 +181,8 @@ def response_hook(
178181

179182
host, port = self._http_request(
180183
trace_config=aiohttp_client.create_trace_config(
181-
request_hook=request_hook, response_hook=response_hook,
184+
request_hook=request_hook,
185+
response_hook=response_hook,
182186
),
183187
method=method,
184188
url=path,

instrumentation/opentelemetry-instrumentation-aiopg/src/opentelemetry/instrumentation/aiopg/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def _instrument(self, **kwargs):
9191

9292
# pylint:disable=no-self-use
9393
def _uninstrument(self, **kwargs):
94-
""""Disable aiopg instrumentation"""
94+
""" "Disable aiopg instrumentation"""
9595
wrappers.unwrap_connect()
9696
wrappers.unwrap_create_pool()
9797

instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,8 @@ async def __call__(self, scope, receive, send):
299299

300300
try:
301301
with self.tracer.start_as_current_span(
302-
span_name, kind=trace.SpanKind.SERVER,
302+
span_name,
303+
kind=trace.SpanKind.SERVER,
303304
) as span:
304305
if span.is_recording():
305306
attributes = collect_request_attributes(scope)

0 commit comments

Comments
 (0)