Skip to content

Install Python dependencies from hash-locked files - #329

Merged
karoltheguy merged 1 commit into
fix/sonar-mixed-cleanupfrom
fix/hash-locked-requirements
Aug 7, 2026
Merged

Install Python dependencies from hash-locked files#329
karoltheguy merged 1 commit into
fix/sonar-mixed-cleanupfrom
fix/hash-locked-requirements

Conversation

@karoltheguy

@karoltheguy karoltheguy commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Closes #305. Clears githubactions:S8544 on tests.yml and docker:S8541/S8544 on the Dockerfile.

Ranges move to requirements.in / requirements-test.in; the .txt files 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.bat stays on requirements.in: the lock is compiled on Linux with no environment markers, and its uvloop pin has no Windows wheel.

tests/test_requirements.py parsed >= lines out of requirements.txt, which the lock no longer has. Retargeted to the .in file 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 main after #328 merges, which is also what triggers its test run.

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.
@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

@codacy-production

Copy link
Copy Markdown
Contributor

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

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.

@karoltheguy
karoltheguy merged commit 37a2434 into fix/sonar-mixed-cleanup Aug 7, 2026
3 checks passed
@karoltheguy
karoltheguy deleted the fix/hash-locked-requirements branch August 7, 2026 22:43
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