Install Python dependencies from hash-locked files - #329
Merged
Conversation
Closes #305, clearing the four githubactions:S8544 findings on tests.yml plus docker:S8541 and docker:S8544 on the Dockerfile. Adopts the pip-compile layout Dependabot already understands: - requirements.in / requirements-test.in hold the hand-edited ranges, moved verbatim from the old .txt files. Their lower bounds are CVE floors. - requirements.txt / requirements-test.txt become the generated locks: every direct and transitive dependency pinned with == and hashed. The test lock is compiled against the base lock, so shared packages cannot drift. - Every install path passes --require-hashes, so a substituted or tampered PyPI artifact fails the install rather than executing. --only-binary :all: already kept sdist setup.py from running and stays. start.bat is the one exception and installs from requirements.in. The lock is compiled on Linux and carries no environment markers, so it pins a uvloop that has no Windows wheel. tests/test_requirements.py parsed >= lines out of requirements.txt, which the lock no longer has. It now guards both halves: the floors in requirements.in, the resolved versions in the lock, that neither lock has an unhashed pin or a surviving range, and that the two locks agree on shared packages. Verified by installing both locks with --require-hashes --only-binary :all: into a clean venv, and by building the container image and confirming it serves /login.
|
Contributor
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes #305. Clears
githubactions:S8544ontests.ymlanddocker:S8541/S8544on theDockerfile.Ranges move to
requirements.in/requirements-test.in; the.txtfiles become pip-compile locks with every dependency pinned and hashed. All install paths gain--require-hashes, so a substituted PyPI artifact fails the install instead of running.start.batstays onrequirements.in: the lock is compiled on Linux with no environment markers, and itsuvlooppin has no Windows wheel.tests/test_requirements.pyparsed>=lines out ofrequirements.txt, which the lock no longer has. Retargeted to the.infile and extended to check the lock satisfies the same CVE floors and carries no unhashed pin.Stacked on #328, so it targets that branch. Retarget to
mainafter #328 merges, which is also what triggers its test run.