Skip to content

add Python hash integrity docs#2964

Open
s-stumbo wants to merge 6 commits intomainfrom
python-integrity
Open

add Python hash integrity docs#2964
s-stumbo wants to merge 6 commits intomainfrom
python-integrity

Conversation

@s-stumbo
Copy link
Contributor

@s-stumbo s-stumbo commented Feb 6, 2026

[ ] Check if this is a typo or other quick fix and ignore the rest :)

Type of change

Add new section about hash verification to Python Library docs

What should this PR do?

Add content about checksum mismatches that could affect Python configurations

Why are we making this change?

Customers have reached out about this issue during migration

Signed-off-by: s-stumbo <sally.stumbo@chainguard.dev>
@netlify
Copy link

netlify bot commented Feb 6, 2026

Deploy Preview for ornate-narwhal-088216 ready!

Name Link
🔨 Latest commit 3122248
🔍 Latest deploy log https://app.netlify.com/projects/ornate-narwhal-088216/deploys/699dde405e781300075fe440
😎 Deploy Preview https://deploy-preview-2964--ornate-narwhal-088216.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Collaborator

@matthewhelmke matthewhelmke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you

@s-stumbo s-stumbo marked this pull request as ready for review February 23, 2026 20:56
@s-stumbo s-stumbo requested a review from a team as a code owner February 23, 2026 20:56
Copy link
Collaborator

@matthewhelmke matthewhelmke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useful, thank you!!
LGTM

s-stumbo and others added 5 commits February 24, 2026 09:33
Co-authored-by: angela-zhang <30538317+angela-zhang@users.noreply.github.com>
Signed-off-by: s-stumbo <100295939+s-stumbo@users.noreply.github.com>
Co-authored-by: angela-zhang <30538317+angela-zhang@users.noreply.github.com>
Signed-off-by: s-stumbo <100295939+s-stumbo@users.noreply.github.com>
Co-authored-by: angela-zhang <30538317+angela-zhang@users.noreply.github.com>
Signed-off-by: s-stumbo <100295939+s-stumbo@users.noreply.github.com>
Signed-off-by: s-stumbo <sally.stumbo@chainguard.dev>
Signed-off-by: s-stumbo <sally.stumbo@chainguard.dev>
Copy link
Member

@mosabua mosabua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start but I think we need to flesh out what actually needs to be done with actual steps for each packaging tool and also keep in mind specific uses like pip with and without lock file.

Also .. we need to clarify more how to avoid using of cached packages .. not just in the repo manager but also locally on dev machines and in CI/CD clusters potentially.

can expect different checksums for the same package version when migrating from
upstream PyPI to Chainguard Libraries:

- Tools such as `pip` enforce hashes when using `--require-hashes` or when hashes are pinned in requirements.txt files
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it enforces hash verification (between lock file and downloaded file) .. not "enforce hashes" .. I am not sure what that even means

upstream PyPI to Chainguard Libraries:

- Tools such as `pip` enforce hashes when using `--require-hashes` or when hashes are pinned in requirements.txt files
- Tools such as `Poetry` and `uv` generate lock files that include SHA-256 hashes and will fail if checksums don't match
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that also the case for pip ?

Also dont use future "will fail" and detail what actually fails


- Tools such as `pip` enforce hashes when using `--require-hashes` or when hashes are pinned in requirements.txt files
- Tools such as `Poetry` and `uv` generate lock files that include SHA-256 hashes and will fail if checksums don't match
- Systems such as JFrog Artifactory or Nexus may have cached upstream PyPI wheels and continue serving them until caches are cleared
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Systems such as JFrog Artifactory or Nexus may have cached upstream PyPI wheels and continue serving them until caches are cleared
- Repository managers such as JFrog Artifactory or Sonatype Nexus may have cached upstream wheels and continue serving them until caches are cleared

Sure but that might or might not have an effect on their use .. so what are we saying here


## Hash verification when migrating to Chainguard Libraries

Because Chainguard rebuilds from source, there are some circumstances where you
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think checksums will be different in nearly all circumstances at least for Python so you might need to reword


### Resolving checksum mismatches

>Note: Before regenerating lock files, ensure your tool is configured to use Chainguard as the package index by following the [global configuration](chainguard/libraries/python/global-configuration/) or [direct access](/chainguard/libraries/python/build-configuration/#direct-access) documentation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not worth making a note of this .. jsut use a normal sentence


>Note: Before regenerating lock files, ensure your tool is configured to use Chainguard as the package index by following the [global configuration](chainguard/libraries/python/global-configuration/) or [direct access](/chainguard/libraries/python/build-configuration/#direct-access) documentation.

To resolve hash mismatches, re-resolve your dependencies against Chainguard Libraries:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolve twice sound weird .. also I think we need to reword this along the lines of adjusting to the new checksum values and updating the lock files so build dont fail.


To resolve hash mismatches, re-resolve your dependencies against Chainguard Libraries:

- For `--require-hashes`: install from Chainguard indexes, and then regenerate the requirements file with new hashes so they match Chainguard wheels.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The requirements file stays the same .. the lock file has to be changed


To resolve hash mismatches, re-resolve your dependencies against Chainguard Libraries:

- For `--require-hashes`: install from Chainguard indexes, and then regenerate the requirements file with new hashes so they match Chainguard wheels.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also .. don't use the term "Chainguard indexes" or "Chainguard wheels" ..

use Chainguard Libraries for Python as product name or just talk about the indexes maybe

and instead of wheels talk about Python packages (since we also do sdists and so)

- For `uv`, Poetry, or other tools that generate lockfiles: Point them at Chainguard indexes, and then regenerate the lockfile so stored hashes correspond to Chainguard artifacts.
- For repository managers: You may also need to clear cached PyPI artifacts to ensure future installs pull Chainguard's versions.

>**Note:** While hash mismatches from are expected for some tooling and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from what?

A Sigstore bundle is a self‑contained JSON file that packages everything needed
to verify the authenticity and integrity of a signed artifact.

A [Sigstore bundle file](https://docs.sigstore.dev/about/bundle/) is available
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move that link up to first sentence I guess

@ltagliaferri ltagliaferri requested review from a team and removed request for a team February 27, 2026 18:15
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.

4 participants