Skip to content

Commit 17da4de

Browse files
committed
Add tox envs for mypy, ruff; tweak
1 parent 8f2ebfb commit 17da4de

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

AGENTS.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
# Agent Instructions
22

3+
## Tox
4+
5+
- Always run tox from the main `.venv`
6+
- If there is no `tox.venv`, create one with `python -m venv tox.venv`, active it and run `pip install tox`
7+
38
## Package Manager
49

510
Use **tox** for testing (not pytest directly):
6-
- Always run tox from the main `.venv`. If there is no `.venv`, create it and install `pip install -r requirements-lint.txt -r requirements-test.txt tox`
7-
- Test matrix config is in `tox.ini`
11+
- Test matrix configuration is in `tox.ini`
812
- Integration tests: `tox -e py3.14-{integration}-v{version}`
913
- Common tests: `tox -e py3.14-common`
1014

1115
## Type Checking
1216

13-
- Always run mypy from the main `.venv`. If there is no `.venv`, create it and install `pip install -r requirements-lint.txt -r requirements-test.txt`
14-
- Run `mypy sentry_sdk` before committing (must pass with zero errors)
17+
Use **tox** for type checking (not mypy directly):
18+
- Run `tox -e mypy` before committing (must pass with zero errors)
1519
- Strict mode enabled (`check_untyped_defs`, `disallow_untyped_defs`)
1620

1721
## Linting & Formatting
1822

19-
- **Ruff** for linting and formatting
20-
- `ruff check tests sentry_sdk`
21-
- `ruff format --check tests sentry_sdk`
23+
Use **tox** for linting (not ruff directly):
24+
- `tox -e ruff`
2225
- Full lint suite: `tox -e linters`
26+
- Full lint suite must pass before committing
2327

2428
## Commit Attribution
2529

tox.ini

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ deps =
327327
linters: -r requirements-linting.txt
328328
linters: werkzeug<2.3.0
329329

330+
ruff: -r requirements-linting.txt
331+
mypy: -r requirements-linting.txt
332+
330333
# === Common ===
331334
py3.8-common: hypothesis
332335
common: pytest-asyncio
@@ -915,6 +918,8 @@ basepython =
915918
# Tools like ruff and mypy have options that pin the target Python
916919
# version (configured in pyproject.toml), ensuring consistent behavior.
917920
linters: python3.14
921+
mypy: python3.14
922+
ruff: python3.14
918923

919924
commands =
920925
{py3.7,py3.8}-boto3: pip install urllib3<2.0.0
@@ -933,3 +938,12 @@ commands =
933938
ruff format --check tests sentry_sdk
934939
mypy sentry_sdk
935940
python scripts/find_raise_from_none.py
941+
942+
[testenv:mypy]
943+
commands =
944+
mypy sentry_sdk
945+
946+
[testenv:ruff]
947+
commands =
948+
ruff check tests sentry_sdk
949+
ruff format --check tests sentry_sdk

0 commit comments

Comments
 (0)