Skip to content

Conversation

@almarklein
Copy link
Member

Sometimes the hardcoded __version__ and the tag reported by git mismatch. This can happen because:

  • You just bumped __version__ and did not yet create a tag.
  • You created a tag, but made a typo.
  • You are in a long-running branch, a new release was made in main, and you merged that into the branch.
    • We use --firts-parent (which I still think makes sense), but it does mean that git will report the version from which we started the branch.

Old behavior:

  • Show a warning, but this can cause tests that check logs to fail.
  • We went with the git tag, but this causes problems, e.g. when building dev wheels (flit will read the version).

New behavior:

  • Always go ith __version__.
  • Detect that 3d case above, and don't show a warning in that case.
  • Include the git-reported version info like such: '2.3.0+from_tag_2_2_1.post35.gd501006.dirty'

@almarklein almarklein merged commit 3626e6f into main Nov 10, 2025
1 check passed
@almarklein almarklein deleted the different branch November 10, 2025 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants