Skip to content

Commit 434e8af

Browse files
authored
tests: Fix version picking in toxgen (#4323)
Toxgen should only consider the highest patch release of each `major.minor` version. For the most part this was working fine as long as the releases were ordered as expected in PyPI, but in cases where a lower patch version succeeded a higher patch version in the release list from PyPI, we would incorrectly consider the lower patch version as well, instead of ignoring it in favor of the higher patch. Example: - we pull releases `[1.2.3, 1.2.4, 1.2.5, 1.2.2]` from PyPI (in that order) - we consolidate `1.2.3, 1.2.4, 1.2.5` into one version, `1.2.5`, as expected - `1.2.2` will not disappear into `1.2.5` because of a faulty check in toxgen and will instead be considered as a new version - our resulting list of releases eligible for testing will be `[1.2.5, 1.2.2]` instead of just `[1.2.5]`, which then results in picking versions that are not nicely spaced apart
1 parent b96e2b6 commit 434e8af

File tree

2 files changed

+24
-31
lines changed

2 files changed

+24
-31
lines changed

scripts/populate_tox/populate_tox.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ def _prefilter_releases(
190190
if (
191191
version.major == saved_version.major
192192
and version.minor == saved_version.minor
193-
and version.micro > saved_version.micro
194193
):
195194
# Don't save all patch versions of a release, just the newest one
196-
filtered_releases[i] = version
195+
if version.micro > saved_version.micro:
196+
filtered_releases[i] = version
197197
break
198198
else:
199199
filtered_releases.append(version)

tox.ini

+22-29
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# The file (and all resulting CI YAMLs) then need to be regenerated via
1111
# "scripts/generate-test-files.sh".
1212
#
13-
# Last generated: 2025-04-17T11:01:25.976599+00:00
13+
# Last generated: 2025-04-23T07:46:44.042662+00:00
1414

1515
[tox]
1616
requires =
@@ -145,8 +145,8 @@ envlist =
145145

146146
# ~~~ AI ~~~
147147
{py3.9,py3.10,py3.11}-cohere-v5.4.0
148-
{py3.9,py3.11,py3.12}-cohere-v5.9.4
149-
{py3.9,py3.11,py3.12}-cohere-v5.13.9
148+
{py3.9,py3.11,py3.12}-cohere-v5.8.1
149+
{py3.9,py3.11,py3.12}-cohere-v5.11.4
150150
{py3.9,py3.11,py3.12}-cohere-v5.15.0
151151

152152
{py3.8,py3.10,py3.11}-huggingface_hub-v0.22.2
@@ -167,9 +167,8 @@ envlist =
167167
{py3.6,py3.7}-redis_py_cluster_legacy-v2.0.0
168168
{py3.6,py3.7,py3.8}-redis_py_cluster_legacy-v2.1.3
169169

170-
{py3.6,py3.7}-sqlalchemy-v1.3.9
170+
{py3.6,py3.8,py3.9}-sqlalchemy-v1.3.24
171171
{py3.6,py3.11,py3.12}-sqlalchemy-v1.4.54
172-
{py3.7,py3.10,py3.11}-sqlalchemy-v2.0.9
173172
{py3.7,py3.12,py3.13}-sqlalchemy-v2.0.40
174173

175174

@@ -195,7 +194,7 @@ envlist =
195194
{py3.8,py3.10,py3.11}-ariadne-v0.20.1
196195
{py3.8,py3.11,py3.12}-ariadne-v0.22
197196
{py3.8,py3.11,py3.12}-ariadne-v0.24.0
198-
{py3.9,py3.12,py3.13}-ariadne-v0.26.1
197+
{py3.9,py3.12,py3.13}-ariadne-v0.26.2
199198

200199
{py3.6,py3.9,py3.10}-gql-v3.4.1
201200
{py3.7,py3.11,py3.12}-gql-v3.5.2
@@ -207,7 +206,7 @@ envlist =
207206
{py3.8,py3.10,py3.11}-strawberry-v0.209.8
208207
{py3.8,py3.11,py3.12}-strawberry-v0.228.0
209208
{py3.8,py3.12,py3.13}-strawberry-v0.247.2
210-
{py3.9,py3.12,py3.13}-strawberry-v0.265.1
209+
{py3.9,py3.12,py3.13}-strawberry-v0.266.0
211210

212211

213212
# ~~~ Network ~~~
@@ -240,12 +239,11 @@ envlist =
240239

241240

242241
# ~~~ Web 1 ~~~
243-
{py3.6}-django-v1.11.9
244242
{py3.6,py3.7}-django-v1.11.29
245243
{py3.6,py3.8,py3.9}-django-v2.2.28
246244
{py3.6,py3.9,py3.10}-django-v3.2.25
247245
{py3.8,py3.11,py3.12}-django-v4.2.20
248-
{py3.10,py3.11,py3.12}-django-v5.0.9
246+
{py3.10,py3.11,py3.12}-django-v5.0.14
249247
{py3.10,py3.12,py3.13}-django-v5.2
250248

251249
{py3.6,py3.7,py3.8}-flask-v1.1.4
@@ -266,7 +264,7 @@ envlist =
266264

267265
# ~~~ Web 2 ~~~
268266
{py3.6,py3.7}-bottle-v0.12.25
269-
{py3.6,py3.8,py3.9}-bottle-v0.13.2
267+
{py3.8,py3.12,py3.13}-bottle-v0.13.3
270268

271269
{py3.6}-falcon-v1.4.1
272270
{py3.6,py3.7}-falcon-v2.0.0
@@ -296,11 +294,11 @@ envlist =
296294
# ~~~ Misc ~~~
297295
{py3.6,py3.12,py3.13}-loguru-v0.7.3
298296

299-
{py3.6}-trytond-v4.6.9
297+
{py3.6}-trytond-v4.6.22
300298
{py3.6}-trytond-v4.8.18
301299
{py3.6,py3.7,py3.8}-trytond-v5.8.16
302300
{py3.8,py3.10,py3.11}-trytond-v6.8.17
303-
{py3.8,py3.11,py3.12}-trytond-v7.0.9
301+
{py3.8,py3.11,py3.12}-trytond-v7.0.29
304302
{py3.8,py3.11,py3.12}-trytond-v7.4.9
305303

306304
{py3.7,py3.12,py3.13}-typer-v0.15.2
@@ -517,8 +515,8 @@ deps =
517515

518516
# ~~~ AI ~~~
519517
cohere-v5.4.0: cohere==5.4.0
520-
cohere-v5.9.4: cohere==5.9.4
521-
cohere-v5.13.9: cohere==5.13.9
518+
cohere-v5.8.1: cohere==5.8.1
519+
cohere-v5.11.4: cohere==5.11.4
522520
cohere-v5.15.0: cohere==5.15.0
523521

524522
huggingface_hub-v0.22.2: huggingface_hub==0.22.2
@@ -540,9 +538,8 @@ deps =
540538
redis_py_cluster_legacy-v2.0.0: redis-py-cluster==2.0.0
541539
redis_py_cluster_legacy-v2.1.3: redis-py-cluster==2.1.3
542540

543-
sqlalchemy-v1.3.9: sqlalchemy==1.3.9
541+
sqlalchemy-v1.3.24: sqlalchemy==1.3.24
544542
sqlalchemy-v1.4.54: sqlalchemy==1.4.54
545-
sqlalchemy-v2.0.9: sqlalchemy==2.0.9
546543
sqlalchemy-v2.0.40: sqlalchemy==2.0.40
547544

548545

@@ -569,7 +566,7 @@ deps =
569566
ariadne-v0.20.1: ariadne==0.20.1
570567
ariadne-v0.22: ariadne==0.22
571568
ariadne-v0.24.0: ariadne==0.24.0
572-
ariadne-v0.26.1: ariadne==0.26.1
569+
ariadne-v0.26.2: ariadne==0.26.2
573570
ariadne: fastapi
574571
ariadne: flask
575572
ariadne: httpx
@@ -589,7 +586,7 @@ deps =
589586
strawberry-v0.209.8: strawberry-graphql[fastapi,flask]==0.209.8
590587
strawberry-v0.228.0: strawberry-graphql[fastapi,flask]==0.228.0
591588
strawberry-v0.247.2: strawberry-graphql[fastapi,flask]==0.247.2
592-
strawberry-v0.265.1: strawberry-graphql[fastapi,flask]==0.265.1
589+
strawberry-v0.266.0: strawberry-graphql[fastapi,flask]==0.266.0
593590
strawberry: httpx
594591
strawberry-v0.209.8: pydantic<2.11
595592
strawberry-v0.228.0: pydantic<2.11
@@ -633,37 +630,33 @@ deps =
633630

634631

635632
# ~~~ Web 1 ~~~
636-
django-v1.11.9: django==1.11.9
637633
django-v1.11.29: django==1.11.29
638634
django-v2.2.28: django==2.2.28
639635
django-v3.2.25: django==3.2.25
640636
django-v4.2.20: django==4.2.20
641-
django-v5.0.9: django==5.0.9
637+
django-v5.0.14: django==5.0.14
642638
django-v5.2: django==5.2
643639
django: psycopg2-binary
644640
django: djangorestframework
645641
django: pytest-django
646642
django: Werkzeug
647643
django-v3.2.25: pytest-asyncio
648644
django-v4.2.20: pytest-asyncio
649-
django-v5.0.9: pytest-asyncio
645+
django-v5.0.14: pytest-asyncio
650646
django-v5.2: pytest-asyncio
651647
django-v2.2.28: six
652-
django-v1.11.9: djangorestframework>=3.0,<4.0
653-
django-v1.11.9: Werkzeug<2.1.0
654648
django-v1.11.29: djangorestframework>=3.0,<4.0
655649
django-v1.11.29: Werkzeug<2.1.0
656650
django-v2.2.28: djangorestframework>=3.0,<4.0
657651
django-v2.2.28: Werkzeug<2.1.0
658652
django-v3.2.25: djangorestframework>=3.0,<4.0
659653
django-v3.2.25: Werkzeug<2.1.0
660-
django-v1.11.9: pytest-django<4.0
661654
django-v1.11.29: pytest-django<4.0
662655
django-v2.2.28: pytest-django<4.0
663656
django-v2.2.28: channels[daphne]
664657
django-v3.2.25: channels[daphne]
665658
django-v4.2.20: channels[daphne]
666-
django-v5.0.9: channels[daphne]
659+
django-v5.0.14: channels[daphne]
667660
django-v5.2: channels[daphne]
668661

669662
flask-v1.1.4: flask==1.1.4
@@ -707,7 +700,7 @@ deps =
707700

708701
# ~~~ Web 2 ~~~
709702
bottle-v0.12.25: bottle==0.12.25
710-
bottle-v0.13.2: bottle==0.13.2
703+
bottle-v0.13.3: bottle==0.13.3
711704
bottle: werkzeug<2.1.0
712705

713706
falcon-v1.4.1: falcon==1.4.1
@@ -756,14 +749,14 @@ deps =
756749
# ~~~ Misc ~~~
757750
loguru-v0.7.3: loguru==0.7.3
758751

759-
trytond-v4.6.9: trytond==4.6.9
752+
trytond-v4.6.22: trytond==4.6.22
760753
trytond-v4.8.18: trytond==4.8.18
761754
trytond-v5.8.16: trytond==5.8.16
762755
trytond-v6.8.17: trytond==6.8.17
763-
trytond-v7.0.9: trytond==7.0.9
756+
trytond-v7.0.29: trytond==7.0.29
764757
trytond-v7.4.9: trytond==7.4.9
765758
trytond: werkzeug
766-
trytond-v4.6.9: werkzeug<1.0
759+
trytond-v4.6.22: werkzeug<1.0
767760
trytond-v4.8.18: werkzeug<1.0
768761

769762
typer-v0.15.2: typer==0.15.2

0 commit comments

Comments
 (0)