Skip to content

Pin the Python environment: requirements.in floors, generated requirements.txt lock - #192

Merged
CoffeePoweredComputers merged 1 commit into
masterfrom
lock-python-requirements
Oct 16, 2026
Merged

CoffeePoweredComputers merged 1 commit into
masterfrom
lock-python-requirements

Conversation

@CoffeePoweredComputers

Copy link
Copy Markdown
Owner

Why

requirements.txt was lower bounds only, so every image build installed whatever was newest on PyPI that day. That is how OpenAI SDK 3.x reached production unreviewed on the first deploy after its release and broke AI grading for a day (fixed by the pin in #191). Any future upstream release could do the same with no code change.

What

  • requirements.in holds the direct dependencies with their safety floors. It is the old requirements.txt with the header rewritten and one duplicate jaraco.context entry removed. Nothing installs from it.
  • requirements.txt is now generated from it by make lock, which runs uv pip compile --python-version 3.11 --universal. 110 pinned packages, resolved for the Docker image's Python with universal markers so the 3.12 CI matrix and local 3.14 install the same pins. Docker, CI, e2e, security and the README all keep installing requirements.txt unchanged.
  • CI freshness check in the lint job: recompiles without --upgrade (which keeps existing pins) and fails if requirements.txt differs, so editing requirements.in without running make lock, or hand-editing the lock, cannot land. Verified locally that a recompile is a no-op.
  • requirements.in added to the CI path filter.

Verification

  • The lock installs cleanly into a real Python 3.11 interpreter.
  • The LLM client under gevent.monkey.patch_all() against the live OpenAI endpoint returns the expected 401 with the locked openai==2.54.0, no handshake error.
  • CI on this PR is the first full run of the test suites against the locked set.

How to change a dependency from now on

Edit requirements.in, run make lock, commit both files. To pick up newer releases deliberately, run uv pip compile --upgrade (or --upgrade-package <name>) and review the diff.

🤖 Generated with Claude Code

…ments.txt lock

requirements.txt was lower bounds only, so every image build installed
whatever was newest on PyPI that day. That is how openai 3.x reached
production unreviewed and broke AI grading for a day (#191).

- requirements.in now holds the direct dependencies with their safety
  floors (the old file, header rewritten, one duplicate removed).
- requirements.txt is generated from it by `make lock` (uv pip compile,
  resolved for Python 3.11 with universal markers so the 3.12 CI matrix
  and local 3.14 install the same pins). Docker, CI, e2e and the README
  keep installing requirements.txt unchanged.
- CI's lint job recompiles without --upgrade and fails if the lock is
  stale, so editing requirements.in without running `make lock` cannot
  land.

The locked set was installed into a real Python 3.11 and the LLM client
was exercised under gevent monkey-patching: expected 401, no handshake
error.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@CoffeePoweredComputers
CoffeePoweredComputers merged commit 718662d into master Oct 16, 2026
18 checks passed
@CoffeePoweredComputers
CoffeePoweredComputers deleted the lock-python-requirements branch October 16, 2026 22:26
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.

2 participants