Skip to content

Patched Git checkouts can change the package version #1447

Open

Description

@LalatenduMohanty

From the #1414 review: #1414 (comment)

What happens

With a *-git provider, fromager clones a tag and then changes files in the checkout (patches, project overrides, Rust vendoring).

If the package reads its version from Git (for example, setuptools-scm), these changes make the version look different. Tag v1.1 builds as something like 1.2.dev0+g<hash>, so the sdist fails the version check.

Expected

The sdist and wheel use the resolved version (1.1), whether or not fromager changed files in the checkout. A Git source should build the same version as an archive source.

Notes

  • Archives aren't affected: they have no .git.
  • The current workaround is to set SETUPTOOLS_SCM_PRETEND_VERSION_FOR_<NAME>: "${__version__}" for each package.

Not a blocker for #1414: only source: Git providers are affected. It should be fixed before 0.103.0, since patching Git sources is common.

Activity

  1. self-assigned this
    on Nov 4, 2026
  2. smoparth commented on Nov 4, 2026

    @smoparth
    Contributor

    I couldn't find a build-backend-independent way for Fromager to force the resolved version. For a setuptools-scm package whose Git checkout changes during preparation, the package settings should use SETUPTOOLS_SCM_PRETEND_VERSION_FOR_<DIST_NAME>: "${version}". Can we document this for the *-git profiles, then close this issue as a package-specific configuration requirement.
    cc: @LalatenduMohanty , @tiran , @rd4398

  3. rd4398 commented on Nov 4, 2026

    @rd4398
    Contributor

    4. I couldn't find a build-backend-independent way for Fromager to force the resolved version. For a setuptools-scm package whose Git checkout changes during preparation, the package settings should use SETUPTOOLS_SCM_PRETEND_VERSION_FOR_<DIST_NAME>: "${version}". Can we document this for the *-git profiles, then close this issue as a package-specific configuration requirement.
    cc: @LalatenduMohanty , @tiran , @rd4398

    I am okay with documenting this for now and moving on.

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

Metadata

Metadata

Assignees

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