Skip to content

Require hash completion for pylock.toml exports - #1037

Draft
zaniebot wants to merge 1 commit into
mainfrom
zb/pylock-export-finalization
Draft

zaniebot wants to merge 1 commit into
mainfrom
zb/pylock-export-finalization

Conversation

@zaniebot

@zaniebot zaniebot commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

pylock.toml exporters currently need to call generate_missing_hashes separately, so a future caller could serialize an incomplete export. Return PylockTomlExport from the export constructors and require its consuming finish step before exposing the serializable value. Project export retains lazy client construction, and pip compilation reuses its existing client. Hashing, diagnostics, and import behavior are unchanged. This follows up on the API concern in astral-sh#20146.

@astral-automations-bot astral-automations-bot Bot added internal A refactor or improvement that is not user-facing preview Experimental behavior labels Sep 9, 2026
@zaniebot zaniebot added priority:4 Low: worthwhile tests, refactors, or maintenance with modest immediate benefit. size:2 Moderate: one subsystem with meaningful invariants, edge cases, or operational evidence to inspect. risk:1 Negligible risk of localized mistakes that are obvious and easy to correct. labels Sep 9, 2026
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/pylock-export-finalization branch from f57c531 to 0e3604f Compare September 15, 2026 01:23
@codspeed

codspeed Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 8 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 69 untouched benchmarks
⏩ 35 skipped benchmarks1


Comparing zb/pylock-export-finalization (62a6202) with main (8a78ac6)

Open in CodSpeed

Footnotes

  1. 35 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/pylock-export-finalization branch from 0e3604f to 45012f1 Compare September 16, 2026 12:04
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/pylock-export-finalization branch 2 times, most recently from e548de8 to b318cc0 Compare September 30, 2026 01:50
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/pylock-export-finalization branch 2 times, most recently from 35312ef to d4028b3 Compare October 7, 2026 22:29
@zaniebot zaniebot added the project:maintainer-followups Maintainer follow-up work label Oct 9, 2026
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/pylock-export-finalization branch from d4028b3 to 62a6202 Compare October 15, 2026 13:19
mut self,
client: impl FnOnce() -> Result<Client, Error>,
concurrency: usize,
output_dir: &Path,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[P3] Retain the path base in the pending export

Both constructors already use the supplied directory to encode relative artifact paths, but finish requires callers to supply that same directory again. For a relative artifact needing a hash, a different directory makes hash_source read the wrong file or fail. Both current callers pass matching directories, so this is an API maintenance hazard rather than a current command regression. Store the constructor’s path base in PylockTomlExport and use it during finalization, removing the repeated parameter.

This branch was successfully deployed

1 active deployment
automations — fa4a038f Deployed Oct 18, 2026 by astral-automations-bot[bot] via review-code-quality / report #10965
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal A refactor or improvement that is not user-facing preview Experimental behavior priority:4 Low: worthwhile tests, refactors, or maintenance with modest immediate benefit. project:maintainer-followups Maintainer follow-up work risk:1 Negligible risk of localized mistakes that are obvious and easy to correct. size:2 Moderate: one subsystem with meaningful invariants, edge cases, or operational evidence to inspect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants