Skip to content

Commit 6c2edd0

Browse files
committed
try anthropic
1 parent fbe73b8 commit 6c2edd0

File tree

5 files changed

+51
-48
lines changed

5 files changed

+51
-48
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
python-version: ["3.7","3.9","3.11","3.12","3.13"]
32+
python-version: ["3.9","3.11","3.12","3.13"]
3333
# python3.6 reached EOL and is no longer being supported on
3434
# new versions of hosted runners on Github Actions
3535
# ubuntu-20.04 is the last version that supported python3.6
@@ -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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535

3636

3737
DEPENDENCIES = {
38-
"aiohttp": {
39-
"package": "aiohttp",
40-
"deps": {"*": ["pytest-aiohttp", "pytest-asyncio"]},
41-
},
4238
"anthropic": {
4339
"package": "anthropic",
4440
"deps": {

scripts/populate_tox/populate_tox.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
# This set should be getting smaller over time as we migrate more test
4343
# suites over to this script. Some entries will probably stay forever
4444
# as they don't fit the mold (e.g. common, asgi).
45-
"anthropic",
45+
"aiohttp",
4646
"arq",
4747
"asgi",
4848
"asyncpg",
@@ -172,7 +172,7 @@ def get_supported_releases(integration: str, pypi_data: dict) -> list[Version]:
172172
except InvalidSpecifier:
173173
continue
174174
else:
175-
# No `requires_python``. Let's fetch the metadata to see
175+
# No `requires_python`. Let's fetch the metadata to see
176176
# the classifiers.
177177
# XXX do something with this. no need to fetch every release ever
178178
release_metadata = fetch_release(package, version)
@@ -190,7 +190,7 @@ def get_supported_releases(integration: str, pypi_data: dict) -> list[Version]:
190190
and version.minor == saved_version.minor
191191
and version.micro > saved_version.micro
192192
):
193-
# don't save all patch versions of a release, just the newest one
193+
# Don't save all patch versions of a release, just the newest one
194194
releases[i] = version
195195
break
196196
else:
@@ -208,6 +208,9 @@ def pick_releases_to_test(releases: list[Version]) -> list[Version]:
208208
filtered_releases = set()
209209

210210
if has_majors:
211+
# Always check the very first supported release
212+
filtered_releases.add(releases[0])
213+
211214
# Find out the min and max release by each major
212215
releases_by_major = {}
213216
for release in releases:
@@ -217,9 +220,12 @@ def pick_releases_to_test(releases: list[Version]) -> list[Version]:
217220
releases_by_major[release.major][0] = release
218221
if release > releases_by_major[release.major][1]:
219222
releases_by_major[release.major][1] = release
220-
for min_version, max_version in releases_by_major.values():
221-
filtered_releases.add(min_version)
223+
for i, (min_version, max_version) in enumerate(releases_by_major.values()):
222224
filtered_releases.add(max_version)
225+
if i == len(releases_by_major) - 1:
226+
# If this is the latest major release, also check the lowest
227+
# version of this version
228+
filtered_releases.add(min_version)
223229

224230
else:
225231
indexes = [

scripts/populate_tox/tox.jinja

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ envlist =
3131
# At a minimum, we should test against at least the lowest
3232
# and the latest supported version of a framework.
3333

34-
# Anthropic
35-
{py3.8,py3.11,py3.12}-anthropic-v{0.16,0.28,0.40}
36-
{py3.7,py3.11,py3.12}-anthropic-latest
34+
# AIOHTTP
35+
{py3.7}-aiohttp-v{3.4}
36+
{py3.7,py3.9,py3.11}-aiohttp-v{3.8}
37+
{py3.8,py3.12,py3.13}-aiohttp-latest
3738

3839
# Arq
3940
{py3.7,py3.11}-arq-v{0.23}
@@ -292,7 +293,6 @@ envlist =
292293
# === Integrations - Auto-generated ===
293294
# These come from the populate_tox.py script. Eventually we should move all
294295
# integration tests there.
295-
296296
{% for group, integrations in groups.items() %}
297297
# ~~~ {{ group }} ~~~
298298
{% for integration in integrations %}
@@ -334,13 +334,13 @@ deps =
334334
335335
# === Integrations ===
336336
337-
# Anthropic
338-
anthropic: pytest-asyncio
339-
anthropic-v{0.16,0.28}: httpx<0.28.0
340-
anthropic-v0.16: anthropic~=0.16.0
341-
anthropic-v0.28: anthropic~=0.28.0
342-
anthropic-v0.40: anthropic~=0.40.0
343-
anthropic-latest: anthropic
337+
# AIOHTTP
338+
aiohttp-v3.4: aiohttp~=3.4.0
339+
aiohttp-v3.8: aiohttp~=3.8.0
340+
aiohttp-latest: aiohttp
341+
aiohttp: pytest-aiohttp
342+
aiohttp-v3.8: pytest-asyncio
343+
aiohttp-latest: pytest-asyncio
344344
345345
# Arq
346346
arq-v0.23: arq~=0.23.0

tox.ini

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ envlist =
3131
# At a minimum, we should test against at least the lowest
3232
# and the latest supported version of a framework.
3333

34-
# Anthropic
35-
{py3.8,py3.11,py3.12}-anthropic-v{0.16,0.28,0.40}
36-
{py3.7,py3.11,py3.12}-anthropic-latest
34+
# AIOHTTP
35+
{py3.7}-aiohttp-v{3.4}
36+
{py3.7,py3.9,py3.11}-aiohttp-v{3.8}
37+
{py3.8,py3.12,py3.13}-aiohttp-latest
3738

3839
# Arq
3940
{py3.7,py3.11}-arq-v{0.23}
@@ -292,6 +293,12 @@ envlist =
292293
# === Integrations - Auto-generated ===
293294
# These come from the populate_tox.py script. Eventually we should move all
294295
# integration tests there.
296+
# ~~~ AI ~~~
297+
{py3.7,py3.12,py3.13}-anthropic-v0.16.0
298+
{py3.7,py3.12,py3.13}-anthropic-v0.25.9
299+
{py3.7,py3.12,py3.13}-anthropic-v0.34.2
300+
{py3.8,py3.12,py3.13}-anthropic-v0.42.0
301+
295302

296303
# ~~~ GraphQL ~~~
297304
{py3.8,py3.10,py3.11}-ariadne-v0.20.1
@@ -300,13 +307,6 @@ envlist =
300307
{py3.8,py3.11,py3.12}-ariadne-v0.24.0
301308

302309

303-
# ~~~ Web 2 ~~~
304-
{py3.6,py3.12,py3.13}-aiohttp-v3.6.3
305-
{py3.6,py3.12,py3.13}-aiohttp-v3.8.6
306-
{py3.8,py3.12,py3.13}-aiohttp-v3.10.9
307-
{py3.9,py3.12,py3.13}-aiohttp-v3.11.11
308-
309-
310310

311311
[testenv]
312312
deps =
@@ -338,13 +338,13 @@ deps =
338338

339339
# === Integrations ===
340340

341-
# Anthropic
342-
anthropic: pytest-asyncio
343-
anthropic-v{0.16,0.28}: httpx<0.28.0
344-
anthropic-v0.16: anthropic~=0.16.0
345-
anthropic-v0.28: anthropic~=0.28.0
346-
anthropic-v0.40: anthropic~=0.40.0
347-
anthropic-latest: anthropic
341+
# AIOHTTP
342+
aiohttp-v3.4: aiohttp~=3.4.0
343+
aiohttp-v3.8: aiohttp~=3.8.0
344+
aiohttp-latest: aiohttp
345+
aiohttp: pytest-aiohttp
346+
aiohttp-v3.8: pytest-asyncio
347+
aiohttp-latest: pytest-asyncio
348348

349349
# Arq
350350
arq-v0.23: arq~=0.23.0
@@ -740,6 +740,16 @@ deps =
740740
# === Integrations - Auto-generated ===
741741
# These come from the populate_tox.py script. Eventually we should move all
742742
# integration tests there.
743+
# ~~~ AI ~~~
744+
anthropic-v0.16.0: anthropic==0.16.0
745+
anthropic-v0.25.9: anthropic==0.25.9
746+
anthropic-v0.34.2: anthropic==0.34.2
747+
anthropic-v0.42.0: anthropic==0.42.0
748+
anthropic: pytest-asyncio
749+
anthropic-v0.16.0: httpx<0.28.0
750+
anthropic-v0.25.9: httpx<0.28.0
751+
752+
743753
# ~~~ GraphQL ~~~
744754
ariadne-v0.20.1: ariadne==0.20.1
745755
ariadne-v0.21: ariadne==0.21
@@ -750,15 +760,6 @@ deps =
750760
ariadne: httpx
751761

752762

753-
# ~~~ Web 2 ~~~
754-
aiohttp-v3.6.3: aiohttp==3.6.3
755-
aiohttp-v3.8.6: aiohttp==3.8.6
756-
aiohttp-v3.10.9: aiohttp==3.10.9
757-
aiohttp-v3.11.11: aiohttp==3.11.11
758-
aiohttp: pytest-aiohttp
759-
aiohttp: pytest-asyncio
760-
761-
762763

763764
setenv =
764765
PYTHONDONTWRITEBYTECODE=1

0 commit comments

Comments
 (0)