Skip to content

chore: pin requirements with hashed lock file#6

Merged
goharanwar merged 2 commits into
mainfrom
chore/add-pinned-requirements-lock
Apr 20, 2026
Merged

chore: pin requirements with hashed lock file#6
goharanwar merged 2 commits into
mainfrom
chore/add-pinned-requirements-lock

Conversation

@goharanwar

Copy link
Copy Markdown
Contributor

Summary

  • Split dependencies into requirements.in (loose constraints) and requirements.txt (pip-compile generated lock with hashes), resolved against Python 3.14.
  • Update PR validation CI to Python 3.14 and add a check that fails if requirements.txt drifts from requirements.in.
  • README: document how to regenerate the lock file.

Motivation

The platform repo's admin-ops service shells out to this test suite and currently does pip install -r requirements.txt at docker build time. Consumers that want hermetic, reproducible dependency resolution (e.g. Bazel pip.parse(requirements_lock = ...) which is how common/doc-conversion-py handles pymupdf) require a fully pinned lock file with hashes.

This change makes the suite compatible with that pattern while keeping pip install -r requirements.txt working for existing users — they just now get reproducible installs.

Test plan

  • Lock file generated with pip-compile --generate-hashes --output-file=requirements.txt requirements.in inside a python:3.14-slim container
  • pip install -r requirements.txt succeeds on Python 3.14 (verified via admin-ops Dockerfile build — 27 cp314 wheels installed cleanly)
  • Sanity smoke profile (7 tests) passes end-to-end against api.vectara.dev
  • CI "Verify requirements.txt is in sync with requirements.in" step passes on this PR (will show green on push)
  • Existing pytest collection step still passes on Python 3.14

Follow-up

Once this merges, the platform repo admin-ops PR will be updated to bump the pinned commit SHA and (in a follow-up) wire up git_repository + pip.parse so the Dockerfile no longer clones the repo or runs pip install at build time.

🤖 Generated with Claude Code

goharanwar and others added 2 commits April 18, 2026 16:53
Split dependencies into requirements.in (loose constraints) and
requirements.txt (pip-compile generated lock with hashes), resolved
against Python 3.14. CI now fails if the lock file drifts from
requirements.in.

This lets consumers (such as the admin-ops service in platform) bundle
deps via Bazel pip.parse, which requires a fully pinned lock file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two small additions that make run_tests.py work under hermetic Python
runners (e.g. Bazel py_binary) without changing standalone behavior:

1. --output-dir: optional flag controlling where pytest is invoked from
   (reports/ is written beneath it). Defaults to the test suite
   directory, matching the prior hardcoded cwd.

2. Propagate sys.path to the pytest subprocess via PYTHONPATH. This is
   a no-op for normal usage where sys.path is set by the shell's Python,
   but makes the subprocess see site-packages added by .pth files (as
   Bazel's rules_python does).

Respects an already-set PYTHONPATH in the environment — the user's
value takes precedence.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@goharanwar goharanwar force-pushed the chore/add-pinned-requirements-lock branch from 8e07b89 to 10edb73 Compare April 19, 2026 20:47
@goharanwar goharanwar merged commit d8ed9d5 into main Apr 20, 2026
3 checks passed
@goharanwar goharanwar deleted the chore/add-pinned-requirements-lock branch April 20, 2026 09:10
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