Skip to content

Pass download_kind to prepare_source overrides and document the archive name for source: packages #1442

Open

Description

@LalatenduMohanty

From the #1414 review: #1414 (comment)

Two parts of the plugin contract change when a package with plugin hooks moves to source:, and the plugin isn't told.

1. prepare_source overrides don't know the source kind

sources.prepare_source() receives download_kind, but doesn't pass it to prepare_source overrides. With a *-git provider, an override written for archives receives a Git checkout directory and can't tell.

Proposed fix: pass download_kind to the override. Existing hooks are not affected, because overrides.invoke() drops keyword arguments that a hook doesn't accept.

2. expected_source_archive_name must return the new name

Configured downloads save archives as {canonical name}-{version} (#1438). If an expected_source_archive_name hook returns another spelling (for example zope_event-1.0.tar.gz), find_sdist() looks only for that exact file and doesn't find it.

Proposed fix: document the canonical archive name for hook authors using source:. Optionally, fall back to the usual spelling variants when the hook's file is missing.

Scope

This only affects packages that have these hooks and use source:. Packages without source: are unchanged. It is not a blocker for #1414.

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