[pull] main from astral-sh:main#54
Merged
Merged
Conversation
## Summary When parsing a registry's simple index, entries that aren't valid wheel or source-distribution filenames are skipped silently except for an opaque `Skipping file for <pkg>: <name>` debug line that gives no reason. This makes it hard to diagnose registries that serve non-distribution entries (for example devpi index-management links like `+searchhelp`, bare version-directory links, or files with unrecognized extensions). This adds `DistFilename::try_from_filename_with_reason`, which returns a typed `DistFilenameError` explaining why a filename was rejected (no recognized extension, invalid wheel, or invalid source dist). The existing `try_from_filename` is kept as a thin `.ok()` wrapper, and the two skip sites in `registry_client.rs` now log the reason alongside the filename. ## Test Plan Added unit tests in `crates/uv-distribution-filename/src/lib.rs` covering: - a bare version string (`0.1.0`) → `NoRecognizedExtension`, - an empty filename → `NoRecognizedExtension`, - a `.whl` with an otherwise-invalid name → `InvalidWheel`, - a valid wheel still parses via `try_from_filename`. Run with `cargo test -p uv-distribution-filename`. ## AI assistance notice Disclosing in the interest of transparency: this change was prepared with the help of an AI coding assistant and reviewed before submission. If that conflicts with the project's contribution policy, please feel free to close it.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )