Skip to content

Reject pylock artifacts with mismatched declared sizes#20443

Draft
zanieb wants to merge 1 commit into
astral-sh:release/0.12.0from
zaniebot:zb/bughunt100/074-pylock-artifact-sizes
Draft

Reject pylock artifacts with mismatched declared sizes#20443
zanieb wants to merge 1 commit into
astral-sh:release/0.12.0from
zaniebot:zb/bughunt100/074-pylock-artifact-sizes

Conversation

@zanieb

@zanieb zanieb commented Jul 15, 2026

Copy link
Copy Markdown
Member

A pylock.toml artifact can declare an incorrect size and still install when its hash is correct, despite the pylock.toml installation specification requiring size checks when present. Validate declared sizes for local, remote, and cached wheels, source distributions, and archives before installation, while continuing to treat registry-reported sizes as advisory.

This is breaking for locks with stale sizes that were accepted by installers such as pip, which currently leaves file-size validation unimplemented. Regenerate the lock or remove the stale optional size; pre-existing cache entries without recorded sizes will refresh.

@zanieb zanieb added breaking A breaking change compatibility Compatibility with a specification or another tool labels Jul 15, 2026
@zanieb
zanieb requested a review from konstin July 15, 2026 16:25
@astral-sh-bot

This comment was marked as low quality.

@zanieb
zanieb marked this pull request as draft July 15, 2026 23:45
@zanieb

zanieb commented Jul 15, 2026

Copy link
Copy Markdown
Member Author

I need to understand this blurb about sizes in the ecosystem first.

@konstin

konstin commented Jul 16, 2026

Copy link
Copy Markdown
Member

I'm fine with checking, and I don't think it's breaking, though wrong sizes don't seem a noticeable problem to me given that we have hashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking A breaking change compatibility Compatibility with a specification or another tool

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants