[DE-7720] Bump minimum Python to 3.10 and patch all dependency CVEs#458
Open
[DE-7720] Bump minimum Python to 3.10 and patch all dependency CVEs#458
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bumps the minimum supported Python version from 3.7 to 3.10 (now supports 3.10–3.14) so we can adopt patched versions of our locked dependencies. The patched releases of
aiohttp,urllib3,requests,Pillow,numpy,setuptools, and others now require Python ≥ 3.10, so we couldn't pull them in while still supporting 3.7–3.9.This is the headline reason for the bump: it unblocks the dependency upgrades that resolve all current Trivy findings for this repo.
Why
Local Trivy scan before this PR: 48 vulnerabilities (1 CRITICAL, 11 HIGH, 22 MEDIUM, 14 LOW), including:
(See https://linear.app/scale-epd/issue/DE-7720 for file of all vulns)
requests,numpy,idna,certifi,marshmallow,pygments,tqdm,zipp,scikit-learnLocal Trivy scan after this PR: 0 vulnerabilities. See
.trivy/fs.txtfor the clean run (.trivy/fs-strict.txtshows the original findings).Python 3.7, 3.8, and 3.9 are all past upstream end-of-life (2023-06-27, 2024-10-07, and 2025-10-31 respectively) and no longer receive security patches even from CPython itself.
What's in this PR
pyproject.tomlnow requirespython = ">=3.10,<4.0".poetry.lock).[3.10, 3.11]to[3.10, 3.11, 3.12, 3.13, 3.14]so every supported Python version is exercised on every PR. The matrix builds the sdist, installs it (no extras,[metrics],[launch], and[metrics, launch]), and smoke-testsimport nucleuson each Python version.@pytest.mark.*decorators on fixtures into hard errors. Removed/converted no-op fixture marks acrosstests/cli/conftest.py,tests/validate/conftest.py,tests/test_scene.py, andtests/test_video_scene.py.np.float_andnp.float(both removed in modern NumPy) withnp.float64innucleus/metrics/segmentation_utils.pyandnucleus/metrics/segmentation_metrics.py.E0606,W3101,R1737,R1728,C3001,C3002,W0719), pylint disables updated (+R0913,-R0201),blackre-applied. One exception was made more specific.poetry run mypy --ignore-missing-imports nucleusnow reportsSuccess: no issues found in 76 source files. Notable user-visible adjustments:DatasetItem.reference_idis now typedOptional[str](still required at runtime via__post_init__assertion); the internal"DUMMY_VALUE"sentinel is gone.nucleus/async_utils.pywraps timeouts inaiohttp.ClientTimeout(total=...).NucleusClient.list_autotagsalways returns alistregardless of response shape.0.18.0with a CHANGELOG entry.Impact / risk
pip install scale-nucleus==0.18.0fail with a clear version-requirement error (no silent breakage).DatasetItem.reference_id's type — the previous docstring already declared itOptional[str], so this aligns the type with the documented contract.Verification
make scan— 0 Trivy findings (.trivy/fs.txt).poetry run mypy --ignore-missing-imports nucleus—Success: no issues found in 76 source files.poetry run ruff ./poetry run pylint nucleus/poetry run isort --check-only .— clean.poetry run pytest --collect-only tests/— collects cleanly under pytest 9 with no fixture-mark errors.Linear
DE-7720
Greptile Summary
This PR bumps the minimum Python version from 3.7 to 3.10 and refreshes all locked dependencies to resolve 48 Trivy CVEs (including a critical Pillow RCE and high-severity aiohttp/urllib3/setuptools findings). Alongside the version bump, it fixes NumPy 2.x compatibility (
np.float_→np.float64), wraps aiohttp timeouts inClientTimeout, resolves pytest 9 fixture-mark collection errors, and applies mypy/pylint/black cleanup throughout.Confidence Score: 5/5
Safe to merge — all changes are correct compatibility and security fixes with no functional regressions.
No P0 or P1 issues found. All changes are either formatting-only, legitimate security/compatibility upgrades, or well-understood type-annotation corrections. The aiohttp timeout fix, NumPy dtype replacements, pytest 9 fixture adjustments, and cuboid_utils NameError pre-init are all correct. CI matrix expansion exercises 3.10–3.14. Trivy reports 0 findings post-merge.
No files require special attention.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Python >=3.10 requirement] --> B[Unlocks patched deps] B --> C1[aiohttp ^3.10 - path-traversal CVEs fixed] B --> C2[Pillow >=12.2.0 - RCE CVE-2023-50447 fixed] B --> C3[urllib3/requests/numpy - security patches] B --> C4[setuptools/boto3 - RCE / other CVEs fixed] A --> D[Code compatibility fixes] D --> D1[NumPy 2.x - np.float_ to np.float64] D --> D2[aiohttp ClientTimeout - wrap scalar timeout] D --> D3[pytest 9 - remove marks on fixtures] D --> D4[mypy/pylint/black - type and style cleanup]Reviews (2): Last reviewed commit: "Update CHANGELOG.md to include recent co..." | Re-trigger Greptile