How to use the setupmeta.strip_dash function in setupmeta

To help you get started, we’ve selected a few setupmeta examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zsimic / setupmeta / tests / test_content.py View on Github external
def test_strip():
    assert setupmeta.strip_dash(None) is None
    assert setupmeta.strip_dash("foo") == "foo"
    assert setupmeta.strip_dash("--foo-") == "foo"
github zsimic / setupmeta / tests / test_content.py View on Github external
def test_strip():
    assert setupmeta.strip_dash(None) is None
    assert setupmeta.strip_dash("foo") == "foo"
    assert setupmeta.strip_dash("--foo-") == "foo"
github zsimic / setupmeta / tests / test_content.py View on Github external
def test_strip():
    assert setupmeta.strip_dash(None) is None
    assert setupmeta.strip_dash("foo") == "foo"
    assert setupmeta.strip_dash("--foo-") == "foo"
github zsimic / setupmeta / setupmeta / scm.py View on Github external
def parsed_version(text, dirty=None):
        if text:
            m = RE_GIT_DESCRIBE.match(text)
            if m:
                main = m.group(1)
                distance = setupmeta.strip_dash(m.group(2))
                distance = setupmeta.to_int(distance, default=0)
                commitid = setupmeta.strip_dash(m.group(3))
                if dirty is None:
                    # This is only settable via env var SCM_DESCRIBE
                    dirty = m.group(4) == "-dirty"
                return Version(main, distance, commitid, dirty, text)
        return None
github zsimic / setupmeta / setupmeta / scm.py View on Github external
def parsed_version(text, dirty=None):
        if text:
            m = RE_GIT_DESCRIBE.match(text)
            if m:
                main = m.group(1)
                distance = setupmeta.strip_dash(m.group(2))
                distance = setupmeta.to_int(distance, default=0)
                commitid = setupmeta.strip_dash(m.group(3))
                if dirty is None:
                    # This is only settable via env var SCM_DESCRIBE
                    dirty = m.group(4) == "-dirty"
                return Version(main, distance, commitid, dirty, text)
        return None