Revision d4d31767c31f3279381cf9cdcae74b033e71c9b3 authored by Garrett 'Karto' Keating on 29 December 2022, 23:39:31 UTC, committed by Garrett 'Karto' Keating on 29 December 2022, 23:39:31 UTC
1 parent e13c667
Raw File
# -*- mode: python; coding: utf-8 -*-
# Copyright (c) 2020 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License

"""Define branch_scheme for versioning."""

def branch_scheme(version):  # pragma: nocover
    Local version scheme that adds the branch name for absolute reproducibility.

    If and when this is added to setuptools_scm this function and file can be removed.
    if version.exact or version.node is None:
        return version.format_choice("", "+d{time:{time_format}}", time_format="%Y%m%d")
        if version.branch == "main":
            return version.format_choice("+{node}", "+{node}.dirty")
            return version.format_choice("+{node}.{branch}", "+{node}.{branch}.dirty")
back to top