Skip to content

Upgrade to Python 3.12 base layer - #128

Merged
m-messer merged 1 commit into
mainfrom
python-3.12
Nov 10, 2026
Merged

m-messer merged 1 commit into
mainfrom
python-3.12

Conversation

@m-messer

@m-messer m-messer commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Moves off baseevalutionfunctionlayer:main-3.8 (Python 3.8 runtime, deprecated; the base layer has stopped building the 3.8 image).

  • app/Dockerfile: main-3.12, the same recipe as survey. yum install git becomes dnf install git findutils; also adds PYTHONPATH=/app, pytest, and CMD ["app.handler"]
  • Renamed evaluation_test.py / preview_test.py to *_tests.py. The base layer healthcheck imports evaluation_tests, which is why prod healthcheck currently reports tests_passed: false
  • sympy 1.10.1 changed to 1.12.1, because 1.10.1's parse_expr misbehaves under Python 3.12's new tokenizer. SymbolicEqual needed the same bump (feedback-messages #80)
  • Workflows now match survey's: adds test-lint.yml (runs on PRs, Python 3.12), the staging test job runs on 3.12, and run-database-tests: true on production deploy
  • Added pytest.ini

Testing (branch deployed to staging; not tested locally):

  • PR CI on 3.12: 55 passed, 3 skipped, 1008 subtests passed
  • Staging endpoint vs prod: eval and preview output identical across 6 cases, including 3! and -∞
  • Database tests on staging: 500/500 passed
  • Note: healthcheck now returns 503 on staging. With the files renamed, the base layer actually runs the full suite (1008 subtests) inside the Lambda, which takes longer than API Gateway's 30s limit. Prod answers fast only because it can't import the tests. Nothing in the platform calls healthcheck
  • TEST_API_ENDPOINT repo secret set to the comparePhysicalQuantities-staging URL so pre_production_tests.yml works

🤖 Generated with Claude Code

- Base image baseevalutionfunctionlayer:main-3.8 -> main-3.12 (AL2023: dnf git+findutils,
  PYTHONPATH, pytest for healthcheck, module-style CMD)
- Rename evaluation_test.py/preview_test.py -> *_tests.py so the base layer healthcheck can import them
- sympy 1.10.1 -> 1.12.1 for Python 3.12 tokenizer compatibility
- Workflows copied from survey (adds test-lint): Python 3.12, PR-triggered tests,
  database tests on production deploy
- Add pytest.ini

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@m-messer
m-messer merged commit 1df8c2e into main Nov 10, 2026
11 checks passed
@m-messer
m-messer deleted the python-3.12 branch November 10, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant