Skip to content

refactor: pypi mapping module so that its a bit more logically named#6302

Merged
baszalmstra merged 2 commits into
prefix-dev:mainfrom
tdejager:push-ntypnqovnmlr
Jun 9, 2026
Merged

refactor: pypi mapping module so that its a bit more logically named#6302
baszalmstra merged 2 commits into
prefix-dev:mainfrom
tdejager:push-ntypnqovnmlr

Conversation

@tdejager

@tdejager tdejager commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description

This does a large-scale refactor of the pypi mapping module, I found it was a bit hard to reason about and the types were a bit scattered. This centralizes the different mapping resolvers and does a rename of a lot of of different structs and methods. The functionality has remained identical.

Biggest changes:

  • Reorganized the crate around explicit purl derivation concepts:
    • PurlDerivationClient
    • PurlDerivationMode
    • PurlDerivationSource
    • ProjectDefinedMappingLocation
  • Centralized the concrete resolver implementations under resolvers/:
    • project_defined_mapping.rs
    • prefix_hash_resolver.rs
    • prefix_compressed_resolver.rs
    • conda_forge_verbatim.rs
  • Renamed ambiguous mapping/client types:
    • MappingClient → PurlDerivationClient
    • MappingSource → PurlDerivationMode
    • MappingLocation → ProjectDefinedMappingLocation
    • CustomMapping → ProjectDefinedMapping
    • MappingLocation::Memory → ProjectDefinedMappingLocation::InMemory
  • Replaced the generic DerivePurls trait with explicit resolver methods.
  • Introduced DerivationOutcome to make the distinction between “not applicable”, “known no purls”, and “derived purls” explicit.
  • Moved shared helpers into their own modules.

How Has This Been Tested?

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Codex with Pi

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@tdejager tdejager requested a review from baszalmstra June 8, 2026 18:04
@tdejager tdejager force-pushed the push-ntypnqovnmlr branch from a4166cc to 7f49231 Compare June 9, 2026 08:06
@tdejager tdejager force-pushed the push-ntypnqovnmlr branch from 7f49231 to 33e3dbe Compare June 9, 2026 08:12
@tdejager tdejager marked this pull request as ready for review June 9, 2026 08:12
@baszalmstra baszalmstra merged commit d83e918 into prefix-dev:main Jun 9, 2026
38 checks passed
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.

2 participants