Skip to content

Commit 0cbb9cb

Browse files
authored
ci: Update tox and handle generic classifiers (#5306)
huey has moved from version-specific classifiers like "Programming Language :: Python :: 3.13" to just "Programming Language :: Python :: 3". We use specific classifiers to figure out the concrete Python versions the package supports, and ignore the global ones, which made toxgen report that the latest huey release had no supported Python versions. Changing this so that if there are no specific classifiers and no `requires_python`, we also check for the global "Programming Language :: Python :: 3" classifier and assume the package supports all Python 3 versions in that case. In case that's not true, we fine-tune the Python versions to use via the config.
1 parent 50c790c commit 0cbb9cb

File tree

6 files changed

+146
-123
lines changed

6 files changed

+146
-123
lines changed

scripts/populate_tox/config.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,9 @@
311311
"deps": {
312312
"*": ["mockupdb"],
313313
},
314+
"python": {
315+
"<3.6": "<3.7",
316+
},
314317
},
315318
"pyramid": {
316319
"package": "pyramid",
@@ -368,6 +371,9 @@
368371
">=0.9,<0.14": ["fakeredis>=1.0,<1.7.4"],
369372
"py3.6,py3.7": ["fakeredis!=2.26.0"],
370373
},
374+
"python": {
375+
"<0.13": "<3.7",
376+
},
371377
},
372378
"sanic": {
373379
"package": "sanic",
@@ -385,6 +391,9 @@
385391
},
386392
"sqlalchemy": {
387393
"package": "sqlalchemy",
394+
"python": {
395+
"<1.4": "<3.10",
396+
},
388397
},
389398
"starlette": {
390399
"package": "starlette",

scripts/populate_tox/package_dependencies.jsonl

Lines changed: 15 additions & 13 deletions
Large diffs are not rendered by default.

scripts/populate_tox/populate_tox.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,9 @@ def pick_python_versions_to_test(
504504
- a free-threaded wheel is distributed; and
505505
- the SDK supports free-threading.
506506
"""
507+
if not python_versions:
508+
return []
509+
507510
filtered_python_versions = {
508511
python_versions[0],
509512
}
@@ -545,7 +548,8 @@ def _parse_python_versions_from_classifiers(classifiers: list[str]) -> list[Vers
545548

546549
if python_versions:
547550
python_versions.sort()
548-
return python_versions
551+
552+
return python_versions
549553

550554

551555
def determine_python_versions(pypi_data: dict) -> Union[SpecifierSet, list[Version]]:
@@ -579,6 +583,14 @@ def determine_python_versions(pypi_data: dict) -> Union[SpecifierSet, list[Versi
579583
if requires_python:
580584
return SpecifierSet(requires_python)
581585

586+
# If we haven't found neither specific 3.x classifiers nor a requires_python,
587+
# check if there is a generic "Python 3" classifier and if so, assume the
588+
# package supports all Python versions the SDK does. If this is not the case
589+
# in reality, add the actual constraints manually to config.py.
590+
for classifier in classifiers:
591+
if CLASSIFIER_PREFIX + "3" in classifiers:
592+
return SpecifierSet(f">={MIN_PYTHON_VERSION}")
593+
582594
return []
583595

584596

scripts/populate_tox/releases.jsonl

Lines changed: 37 additions & 40 deletions
Large diffs are not rendered by default.

sentry_sdk/integrations/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ def iter_default_integrations(
149149
"openai_agents": (0, 0, 19),
150150
"openfeature": (0, 7, 1),
151151
"pydantic_ai": (1, 0, 0),
152+
"pymongo": (3, 5, 0),
152153
"quart": (0, 16, 0),
153154
"ray": (2, 7, 0),
154155
"requests": (2, 0, 0),

0 commit comments

Comments
 (0)