0

By default, setuptools_scm (when using git) produces version numbers such as:

mytool-1.2.3.dev42+ba98765.d19700101

I would like to include the branch name. I'm not set on the exact form, but maybe like this:

mytool-1.2.3.dev42+ba98765.branchname.d19700101

I found a pull request with the name add support for branch name based testing, but it has no description or documentation. I'm not 100% sure if it does what I'm looking for. What options do I add to the [tool.setuptools_scm] section in my pyproject.toml to include branch information in the setuptools_scm-generated version?

gerrit
  • 24,025
  • 17
  • 97
  • 170
  • 1
    You might have your own use for branch names, but in practice, branch names are useless because they don't specify a particular commit (or rather, they do, but it *changes* over time). A commit hash ID or the output from `git describe` *does* specify a particular commit, and is therefore useful (forever); you should try to use that. – torek Jun 25 '21 at 08:38
  • @torek I want to include both. I don't agree with the idea that branch names are useless. I might have different feature branches, and when testing their functionality and performance, it's quite useful for human readability if in logfiles I include not only the commit ID, but also the branch name. Adding this information to the version is a straightforward way of keeping track of what approach is being tested. I've used my own implementation for years, but am now transitioning to setuptools-scm and would like to retain this information. – gerrit Jun 25 '21 at 08:54

0 Answers0