Skip to content

Refactor: populate source: settings early and unify resolver dispatch #1451

Open

Description

@LalatenduMohanty

Follow-up to the structure discussion in #1414 (see Doug's review comment).

Problem

The source: feature (#1414) supports both the new settings and the legacy settings (resolver_dist, download_source, variant pre_built / wheel_server_url, plugin hooks) at the same time. As a result, every point in the pipeline that decides how to handle a package carries its own "is there a source: config?" branch, falling back to legacy behavior locally. There are about 15 of these branches today (get_source_provider(), download_source(), build_sdist(), download_prebuilt_wheel(), package resolve, find-updates, list-versions, list-overrides, download-sequence, the bootstrap resolver, and others).

Each branch is individually correct, but every new entry point has to remember the check. That is exactly how #1407, #1408 and #1413 happened — three separate fixes for commands that each missed the configured-resolver path.

Direction

Once packages have migrated to source: settings:

  1. Populate the source: section at settings-load time. Packages with a config get their resolved (variant-merged) settings; packages without one get a synthetic default profile. Everything downstream can then rely on a valid source: existing.
  2. Replace the per-site fallback branches with a uniform handler: instantiate the handler for the profile and call one consistent API (Strategy pattern), instead of if/elif/match dispatch in each layer.

Most of the ~15 branches exist only to serve the legacy path, so they become deletions rather than rewrites at that point.

Preconditions

  • Legacy settings are deprecated (Warn users when legacy resolver settings are configured #1388) and downstream plugins/configs have moved to source:. hook-sdist / hook-prebuilt are the bridge profiles for plugins.
  • Not before 0.103.0 ships — building the handler layer now would mean writing it to accommodate legacy semantics and building it again after legacy is removed.

References

Activity

  1. LalatenduMohanty commented on Nov 4, 2026

    @LalatenduMohanty
    MemberAuthor

    Open decision: keep or drop the step commands

    They are public CLI but inefficient and unused by us (discussion). Decide here: if unified dispatch makes step parity a thin handler call, keep them; otherwise drop them (with a deprecation cycle).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions