Skip to content

ScmVersion is wrong if two tags are on the same git-commit #1079

@jenisys

Description

@jenisys

If two tags are assigned to the same git-commit, setuptools-scm seems to get confused (especially if the secondary tag contains digits or ends with digits).

How to repeat

  • Use a python-project repository that uses setuptools-scm
# -- BASH SHELL (or similar):
$ git tag v1.2.3
$ python -msetuptools_scm
1.2.3
# OR: 1.2.4.dev0+gd... - If DIRTY

# -- CASE: Secondary tag with digits -- SYNDROME HERE
$ git tag BASELINE_D2024-10-03
$ python -msetuptools_scm
3

# -- CASE: Secondary tag without any digits -- OK
# CLEANUP: First remove last secondary tag.
$ git tag --delete BASELINE_D2024-10-03
$ git tag BASELINE
$ python -msetuptools_scm
1.2.3
# OR: 1.2.4.dev0+gd... - If DIRTY

RELATED:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions