Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.jsonl -diff linguist-generated=true
uv.lock -diff linguist-generated=true
19 changes: 13 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,22 @@ jobs:

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: 3.14
- uses: astral-sh/setup-uv@v5

- run: |
uv run ruff check tests sentry_sdk
uv run ruff format --check tests sentry_sdk
uv run tox -e linters
- name: Ruff check
run: uv run ruff check tests sentry_sdk

- name: Ruff format
run: uv run ruff format --check tests sentry_sdk

- name: Linters
run: uv run tox -e linters

- name: Mypy
run: uv run --group typing mypy sentry_sdk

build_lambda_layer:
name: Build Package
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Use **tox** for testing (not pytest directly):

## Type Checking

Use **tox** for type checking (not mypy directly):
- Run `uv run tox -e mypy` before committing (must pass with zero errors)
Mypy and its type stubs live in the opt-in `typing` dependency group:
- Run `uv run --group typing mypy sentry_sdk` before committing (must pass with zero errors)
- Strict mode enabled (`check_untyped_defs`, `disallow_untyped_defs`)

## Linting & Formatting
Expand Down
48 changes: 31 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#
# Project dev dependencies (PEP 735 `dev` group, installed by default).
# Project dev dependencies (PEP 735 groups).
# `dev` is installed by default; `typing` is opt-in via `uv run --group typing`.
# Run tox with: `uv run tox -e <env>`
# Run mypy with: `uv run --group typing mypy sentry_sdk`
#

[dependency-groups]
Expand All @@ -12,6 +14,34 @@ dev = [
"ruff",
]

typing = [
"mypy",
# =================
# TODO: remove redundant urllib3 and certifi after proper migration from setup.py
"urllib3>=1.26.11",
"certifi",
# =================
"types-protobuf",
"types-gevent",
"types-greenlet",
"types-redis",
"types-setuptools<71",
"types-webob",
"opentelemetry-distro[otlp]",
"pymongo",
"loguru",
"httpcore[asyncio,http2]",
"launchdarkly-server-sdk",
"openfeature-sdk",
"statsig",
"UnleashClient<6",
"typer",
"strawberry-graphql",
"httpx",
"botocore-stubs",
"werkzeug<2.3.0",
]

#
# Tool: Coverage
#
Expand Down Expand Up @@ -81,14 +111,6 @@ ignore_missing_imports = true
module = "pyramid.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "psycopg2.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "pytest.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "aiohttp.*"
ignore_missing_imports = true
Expand All @@ -105,10 +127,6 @@ ignore_missing_imports = true
module = "tornado.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "fakeredis.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "rq.*"
ignore_missing_imports = true
Expand All @@ -117,10 +135,6 @@ ignore_missing_imports = true
module = "pyspark.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "asgiref.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "langchain_core.*"
ignore_missing_imports = true
Expand Down
22 changes: 0 additions & 22 deletions requirements-linting.txt

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/populate_tox/package_dependencies.jsonl

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions scripts/populate_tox/releases.jsonl

Large diffs are not rendered by default.

16 changes: 0 additions & 16 deletions scripts/populate_tox/tox.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,6 @@ deps =
# with the -r flag
-r requirements-testing.txt

linters: -r requirements-linting.txt
linters: werkzeug<2.3.0
linters: httpcore[asyncio]

mypy: -r requirements-linting.txt
mypy: werkzeug<2.3.0
mypy: httpcore[asyncio]

# === Common ===
py3.8-common: hypothesis
common: pytest-asyncio
Expand Down Expand Up @@ -241,10 +233,7 @@ basepython =
py3.14t: python3.14t

# Python version is pinned here for consistency across environments.
# Tools like ruff and mypy have options that pin the target Python
# version (configured in pyproject.toml), ensuring consistent behavior.
linters: python3.14
mypy: python3.14

commands =
; Running `pytest` as an executable suffers from an import error
Expand All @@ -254,9 +243,4 @@ commands =

[testenv:linters]
commands =
mypy sentry_sdk
python scripts/find_raise_from_none.py

