Skip to content
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 scripts/aws/aws-attach-layer-to-lambda-function.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ echo "Getting ARN of newest Sentry lambda layer..."
LAYER_ARN=$(aws lambda list-layer-versions --layer-name SentryPythonServerlessSDK-local-dev --query "LayerVersions[0].LayerVersionArn" | tr -d '"')
echo "Done getting ARN of newest Sentry lambda layer $LAYER_ARN."

echo "Attaching Lamba layer to function $FUNCTION_NAME..."
echo "Attaching Lambda layer to function $FUNCTION_NAME..."
echo "Warning: This remove all other layers!"
aws lambda update-function-configuration \
--function-name "$FUNCTION_NAME" \
--layers "$LAYER_ARN" \
--no-cli-pager
echo "Done attaching Lamba layer to function '$FUNCTION_NAME'."
echo "Done attaching Lambda layer to function '$FUNCTION_NAME'."

echo "All done. Have a nice day!"
2 changes: 1 addition & 1 deletion scripts/build_aws_lambda_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def install_python_packages(self) -> None:
"pip",
"install",
"--no-cache-dir", # always access PyPI
"--no-deps", # the right depencencies have been installed in the call above
"--no-deps", # the right dependencies have been installed in the call above
"--quiet",
sentry_python_sdk,
"--target",
Expand Down
4 changes: 2 additions & 2 deletions scripts/find_raise_from_none.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def main():
}

