-
Notifications
You must be signed in to change notification settings - Fork 612
Expand file tree
/
Copy pathtox.jinja
More file actions
executable file
·232 lines (187 loc) · 7.38 KB
/
tox.jinja
File metadata and controls
executable file
·232 lines (187 loc) · 7.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
# DON'T EDIT THIS FILE BY HAND. This file has been generated from a template by
# `scripts/populate_tox/populate_tox.py`.
#
# Any changes to the test matrix should be made
# - either in the script config in `scripts/populate_tox/config.py` (if you want
# to change the auto-generated part)
# - or in the template in `scripts/populate_tox/tox.jinja` (if you want to change
# a hardcoded part of the file)
#
# This file (and all resulting CI YAMLs) then needs to be regenerated via
# `scripts/generate-test-files.sh`.
#
# See also `scripts/populate_tox/README.md` for more info.
[tox]
requires =
# This version introduced using pip 24.1 which does not work with older Celery and HTTPX versions.
virtualenv<20.26.3
envlist =
# === Common ===
{py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14,py3.14t}-common
# === Gevent ===
{py3.6,py3.8,py3.10,py3.11,py3.12}-gevent
# === Integration Deactivation ===
{py3.9,py3.10,py3.11,py3.12,py3.13,py3.14}-integration_deactivation
# === Shadowed Module ===
{py3.7,py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14,py3.14t}-shadowed_module
# === Integrations ===
# Asgi
{py3.7,py3.12,py3.13,py3.14,py3.14t}-asgi
# AWS Lambda
{py3.8,py3.9,py3.11,py3.13}-aws_lambda
# Cloud Resource Context
{py3.6,py3.12,py3.13}-cloud_resource_context
# GCP
{py3.7}-gcp
# OpenTelemetry (OTel)
{py3.7,py3.9,py3.12,py3.13,py3.14,py3.14t}-opentelemetry
# OpenTelemetry with OTLP
{py3.7,py3.9,py3.12,py3.13,py3.14}-otlp
# OpenTelemetry Experimental (POTel)
{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13}-potel
# === Integrations - Auto-generated ===
# These come from the populate_tox.py script.
{% for group, integrations in groups.items() %}
# ~~~ {{ group }} ~~~
{% for integration in integrations %}
{% for release in integration.releases %}
{{ release.rendered_python_versions }}-{{ integration.name }}-v{{ release }}
{% endfor %}
{% endfor %}
{% endfor %}
[testenv]
deps =
# if you change requirements-testing.txt and your change is not being reflected
# in what's installed by tox (when running tox locally), try running tox
# with the -r flag
-r requirements-testing.txt
linters: -r requirements-linting.txt
linters: werkzeug<2.3.0
# === Common ===
py3.8-common: hypothesis
common: pytest-asyncio
# See https://github.com/pytest-dev/pytest/issues/9621
# and https://github.com/pytest-dev/pytest-forked/issues/67
# for justification of the upper bound on pytest
{py3.6,py3.7}-common: pytest<7.0.0
{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14,py3.14t}-common: pytest
# coverage 7.11.1-7.11.3 makes some of our tests flake
{py3.14,py3.14t}-common: coverage==7.11.0
# === Gevent ===
{py3.6,py3.7,py3.8,py3.9,py3.10,py3.11}-gevent: gevent>=22.10.0, <22.11.0
{py3.12}-gevent: gevent
# See https://github.com/pytest-dev/pytest/issues/9621
# and https://github.com/pytest-dev/pytest-forked/issues/67
# for justification of the upper bound on pytest
{py3.6,py3.7}-gevent: pytest<7.0.0
{py3.8,py3.9,py3.10,py3.11,py3.12}-gevent: pytest
gevent: pytest-asyncio
{py3.10,py3.11}-gevent: zope.event<5.0.0
{py3.10,py3.11}-gevent: zope.interface<8.0
# === Integration Deactivation ===
integration_deactivation: openai
integration_deactivation: anthropic
integration_deactivation: langchain
# === Integrations ===
# Asgi
asgi: pytest-asyncio
asgi: async-asgi-testclient
# AWS Lambda
aws_lambda: aws-cdk-lib
aws_lambda: aws-sam-cli
aws_lambda: boto3
aws_lambda: fastapi
aws_lambda: requests
aws_lambda: uvicorn
# OpenTelemetry (OTel)
opentelemetry: opentelemetry-distro
# OpenTelemetry with OTLP
otlp: opentelemetry-distro[otlp]
# OpenTelemetry Experimental (POTel)
potel: -e .[opentelemetry-experimental]
# === Integrations - Auto-generated ===
# These come from the populate_tox.py script.
{% for group, integrations in groups.items() %}
# ~~~ {{ group }} ~~~
{% for integration in integrations %}
{% for release in integration.releases %}
{% if integration.extra %}
{{ integration.name }}-v{{ release }}: {{ integration.package }}[{{ integration.extra }}]=={{ release }}
{% else %}
{{ integration.name }}-v{{ release }}: {{ integration.package }}=={{ release }}
{% endif %}
{% endfor %}
{% for dep in integration.dependencies %}
{{ dep }}
{% endfor %}
{% endfor %}
{% endfor %}
setenv =
PYTHONDONTWRITEBYTECODE=1
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
COVERAGE_FILE=.coverage-sentry-{envname}
py3.6: COVERAGE_RCFILE=.coveragerc36
# Lowest version to support free-threading
# https://discuss.python.org/t/announcement-pip-24-1-release/56281
py3.14t: VIRTUALENV_PIP=24.1
django: DJANGO_SETTINGS_MODULE=tests.integrations.django.myapp.settings
spark-v{3.0.3,3.5.6}: JAVA_HOME=/usr/lib/jvm/temurin-11-jdk-amd64
# Avoid polluting test suite with imports
common: PYTEST_ADDOPTS="--ignore=tests/test_shadowed_module.py"
gevent: PYTEST_ADDOPTS="--ignore=tests/test_shadowed_module.py"
# TESTPATH definitions for test suites not managed by toxgen
common: TESTPATH=tests
gevent: TESTPATH=tests
integration_deactivation: TESTPATH=tests/test_ai_integration_deactivation.py
shadowed_module: TESTPATH=tests/test_shadowed_module.py
asgi: TESTPATH=tests/integrations/asgi
aws_lambda: TESTPATH=tests/integrations/aws_lambda
cloud_resource_context: TESTPATH=tests/integrations/cloud_resource_context
gcp: TESTPATH=tests/integrations/gcp
opentelemetry: TESTPATH=tests/integrations/opentelemetry
otlp: TESTPATH=tests/integrations/otlp
potel: TESTPATH=tests/integrations/opentelemetry
socket: TESTPATH=tests/integrations/socket
# These TESTPATH definitions are auto-generated by toxgen
{% for integration, testpath in testpaths %}
{{ integration }}: TESTPATH={{ testpath }}
{% endfor %}
passenv =
SENTRY_PYTHON_TEST_POSTGRES_HOST
SENTRY_PYTHON_TEST_POSTGRES_USER
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD
SENTRY_PYTHON_TEST_POSTGRES_NAME
usedevelop = True
extras =
bottle: bottle
falcon: falcon
flask: flask
pymongo: pymongo
basepython =
py3.6: python3.6
py3.7: python3.7
py3.8: python3.8
py3.9: python3.9
py3.10: python3.10
py3.11: python3.11
py3.12: python3.12
py3.13: python3.13
py3.14: python3.14
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
commands =
{py3.7,py3.8}-boto3: pip install urllib3<2.0.0
; https://github.com/pallets/flask/issues/4455
{py3.7,py3.8,py3.9,py3.10,py3.11}-flask-v{1}: pip install "itsdangerous>=0.24,<2.0" "markupsafe<2.0.0" "jinja2<3.1.1"
; Running `pytest` as an executable suffers from an import error
; when loading tests in scenarios. In particular, django fails to
; load the settings from the test module.
python -m pytest -W error::pytest.PytestUnraisableExceptionWarning {env:TESTPATH} -o junit_suite_name={envname} {posargs}
[testenv:linters]
commands =
ruff check tests sentry_sdk
ruff format --check tests sentry_sdk
mypy sentry_sdk