Skip to content

Incorrect version when running on a tag #1238

@greatvovan

Description

@greatvovan

I feel like I am missing something obvious because the most straightforward functionality is not working for me... But let's have a look.

Originally I experienced the issue in GitHub Actions pipeline, but eventually I could isolate it in local environment.

My repository is on tag v0.1.1:

git tag -l v0.1.1 -n
v0.1.1          Enable publish

git describe --tags --long
v0.1.1-0-ge6b9e0f

git status
HEAD detached at v0.1.1
nothing to commit, working tree clean

python -m setuptools_scm     
0.1.1

But:

python -m build
...
creating ios_backup_browser-0.1.2.dev0+ge6b9e0fc2.d20251128
...

So the version being produced in build is not clean and not uploadable to PyPI.

Having SETUPTOOLS_SCM_OVERRIDES_FOR_IOS_BACKUP_BROWSER='{local_scheme = "no-local-version"}' does not help, however, SETUPTOOLS_SCM_PRETEND_VERSION_FOR_IOS_BACKUP_BROWSER does (which I used as temporary workaround).

It may be important to note that syntax for the override differs from the documentation. Specifically, "Environment Variable Format" section instructs to use inline TOML while the provided example shows JSON{"local_scheme": "no-local-version"}. Such a value causes build to fail with InvalidTomlError. I converted it to TOML {local_scheme = "no-local-version"} which technically succeeded, but it's hard to say if it was right format, because it still did not have effect.

Please suggest how to properly leverage the module. Using PRETEND_VERSION seems like a pretty invasive hack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions