https://github.com/RadioAstronomySoftwareGroup/pyuvdata
Revision 90f45e66bca52b910e00008a3db4e0b886d5e46b authored by pyxieloustar on 20 August 2020, 18:41:43 UTC, committed by Bryna Hazelton on 20 August 2020, 20:02:55 UTC
1 parent 433be31
Raw File
Tip revision: 90f45e66bca52b910e00008a3db4e0b886d5e46b authored by pyxieloustar on 20 August 2020, 18:41:43 UTC
edit docstring
Tip revision: 90f45e6
branch_scheme.py
# -*- 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")
    else:
        if version.branch == "master":
            return version.format_choice("+{node}", "+{node}.dirty")
        else:
            return version.format_choice("+{node}.{branch}", "+{node}.{branch}.dirty")
back to top