Skip to content

Upgrade to Python 3.12 base layer - #80

Merged
m-messer merged 4 commits into
masterfrom
python-3.12
Nov 10, 2026
Merged

m-messer merged 4 commits into
masterfrom
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"]
  • sympy 1.10.1 changed to 1.12.1 for Python 3.12 tokenizer compatibility (fixes 3! factorial parsing)
  • Kept the singular evaluation_test.py / preview_test.py names. These are pytest-style classes, and the base layer's unittest healthcheck can't run them; CI collects them via pytest.ini
  • Workflows now match survey's: Python 3.12, deploy.yml@main instead of @deploy-request (main already contains everything from it), and run-database-tests: true on production deploy
  • Staging deploy now triggers on master (the repo's default branch; it used to trigger on main). The production branch input now defaults to master
  • Added pytest.ini and updated the README Python version

Merge #81 into this branch first. It fixes the last 3.12 test failure (-∞ with strict syntax).

Testing (the branch, together with #81, deployed to staging; not tested locally):

  • PR CI on 3.12: 552 passed, once Reject non-identifier symbols on Python 3.12 (stacked on #80) #81 is included
  • Staging endpoint vs prod: eval and preview output identical across 6 cases, including 3! and -∞
  • Database tests on staging (500 sampled submissions): 499 passed, 0 grade mismatches, 1 network 503 (a heavy e^(-x)(A cos x + B sin x) case hit the 30s gateway limit). The harness then crashed while saving its 495 feedback-text warnings to Firestore (an empty-key bug in Database-Testing). Warnings at that level are normal (compareExpressions logs thousands)
  • TEST_API_ENDPOINT repo secret set to the symbolicEqual-staging URL so pre_production_tests.yml works

🤖 Generated with Claude Code

m-messer and others added 2 commits November 9, 2026 15:30
- 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
- Workflows copied from survey: Python 3.12, deploy.yml@main, PR-triggered test-lint,
  database tests on production deploy; staging/production target master (default branch)
- Add pytest.ini

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sympy 1.10.1's parse_expr mishandles '!' (factorial) and some unicode tokens under
Python 3.12's new tokenize module (PEP 701), failing test_exclamation_mark_for_factorial
and test_error_inappropriate_symbol[-inf].

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
m-messer and others added 2 commits November 9, 2026 17:14
These are pytest-style test classes; under the *_tests.py names the base layer's
unittest-based healthcheck imports and instantiates them and errors with
'TestEvaluationFunction() takes no arguments'. CI still collects them via pytest.ini.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reject non-identifier symbols on Python 3.12 (stacked on #80)
@m-messer
m-messer merged commit cdac78c into master Nov 10, 2026
1 check passed
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