Skip to content

Commit 8345859

Browse files
committed
lets see
1 parent a1e7da7 commit 8345859

File tree

4 files changed

+61
-9
lines changed

4 files changed

+61
-9
lines changed

.github/workflows/test-integrations-ai.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
strategy:
102102
fail-fast: false
103103
matrix:
104-
python-version: ["3.8","3.9","3.11","3.12","3.13"]
104+
python-version: ["3.7","3.8","3.9","3.11","3.12","3.13"]
105105
# python3.6 reached EOL and is no longer being supported on
106106
# new versions of hosted runners on Github Actions
107107
# ubuntu-20.04 is the last version that supported python3.6

scripts/populate_tox/dependencies.py renamed to scripts/populate_tox/config.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,19 @@
3838

3939

4040
TEST_SUITE_CONFIG = {
41+
"aiohttp": {
42+
"package": "aiohttp",
43+
"deps": {"*": ["pytest-aiohttp", "pytest-asyncio"]},
44+
"python": ">=3.7",
45+
},
46+
"anthropic": {
47+
"package": "anthropic",
48+
"deps": {
49+
"*": ["pytest-asyncio"],
50+
"<=0.32": ["httpx<0.28.0"],
51+
},
52+
"python": ">=3.7",
53+
},
4154
"ariadne": {
4255
"package": "ariadne",
4356
"deps": {

scripts/populate_tox/populate_tox.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
from packaging.specifiers import InvalidSpecifier, SpecifierSet
1010
from packaging.version import Version
1111
from pathlib import Path
12-
from typing import Union
12+
from typing import Optional, Union
1313

1414
import requests
1515
from jinja2 import Environment, FileSystemLoader
1616

1717
from sentry_sdk.integrations import _MIN_VERSIONS
1818

19-
from dependencies import TEST_SUITE_CONFIG
19+
from config import TEST_SUITE_CONFIG
2020
from scripts.split_tox_gh_actions.split_tox_gh_actions import GROUPS
2121

2222

@@ -43,8 +43,6 @@
4343
# suites over to this script. Some entries will probably stay forever
4444
# as they don't fit the mold (e.g. common, asgi, which don't have a 3rd party
4545
# pypi package to install in different versions).
46-
"aiohttp",
47-
"anthropic",
4846
"asgi",
4947
"aws_lambda",
5048
"beam",
@@ -134,6 +132,10 @@ def get_supported_releases(integration: str, pypi_data: dict) -> list[Version]:
134132
f" {integration} doesn't have a minimum version. Maybe we should define one?"
135133
)
136134

135+
custom_python_versions = TEST_SUITE_CONFIG[integration].get("python")
136+
if custom_python_versions:
137+
custom_python_versions = SpecifierSet(custom_python_versions)
138+
137139
releases = []
138140

139141
for release, metadata in pypi_data["releases"].items():
@@ -167,7 +169,7 @@ def get_supported_releases(integration: str, pypi_data: dict) -> list[Version]:
167169
if requires_python:
168170
try:
169171
version.python_versions = supported_python_versions(
170-
SpecifierSet(requires_python)
172+
SpecifierSet(requires_python), custom_python_versions
171173
)
172174
except InvalidSpecifier:
173175
continue
@@ -177,7 +179,7 @@ def get_supported_releases(integration: str, pypi_data: dict) -> list[Version]:
177179
# XXX do something with this. no need to fetch every release ever
178180
release_metadata = fetch_release(package, version)
179181
version.python_versions = supported_python_versions(
180-
determine_python_versions(release_metadata)
182+
determine_python_versions(release_metadata), custom_python_versions
181183
)
182184
time.sleep(0.1)
183185

@@ -244,14 +246,18 @@ def pick_releases_to_test(releases: list[Version]) -> list[Version]:
244246
return sorted(filtered_releases)
245247

246248

247-
def supported_python_versions(python_versions: SpecifierSet) -> list[Version]:
249+
def supported_python_versions(
250+
python_versions: SpecifierSet, custom_versions: Optional[SpecifierSet] = None
251+
) -> list[Version]:
248252
"""Get an intersection of python_versions and Python versions supported in the SDK."""
249253
supported = []
250254

251255
curr = MIN_PYTHON_VERSION
252256
while curr <= MAX_PYTHON_VERSION:
253257
if curr in python_versions:
254-
supported.append(curr)
258+
if not custom_versions or curr in custom_versions:
259+
supported.append(curr)
260+
255261
next = [int(v) for v in str(curr).split(".")]
256262
next[1] += 1
257263
curr = Version(".".join(map(str, next)))

tox.ini

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,13 @@ envlist =
289289
# === Integrations - Auto-generated ===
290290
# These come from the populate_tox.py script. Eventually we should move all
291291
# integration tests there.
292+
# ~~~ AI ~~~
293+
{py3.7,py3.12,py3.13}-anthropic-v0.16.0
294+
{py3.7,py3.12,py3.13}-anthropic-v0.25.9
295+
{py3.7,py3.12,py3.13}-anthropic-v0.34.2
296+
{py3.8,py3.12,py3.13}-anthropic-v0.42.0
297+
298+
292299
# ~~~ DBs ~~~
293300
{py3.6,py3.12,py3.13}-asyncpg-v0.23.0
294301
{py3.6,py3.12,py3.13}-asyncpg-v0.25.0
@@ -310,6 +317,13 @@ envlist =
310317
{py3.8,py3.12,py3.13}-arq-v0.26.3
311318

312319

320+
# ~~~ Web 2 ~~~
321+
{py3.7,py3.12,py3.13}-aiohttp-v3.6.3
322+
{py3.7,py3.12,py3.13}-aiohttp-v3.8.6
323+
{py3.8,py3.12,py3.13}-aiohttp-v3.10.9
324+
{py3.9,py3.12,py3.13}-aiohttp-v3.11.11
325+
326+
313327

314328
[testenv]
315329
deps =
@@ -738,6 +752,16 @@ deps =
738752
# === Integrations - Auto-generated ===
739753
# These come from the populate_tox.py script. Eventually we should move all
740754
# integration tests there.
755+
# ~~~ AI ~~~
756+
anthropic-v0.16.0: anthropic==0.16.0
757+
anthropic-v0.25.9: anthropic==0.25.9
758+
anthropic-v0.34.2: anthropic==0.34.2
759+
anthropic-v0.42.0: anthropic==0.42.0
760+
anthropic: pytest-asyncio
761+
anthropic-v0.16.0: httpx<0.28.0
762+
anthropic-v0.25.9: httpx<0.28.0
763+
764+
741765
# ~~~ DBs ~~~
742766
asyncpg-v0.23.0: asyncpg==0.23.0
743767
asyncpg-v0.25.0: asyncpg==0.25.0
@@ -769,6 +793,15 @@ deps =
769793
arq-v0.25.0: pydantic<2
770794

771795

796+
# ~~~ Web 2 ~~~
797+
aiohttp-v3.6.3: aiohttp==3.6.3
798+
aiohttp-v3.8.6: aiohttp==3.8.6
799+
aiohttp-v3.10.9: aiohttp==3.10.9
800+
aiohttp-v3.11.11: aiohttp==3.11.11
801+
aiohttp: pytest-aiohttp
802+
aiohttp: pytest-asyncio
803+
804+
772805

773806
setenv =
774807
PYTHONDONTWRITEBYTECODE=1

0 commit comments

Comments
 (0)