Migrate production container to Python 3.13 - #1141
Conversation
| --only-binary=numpy,pandas \ | ||
| --constraint /pkg/constraints/container-python313.txt \ | ||
| /pkg | ||
|
|
There was a problem hiding this comment.
@ebhills Change --only-binary=numpy,pandas to --only-binary=:all: so the wheel-only guarantee covers every dependency the compiler-less image relies on; a future wheel gap then fails the build with a clear "no matching distribution" error instead of silently needing a compiler that no longer exists.
| "<3.0" in pandas_requirements[0], | ||
| f"Wrangles metadata must exclude Pandas 3: {pandas_requirements[0]}", | ||
| ) | ||
|
|
There was a problem hiding this comment.
@ebhills Replace the manual string matching with packaging.requirements.Requirement: filter requirements by Requirement(r).name.lower() == "pandas", then check specifier.contains("2.999") and not specifier.contains("3.0") on the resulting SpecifierSet instead of substring-matching "<3.0".
|
|
||
|
|
||
| def test_s3_model_loads_without_network(): | ||
| container_smoke.validate_s3_model() |
There was a problem hiding this comment.
@ebhills Add a negative-path test that patches pandas.testing.assert_frame_equal to raise and asserts validate_data_round_trip propagates it; for the S3 test, use pytest-mock to patch socket.create_connection to raise on any call and assert it's never invoked, proving the "no network" claim structurally.
| ) | ||
| pandas_tests = Path(pandas_package) / "tests" | ||
| _require(not pandas_tests.exists(), f"Pandas tests were not removed: {pandas_tests}") | ||
|
|
There was a problem hiding this comment.
@ebhills Add _require(Path(botocore_data).exists(), f"Botocore data directory not found: {botocore_data}") immediately before the iterdir() call, matching the module's existing _require-based error convention.
| --no-cache-dir \ | ||
| --constraint constraints/container-python313.txt \ | ||
| --requirement requirements-full.txt \ | ||
| pytest==9.0.2 pytest-mock==3.15.1 |
There was a problem hiding this comment.
@ebhills Add --only-binary=:all: to this pip install call, mirroring the fix applied to the Dockerfile's production install, so a missing wheel surfaces as a clear pip resolution error instead of a confusing compiler-not-found failure.
Linked issue
Closes #1131
What changes
python:3.13-slim-bookworm.pandas==2.3.3andnumpy==2.4.6. The reusable package contract remainspandas>=2.0,<3.0, so Pandas 3 is still prohibited.pip check,pip freeze, and image-size reporting.This is a Python 3.13 / Pandas 2.3.3 compatibility bridge. It does not add Pandas 3 support or change the supported Python 3.11-3.13 package range.
How it was verified
CI run 80 passed in full.
Exact Linux pull-request image:
pandas<3.0; Pandas 3 rejection, S3-only Botocore data, removed pandas tests, and compiler absence all passed.python -m pip checkreported no broken requirements;pip freezewas captured in the job log.fork()deprecation warning; no pandasFutureWarningorDeprecationWarningwas reported.latestsize on the same runner and measurement: 697,999,438 bytes (665.66 MiB).Other CI and local evidence:
python -m pip check, Python compilation, workflow YAML parsing, shell syntax, line-ending, and diff checks passed.Not yet claimed:
latestimage cannot occur until merge.Compatibility and risk
>=2.0,<3.0; Python 3.11 and 3.12 support are not removed.latestafter the immutable candidate passes its container tests.Ready-for-review checklist
mainand has no unrelated commits