refactor(versionmap): Version-only keys, Mapping API, and iter_pairs#997
refactor(versionmap): Version-only keys, Mapping API, and iter_pairs#997vshawrh wants to merge 1 commit intopython-wheel-build:mainfrom
Conversation
- Subclass collections.abc.Mapping with Version keys only (no str coercion) - Add iter_pairs() for descending (version, value) iteration - Use iter_pairs in VersionMapProvider.find_candidates - Reject non-Version keys with TypeError Closes: python-wheel-build#986 Made-with: Cursor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe pull request refactors Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
What
VersionMaptopackaging.version.Versionkeys only (no string coercion or parsing inside the map).iter_pairs()to yield(version, value)in descending version order.collections.abc.Mapping(__getitem__,__iter__,__len__); mutations stay onadd().iter_pairs()inVersionMapProvider.find_candidates.Version(...)keys and cover invalid keys plus basicMappingbehavior.Why
Breaking change: code that constructed
VersionMapwith string keys must switch toVersion("…").Closes #986