Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
setuptools-git-versioning 3.1.0
setuptools-git-versioning 3.1.0
  • Comparison with other tools

How to

  • Install
  • Console command
  • CI configuration
  • Retrieving package version at runtime
  • Supporting git archive builds
  • Versioning schemas
    • Tag-based release (not recommended)
      • Release is a git tag
      • Post release
      • Dirty version
    • File-based release (recommended)
      • Read some file content as current version
      • Development releases (prereleases) from dev branch
      • Development releases from any branch
      • Development releases using only branch name
    • Callback-based release (advanced)
      • Execute some callback function to get current version
  • Config options
    • enabled
    • starting_version
    • template
    • dev_template
    • dirty_template
    • version_file
    • count_commits_from_version_file
    • version_callback
    • sort_by
    • branch_formatter
    • tag_formatter
    • tag_filter
  • Template substitutions
    • tag
    • ccount
    • sha
    • full_sha
    • branch
    • env
    • timestamp
  • Common issues
    • Every version built by CI is dirty
    • Wrong tag ordering/latest tag number detection
    • Sphinx usage

Develop

  • Changelog
    • 3.1.x
    • 3.0.x
    • 2.1.x
    • 2.0.x
    • 1.13.x
    • 1.12.x
    • 1.11.x
    • 1.10.x
    • 1.9.x
    • 1.8.x
    • 1.7.x
    • 1.6.x
    • 1.5.x
    • 1.4.x
    • 1.3.x
    • 1.2.x
    • 1.1.x
  • Contributing Guide

Project Links

  • Source Code
  • CI/CD
  • Issue Tracker
Back to top
View this page

template¶

Version number template for Release is a git tag versioning schema.

Used if no untracked files and current commit is tagged.

Note

This option is completely ignored if Execute some callback function to get current version schema is used, because git commit history is not fetched in such a case.

Type¶

str

Default value¶

"{tag}"

Possible values¶

Any string which produces PEP 440 compliant version number after substituting all necessary values.

See Template substitutions

Next
dev_template
Previous
starting_version
Copyright © 2020-present, dolfinus
Made with Sphinx and @pradyunsg's Furo
Last updated on Jan 16, 2026
On this page
  • template
    • Type
    • Default value
    • Possible values