[testenv:mypy]
commands =
mypy sentry_sdk
2 changes: 2 additions & 0 deletions scripts/split_tox_gh_actions/templates/test_group.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
cache-suffix: {% raw %}${{ github.workflow }}-${{ matrix.python-version }}{% endraw %}

{% if needs_clickhouse %}
- name: "Setup ClickHouse Server"
Expand Down
4 changes: 1 addition & 3 deletions sentry_sdk/integrations/pure_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ def start(n: "ast.expr") -> "Tuple[int, int]":
return (n.lineno, n.col_offset)

nodes_before_stmt = [
node
for node in nodes
if start(node) < stmt.last_token.end # type: ignore
node for node in nodes if start(node) < stmt.last_token.end
]
if nodes_before_stmt:
# The position of the last node before or in the statement
Expand Down
28 changes: 6 additions & 22 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ envlist =
{py3.6,py3.7,py3.8}-boto3-v1.16.63
{py3.7,py3.10,py3.11}-boto3-v1.24.96
{py3.8,py3.12,py3.13}-boto3-v1.35.99
{py3.10,py3.13,py3.14,py3.14t}-boto3-v1.43.15
{py3.10,py3.13,py3.14,py3.14t}-boto3-v1.43.16
{py3.10,py3.13,py3.14,py3.14t}-boto3-latest

{py3.6,py3.7,py3.8}-chalice-v1.16.0
Expand Down Expand Up @@ -305,7 +305,7 @@ envlist =

{py3.6,py3.9,py3.10}-starlette-v0.16.0
{py3.10,py3.13,py3.14,py3.14t}-starlette-v0.52.1
{py3.10,py3.13,py3.14,py3.14t}-starlette-v1.1.0
{py3.10,py3.13,py3.14,py3.14t}-starlette-v1.2.0
{py3.10,py3.13,py3.14,py3.14t}-starlette-latest

{py3.6,py3.9,py3.10}-fastapi-v0.79.1
Expand Down Expand Up @@ -393,14 +393,6 @@ deps =
# with the -r flag
-r requirements-testing.txt

linters: -r requirements-linting.txt
linters: werkzeug<2.3.0
linters: httpcore[asyncio]

mypy: -r requirements-linting.txt
mypy: werkzeug<2.3.0
mypy: httpcore[asyncio]

# === Common ===
py3.8-common: hypothesis
common: pytest-asyncio
Expand Down Expand Up @@ -584,8 +576,8 @@ deps =
boto3-v1.16.63: boto3==1.16.63
boto3-v1.24.96: boto3==1.24.96
boto3-v1.35.99: boto3==1.35.99
boto3-v1.43.15: boto3==1.43.15
boto3-latest: boto3==1.43.15
boto3-v1.43.16: boto3==1.43.16
boto3-latest: boto3==1.43.16
{py3.7,py3.8}-boto3: urllib3<2.0.0

chalice-v1.16.0: chalice==1.16.0
Expand Down Expand Up @@ -828,8 +820,8 @@ deps =

starlette-v0.16.0: starlette==0.16.0
starlette-v0.52.1: starlette==0.52.1
starlette-v1.1.0: starlette==1.1.0
starlette-latest: starlette==1.1.0
starlette-v1.2.0: starlette==1.2.0
starlette-latest: starlette==1.2.0
starlette: pytest-asyncio
starlette: python-multipart
starlette: requests
Expand Down Expand Up @@ -1099,10 +1091,7 @@ basepython =
py3.14t: python3.14t

# Python version is pinned here for consistency across environments.
# Tools like mypy have options that pin the target Python
# version (configured in pyproject.toml), ensuring consistent behavior.
linters: python3.14
mypy: python3.14

commands =
; Running `pytest` as an executable suffers from an import error
Expand All @@ -1112,9 +1101,4 @@ commands =

[testenv:linters]
commands =
mypy sentry_sdk
python scripts/find_raise_from_none.py

[testenv:mypy]
commands =
mypy sentry_sdk
Loading
Loading