Skip to content

Commit c5b0098

Browse files
dependabot-preview[bot]untitakersentry-bot
authored
build(deps): bump black from 19.10b0 to 20.8b1 (#801)
* build(deps): bump black from 19.10b0 to 20.8b1 Bumps [black](https://github.com/psf/black) from 19.10b0 to 20.8b1. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/master/CHANGES.md) - [Commits](https://github.com/psf/black/commits) Signed-off-by: dependabot-preview[bot] <[email protected]> * add black action * always run black action, its a python-only project * attempt push * fix: Formatting Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Markus Unterwaditzer <[email protected]> Co-authored-by: sentry-bot <[email protected]>
1 parent 7afdded commit c5b0098

File tree

15 files changed

+109
-56
lines changed

15 files changed

+109
-56
lines changed

.github/workflows/black.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: black
2+
3+
on: push
4+
5+
jobs:
6+
format:
7+
runs-on: ubuntu-16.04
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-python@v2
11+
with:
12+
python-version: '3.x'
13+
14+
- name: Install Black
15+
run: pip install -r linter-requirements.txt
16+
17+
- name: Run Black
18+
run: black tests examples sentry_sdk
19+
20+
- name: Commit changes
21+
run: |
22+
git config --global user.name 'sentry-bot'
23+
git config --global user.email '[email protected]'
24+
git commit -am "fix: Formatting"
25+
git push

linter-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
black==19.10b0
1+
black==20.8b1
22
flake8==3.8.3
33
flake8-import-order==0.18.1
44
mypy==0.782

sentry_sdk/_functools.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ def update_wrapper(
2828
# type: (Any, Any, Any, Any) -> Any
2929
"""Update a wrapper function to look like the wrapped function
3030
31-
wrapper is the function to be updated
32-
wrapped is the original function
33-
assigned is a tuple naming the attributes assigned directly
34-
from the wrapped function to the wrapper function (defaults to
35-
functools.WRAPPER_ASSIGNMENTS)
36-
updated is a tuple naming the attributes of the wrapper that
37-
are updated with the corresponding attribute from the wrapped
38-
function (defaults to functools.WRAPPER_UPDATES)
31+
wrapper is the function to be updated
32+
wrapped is the original function
33+
assigned is a tuple naming the attributes assigned directly
34+
from the wrapped function to the wrapper function (defaults to
35+
functools.WRAPPER_ASSIGNMENTS)
36+
updated is a tuple naming the attributes of the wrapper that
37+
are updated with the corresponding attribute from the wrapped
38+
function (defaults to functools.WRAPPER_UPDATES)
3939
"""
4040
for attr in assigned:
4141
try:
@@ -57,10 +57,10 @@ def wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES):
5757
# type: (Callable[..., Any], Any, Any) -> Callable[[Callable[..., Any]], Callable[..., Any]]
5858
"""Decorator factory to apply update_wrapper() to a wrapper function
5959
60-
Returns a decorator that invokes update_wrapper() with the decorated
61-
function as the wrapper argument and the arguments to wraps() as the
62-
remaining arguments. Default arguments are as for update_wrapper().
63-
This is a convenience function to simplify applying partial() to
64-
update_wrapper().
60+
Returns a decorator that invokes update_wrapper() with the decorated
61+
function as the wrapper argument and the arguments to wraps() as the
62+
remaining arguments. Default arguments are as for update_wrapper().
63+
This is a convenience function to simplify applying partial() to
64+
update_wrapper().
6565
"""
6666
return partial(update_wrapper, wrapped=wrapped, assigned=assigned, updated=updated)

sentry_sdk/hub.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,7 @@ def capture_event(
315315
**scope_args # type: Dict[str, Any]
316316
):
317317
# type: (...) -> Optional[str]
318-
"""Captures an event. Alias of :py:meth:`sentry_sdk.Client.capture_event`.
319-
"""
318+
"""Captures an event. Alias of :py:meth:`sentry_sdk.Client.capture_event`."""
320319
client, top_scope = self._stack[-1]
321320
scope = _update_scope(top_scope, scope, scope_args)
322321
if client is not None:

sentry_sdk/integrations/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ def _generate_default_integrations_iterator(integrations, auto_enabling_integrat
2727

2828
def iter_default_integrations(with_auto_enabling_integrations):
2929
# type: (bool) -> Iterator[Type[Integration]]
30-
"""Returns an iterator of the default integration classes:
31-
"""
30+
"""Returns an iterator of the default integration classes:"""
3231
from importlib import import_module
3332

3433
if with_auto_enabling_integrations:

sentry_sdk/integrations/asgi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ async def _run_app(self, scope, callback):
124124

125125
if ty in ("http", "websocket"):
126126
transaction = Transaction.continue_from_headers(
127-
dict(scope["headers"]), op="{}.server".format(ty),
127+
dict(scope["headers"]),
128+
op="{}.server".format(ty),
128129
)
129130
else:
130131
transaction = Transaction(op="asgi.server")

sentry_sdk/integrations/aws_lambda.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,15 @@ def inner(*args, **kwargs):
227227

228228
return inner # type: ignore
229229

230-
lambda_bootstrap.LambdaRuntimeClient.post_invocation_result = _wrap_post_function(
231-
lambda_bootstrap.LambdaRuntimeClient.post_invocation_result
230+
lambda_bootstrap.LambdaRuntimeClient.post_invocation_result = (
231+
_wrap_post_function(
232+
lambda_bootstrap.LambdaRuntimeClient.post_invocation_result
233+
)
232234
)
233-
lambda_bootstrap.LambdaRuntimeClient.post_invocation_error = _wrap_post_function(
234-
lambda_bootstrap.LambdaRuntimeClient.post_invocation_error
235+
lambda_bootstrap.LambdaRuntimeClient.post_invocation_error = (
236+
_wrap_post_function(
237+
lambda_bootstrap.LambdaRuntimeClient.post_invocation_error
238+
)
235239
)
236240

237241

sentry_sdk/integrations/excepthook.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
from types import TracebackType
1515

1616
Excepthook = Callable[
17-
[Type[BaseException], BaseException, TracebackType], Any,
17+
[Type[BaseException], BaseException, TracebackType],
18+
Any,
1819
]
1920

2021

sentry_sdk/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ class ServerlessTimeoutWarning(Exception):
883883

884884
class TimeoutThread(threading.Thread):
885885
"""Creates a Thread which runs (sleeps) for a time duration equal to
886-
waiting_time and raises a custom ServerlessTimeout exception.
886+
waiting_time and raises a custom ServerlessTimeout exception.
887887
"""
888888

889889
def __init__(self, waiting_time, configured_timeout):

tests/integrations/flask/test_flask.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,9 @@ def test_flask_session_tracking(sentry_init, capture_envelopes, app):
247247
sentry_init(
248248
integrations=[flask_sentry.FlaskIntegration()],
249249
release="demo-release",
250-
_experiments=dict(auto_session_tracking=True,),
250+
_experiments=dict(
251+
auto_session_tracking=True,
252+
),
251253
)
252254

253255
@app.route("/")

tests/integrations/gcp/test_gcp.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,10 @@ def inner(code, timeout="10s", subprocess_kwargs=()):
204204
function_call_response = api_request.execute()
205205

206206
# STEP : Fetch logs of invoked function
207-
log_name = "projects/{}/logs/cloudfunctions.googleapis.com%2Fcloud-functions".format(
208-
project_id
207+
log_name = (
208+
"projects/{}/logs/cloudfunctions.googleapis.com%2Fcloud-functions".format(
209+
project_id
210+
)
209211
)
210212
project_name = "projects/{}".format(project_id)
211213
body = {"resourceNames": [project_name], "filter": log_name}

tests/integrations/logging/test_logging.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ def test_logging_stack(sentry_init, capture_events):
8080
logger.error("first", exc_info=True)
8181
logger.error("second")
8282

83-
event_with, event_without, = events
83+
(
84+
event_with,
85+
event_without,
86+
) = events
8487

8588
assert event_with["level"] == "error"
8689
assert event_with["threads"]["values"][0]["stacktrace"]["frames"]

tests/integrations/stdlib/test_subprocess.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ def test_subprocess_basic(
118118

119119
capture_message("hi")
120120

121-
transaction_event, message_event, = events
121+
(
122+
transaction_event,
123+
message_event,
124+
) = events
122125

123126
assert message_event["message"] == "hi"
124127

tests/test_transport.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ def test_complex_limits_without_data_category(
168168
dict(dsn="http://foobar@{}/123".format(httpserver.url[len("http://") :]))
169169
)
170170
httpserver.serve_content(
171-
"hm", response_code, headers={"X-Sentry-Rate-Limits": "4711::organization"},
171+
"hm",
172+
response_code,
173+
headers={"X-Sentry-Rate-Limits": "4711::organization"},
172174
)
173175

174176
client.capture_event({"type": "transaction"})

tests/utils/test_general.py

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -128,32 +128,44 @@ def test_parse_invalid_dsn(dsn):
128128

129129
@pytest.mark.parametrize("empty", [None, []])
130130
def test_in_app(empty):
131-
assert handle_in_app_impl(
132-
[{"module": "foo"}, {"module": "bar"}],
133-
in_app_include=["foo"],
134-
in_app_exclude=empty,
135-
) == [{"module": "foo", "in_app": True}, {"module": "bar"}]
136-
137-
assert handle_in_app_impl(
138-
[{"module": "foo"}, {"module": "bar"}],
139-
in_app_include=["foo"],
140-
in_app_exclude=["foo"],
141-
) == [{"module": "foo", "in_app": True}, {"module": "bar"}]
142-
143-
assert handle_in_app_impl(
144-
[{"module": "foo"}, {"module": "bar"}],
145-
in_app_include=empty,
146-
in_app_exclude=["foo"],
147-
) == [{"module": "foo", "in_app": False}, {"module": "bar", "in_app": True}]
131+
assert (
132+
handle_in_app_impl(
133+
[{"module": "foo"}, {"module": "bar"}],
134+
in_app_include=["foo"],
135+
in_app_exclude=empty,
136+
)
137+
== [{"module": "foo", "in_app": True}, {"module": "bar"}]
138+
)
139+
140+
assert (
141+
handle_in_app_impl(
142+
[{"module": "foo"}, {"module": "bar"}],
143+
in_app_include=["foo"],
144+
in_app_exclude=["foo"],
145+
)
146+
== [{"module": "foo", "in_app": True}, {"module": "bar"}]
147+
)
148+
149+
assert (
150+
handle_in_app_impl(
151+
[{"module": "foo"}, {"module": "bar"}],
152+
in_app_include=empty,
153+
in_app_exclude=["foo"],
154+
)
155+
== [{"module": "foo", "in_app": False}, {"module": "bar", "in_app": True}]
156+
)
148157

149158

150159
def test_iter_stacktraces():
151-
assert set(
152-
iter_event_stacktraces(
153-
{
154-
"threads": {"values": [{"stacktrace": 1}]},
155-
"stacktrace": 2,
156-
"exception": {"values": [{"stacktrace": 3}]},
157-
}
160+
assert (
161+
set(
162+
iter_event_stacktraces(
163+
{
164+
"threads": {"values": [{"stacktrace": 1}]},
165+
"stacktrace": 2,
166+
"exception": {"values": [{"stacktrace": 3}]},
167+
}
168+
)
158169
)
159-
) == {1, 2, 3}
170+
== {1, 2, 3}
171+
)

0 commit comments

Comments
 (0)