raise_from_none_count = {
file: len(occurences)
for file, occurences in RaiseFromNoneVisitor.line_numbers.items()
file: len(occurrences)
for file, occurrences in RaiseFromNoneVisitor.line_numbers.items()
}
if raise_from_none_count != ignored_raises:
exc = Exception("Detected unexpected raise ... from None.")
Expand Down
2 changes: 1 addition & 1 deletion scripts/populate_tox/populate_tox.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def fetch_package_dependencies(
print(f" Resolving dependencies: {package}=={version} on Python {python_version}")

# Removing non-report output with -qqq may be brittle, but avoids file I/O.
# Currently -qqq supresses all non-report output that would break json.loads().
# Currently -qqq suppresses all non-report output that would break json.loads().
result = subprocess.run(
[
"uv",
Expand Down
2 changes: 1 addition & 1 deletion scripts/split_tox_gh_actions/split_tox_gh_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
This way each group of frameworks defined in tox.ini will get its own GitHub actions configuration file
which allows them to be run in parallel in GitHub actions.

This will generate/update several configuration files, that need to be commited to Git afterwards.
This will generate/update several configuration files, that need to be committed to Git afterwards.
Whenever tox.ini is changed, this script needs to be run.

Usage:
Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ class _Client(BaseClient):
the client options as keyword arguments and optionally the DSN as first
argument.

Alias of :py:class:`sentry_sdk.Client`. (Was created for better intelisense support)
Alias of :py:class:`sentry_sdk.Client`. (Was created for better IntelliSense support)
"""

def __init__(self, *args: "Any", **kwargs: "Any") -> None:
Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/django/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ def install_sql_hook() -> None:
from django.db.backends.util import CursorWrapper

try:
# django 1.6 and 1.7 compatability
# django 1.6 and 1.7 compatibility
from django.db.backends import BaseDatabaseWrapper
except ImportError:
# django 1.8 or later
Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/django/signals_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def _get_receiver_name(receiver: "Callable[..., Any]") -> str:
name = receiver.__name__
elif hasattr(
receiver, "func"
): # certain functions (like partials) dont have a name
): # certain functions (like partials) don't have a name
if hasattr(receiver, "func") and hasattr(receiver.func, "__name__"):
name = "partial(<function " + receiver.func.__name__ + ">)"

Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/huggingface_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def new_huggingface_task(*args: "Any", **kwargs: "Any") -> "Any":
prompt = args[1]

if prompt is None:
# invalid call, dont instrument, let it return error
# invalid call, don't instrument, let it return error
return f(*args, **kwargs)

hf_client = args[0]
Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/openai_agents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class OpenAIAgentsIntegration(Integration):
- `DEFAULT_AGENT_RUNNER.run()` and `DEFAULT_AGENT_RUNNER.run_streamed()` are patched in `_patch_runner()` with `_create_run_wrapper()` and `_create_run_streamed_wrapper()`, respectively.
3. In a loop, the agent repeatedly calls the Responses API, maintaining a conversation history that includes previous messages and tool results, which is passed to each call.
- A Model instance is created at the start of the loop by calling the `Runner._get_model()`. We patch the Model instance using `patches._get_model()`.
- Available tools are also deteremined at the start of the loop, with `Runner._get_all_tools()`. We patch Tool instances by iterating through the returned tools in `patches._get_all_tools()`.
- Available tools are also determined at the start of the loop, with `Runner._get_all_tools()`. We patch Tool instances by iterating through the returned tools in `patches._get_all_tools()`.
- In each loop iteration, `run_single_turn()` or `run_single_turn_streamed()` is responsible for calling the Responses API, patched with `patches._run_single_turn()` and `patches._run_single_turn_streamed()`.
4. On loop termination, `RunImpl.execute_final_output()` is called. The function is patched with `patches._execute_final_output()`.

Expand Down
4 changes: 2 additions & 2 deletions sentry_sdk/integrations/starlette.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ async def _sentry_exceptionmiddleware_call(
# Also add the user (that was eventually set by be Authentication middle
# that was called before this middleware). This is done because the authentication
# middleware sets the user in the scope and then (in the same function)
# calls this exception middelware. In case there is no exception (or no handler
# for the type of exception occuring) then the exception bubbles up and setting the
# calls this exception middleware. In case there is no exception (or no handler
# for the type of exception occurring) then the exception bubbles up and setting the
# user information into the sentry scope is done in auth middleware and the
# ASGI middleware will then send everything to Sentry and this is fine.
# But if there is an exception happening that the exception middleware here
Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/integrations/trytond.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
except ImportError:
raise DidNotEnable("Trytond is not installed.")

# TODO: trytond-worker, trytond-cron and trytond-admin intergations
# TODO: trytond-worker, trytond-cron and trytond-admin integrations


class TrytondWSGIIntegration(Integration):
Expand Down
2 changes: 1 addition & 1 deletion sentry_sdk/profiler/transaction_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def _sample_stack(*args: "Any", **kwargs: "Any") -> None:
"""
# no profiles taking place, so we can stop early
if not self.new_profiles and not self.active_profiles:
# make sure to clear the cache if we're not profiling so we dont
# make sure to clear the cache if we're not profiling so we don't
# keep a reference to the last stack of frames around
return

Expand Down
8 changes: 4 additions & 4 deletions sentry_sdk/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,10 +919,10 @@ def exceptions_from_error(
parent_id = exception_id
exception_id += 1

should_supress_context = (
should_suppress_context = (
hasattr(exc_value, "__suppress_context__") and exc_value.__suppress_context__ # type: ignore
)
if should_supress_context:
if should_suppress_context:
# Add direct cause.
# The field `__cause__` is set when raised with the exception (using the `from` keyword).
exception_has_cause = (
Expand Down Expand Up @@ -1311,7 +1311,7 @@ def strip_string(
def parse_version(version: str) -> "Optional[Tuple[int, ...]]":
"""
Parses a version string into a tuple of integers.
This uses the parsing loging from PEP 440:
This uses the parsing logic from PEP 440:
https://peps.python.org/pep-0440/#appendix-b-parsing-version-strings-with-regular-expressions
"""
VERSION_PATTERN = r""" # noqa: N806
Expand Down Expand Up @@ -1678,7 +1678,7 @@ def sanitize_url(
def parse_url(url: str, sanitize: bool = True) -> "ParsedUrl":
"""
Splits a URL into a url (including path), query and fragment. If sanitize is True, the query
parameters will be sanitized to remove sensitive data. The autority (username and password)
parameters will be sanitized to remove sensitive data. The authority (username and password)
in the URL will always be removed.
"""
parsed_url = sanitize_url(
Expand Down
4 changes: 2 additions & 2 deletions tests/integrations/asgi/test_asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ def test_get_ip():
ip = _get_ip(scope)
assert ip == "127.0.0.1"

# x-forwarded-for header overides the ip from client
# x-forwarded-for header overrides the ip from client
headers = [
(b"x-forwarded-for", b"8.8.8.8"),
]
Expand All @@ -820,7 +820,7 @@ def test_get_ip():
ip = _get_ip(scope)
assert ip == "8.8.8.8"

# x-real-for header overides the ip from client
# x-real-for header overrides the ip from client
headers = [
(b"x-real-ip", b"10.10.10.10"),
]
Expand Down
8 changes: 4 additions & 4 deletions tests/integrations/asyncio/test_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def test_sentry_task_factory_no_factory(MockTask, mock_get_running_loop): # noq
# Set the original task factory to None
mock_loop.get_task_factory.return_value = None

# Retieve sentry task factory (since it is an inner function within patch_asyncio)
# Retrieve sentry task factory (since it is an inner function within patch_asyncio)
sentry_task_factory = get_sentry_task_factory(mock_get_running_loop)

# The call we are testing
Expand Down Expand Up @@ -364,7 +364,7 @@ def test_sentry_task_factory_with_factory(mock_get_running_loop):
orig_task_factory = mock_loop.get_task_factory.return_value
orig_task_factory._is_sentry_task_factory = False

# Retieve sentry task factory (since it is an inner function within patch_asyncio)
# Retrieve sentry task factory (since it is an inner function within patch_asyncio)
sentry_task_factory = get_sentry_task_factory(mock_get_running_loop)

# The call we are testing
Expand Down Expand Up @@ -395,7 +395,7 @@ def test_sentry_task_factory_context_no_factory(
# Set the original task factory to None
mock_loop.get_task_factory.return_value = None

# Retieve sentry task factory (since it is an inner function within patch_asyncio)
# Retrieve sentry task factory (since it is an inner function within patch_asyncio)
sentry_task_factory = get_sentry_task_factory(mock_get_running_loop)

# The call we are testing
Expand Down Expand Up @@ -427,7 +427,7 @@ def test_sentry_task_factory_context_with_factory(mock_get_running_loop):
orig_task_factory = mock_loop.get_task_factory.return_value
orig_task_factory._is_sentry_task_factory = False

# Retieve sentry task factory (since it is an inner function within patch_asyncio)
# Retrieve sentry task factory (since it is an inner function within patch_asyncio)
sentry_task_factory = get_sentry_task_factory(mock_get_running_loop)

# The call we are testing
Expand Down
8 changes: 4 additions & 4 deletions tests/integrations/gcp/test_gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def _safe_is_equal(x, y):

def test_error_has_new_trace_context_performance_enabled(run_cloud_function):
"""
Check if an 'trace' context is added to errros and transactions when performance monitoring is enabled.
Check if a 'trace' context is added to errors and transactions when performance monitoring is enabled.
"""
envelope_items, _, _ = run_cloud_function(
dedent(
Expand Down Expand Up @@ -423,7 +423,7 @@ def cloud_function(functionhandler, event):

def test_error_has_new_trace_context_performance_disabled(run_cloud_function):
"""
Check if an 'trace' context is added to errros and transactions when performance monitoring is disabled.
Check if a 'trace' context is added to errors and transactions when performance monitoring is disabled.
"""
envelope_items, _, _ = run_cloud_function(
dedent(
Expand Down Expand Up @@ -461,7 +461,7 @@ def cloud_function(functionhandler, event):

def test_error_has_existing_trace_context_performance_enabled(run_cloud_function):
"""
Check if an 'trace' context is added to errros and transactions
Check if a 'trace' context is added to errors and transactions
from the incoming 'sentry-trace' header when performance monitoring is enabled.
"""
trace_id = "471a43a4192642f0b136d5159a501701"
Expand Down Expand Up @@ -514,7 +514,7 @@ def cloud_function(functionhandler, event):

def test_error_has_existing_trace_context_performance_disabled(run_cloud_function):
"""
Check if an 'trace' context is added to errros and transactions
Check if a 'trace' context is added to errors and transactions
from the incoming 'sentry-trace' header when performance monitoring is disabled.
"""
trace_id = "471a43a4192642f0b136d5159a501701"
Expand Down
2 changes: 1 addition & 1 deletion tests/integrations/grpc/compile_test_services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ python -m grpc_tools.protoc \
--grpc_python_out=$TARGET_PATH/ \
$TARGET_PATH/protos/grpc_test_service.proto

echo Code generation successfull
echo Code generation successful
2 changes: 1 addition & 1 deletion tests/integrations/sanic/test_sanic.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def new_test_client(self):
Sanic.test_client = property(new_test_client)

if SANIC_VERSION >= (20, 12) and SANIC_VERSION < (22, 6):
# Some builds (20.12.0 intruduced and 22.6.0 removed again) have a feature where the instance is stored in an internal class
# Some builds (20.12.0 introduced and 22.6.0 removed again) have a feature where the instance is stored in an internal class
# registry for later retrieval, and so add register=False to disable that
sanic_app = Sanic("Test", register=False)
else:
Expand Down
8 changes: 4 additions & 4 deletions tests/integrations/tornado/test_tornado.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ def test_error_has_new_trace_context_performance_enabled(
tornado_testcase, sentry_init, capture_events
):
"""
Check if an 'trace' context is added to errros and transactions when performance monitoring is enabled.
Check if a 'trace' context is added to errors and transactions when performance monitoring is enabled.
"""
sentry_init(
integrations=[TornadoIntegration()],
Expand Down Expand Up @@ -925,7 +925,7 @@ def test_error_has_new_trace_context_performance_disabled(
tornado_testcase, sentry_init, capture_events
):
"""
Check if an 'trace' context is added to errros and transactions when performance monitoring is disabled.
Check if a 'trace' context is added to errors and transactions when performance monitoring is disabled.
"""
sentry_init(
integrations=[TornadoIntegration()],
Expand Down Expand Up @@ -954,7 +954,7 @@ def test_error_has_existing_trace_context_performance_enabled(
tornado_testcase, sentry_init, capture_events
):
"""
Check if an 'trace' context is added to errros and transactions
Check if a 'trace' context is added to errors and transactions
from the incoming 'sentry-trace' header when performance monitoring is enabled.
"""
sentry_init(
Expand Down Expand Up @@ -996,7 +996,7 @@ def test_error_has_existing_trace_context_performance_disabled(
tornado_testcase, sentry_init, capture_events
):
"""
Check if an 'trace' context is added to errros and transactions
Check if a 'trace' context is added to errors and transactions
from the incoming 'sentry-trace' header when performance monitoring is disabled.
"""
sentry_init(
Expand Down
4 changes: 2 additions & 2 deletions tests/new_scopes_compat/test_new_scopes_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"""
Those tests are meant to check the compatibility of the new scopes in SDK 2.0 with the old Hub/Scope system in SDK 1.x.

Those tests have been run with the latest SDK 1.x versiona and the data used in the `assert` statements represents
the behvaior of the SDK 1.x.
Those tests have been run with the latest SDK 1.x versions and the data used in the `assert` statements represents
the behavior of the SDK 1.x.

This makes sure that we are backwards compatible. (on a best effort basis, there will probably be some edge cases that are not covered here)
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/new_scopes_compat/test_new_scopes_compat_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Those tests are meant to check the compatibility of the new scopes in SDK 2.0 with the old Hub/Scope system in SDK 1.x.

Those tests have been run with the latest SDK 1.x version and the data used in the `assert` statements represents
the behvaior of the SDK 1.x.
the behavior of the SDK 1.x.

This makes sure that we are backwards compatible. (on a best effort basis, there will probably be some edge cases that are not covered here)
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/profiler/test_continuous_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ def test_continuous_profiler_auto_start_and_stop_unsampled_span_streaming(
pytest.param(get_client_options(False), id="experiment"),
],
)
def test_continuous_profiler_manual_start_and_stop_noop_when_using_trace_lifecyle(
def test_continuous_profiler_manual_start_and_stop_noop_when_using_trace_lifecycle(
sentry_init,
mode,
start_profiler_func,
Expand Down Expand Up @@ -1112,7 +1112,7 @@ def test_continuous_profiler_manual_start_and_stop_noop_when_using_trace_lifecyl
pytest.param(get_client_options(False), id="experiment"),
],
)
def test_continuous_profiler_manual_start_and_stop_noop_when_using_trace_lifecyle_span_streaming(
def test_continuous_profiler_manual_start_and_stop_noop_when_using_trace_lifecycle_span_streaming(
sentry_init,
mode,
start_profiler_func,
Expand Down
4 changes: 2 additions & 2 deletions tests/profiler/test_transaction_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def test_minimum_unique_samples_required(
items[item.type].append(item)

assert len(items["transaction"]) == 1
# because we dont leave any time for the profiler to
# because we don't leave any time for the profiler to
# take any samples, it should be not be sent
assert len(items["profile"]) == 0
assert record_lost_event_calls == [("insufficient_data", "profile", None, 1)]
Expand Down Expand Up @@ -531,7 +531,7 @@ def test_extract_stack_with_max_depth(depth, max_stack_depth, actual_depth):
for i in range(actual_depth):
assert frames[i]["function"] == "get_frame", i

# index 0 contains the inner most frame on the stack, so the lamdba
# index 0 contains the inner most frame on the stack, so the lambda
# should be at index `actual_depth`
if sys.version_info >= (3, 11):
assert (
Expand Down
4 changes: 2 additions & 2 deletions tests/test_exceptiongroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ def test_exception_chain_context():

@minimum_python_311
def test_simple_exception():
simple_excpetion = ValueError("A simple exception")
simple_exception = ValueError("A simple exception")

(event, _) = event_from_exception(
simple_excpetion,
simple_exception,
client_options={
"include_local_variables": True,
"include_source_context": True,
Expand Down
2 changes: 1 addition & 1 deletion tests/tracing/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def test_set_measurement_deprecated(sentry_init):
span.set_measurement("metric.baz", 420.69, unit="custom")


def test_set_meaurement_compared_to_set_data(sentry_init, capture_events):
def test_set_measurement_compared_to_set_data(sentry_init, capture_events):
"""
This is just a test to see the difference
between measurements and data in the resulting event payload.
Expand Down
Loading