Exemple #1
0
 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:
                 dirty = m.group(4) == "-dirty"
             return Version(main, distance, commitid, dirty, text)
     return None
Exemple #2
0
def test_strip():
    assert setupmeta.strip_dash(None) is None
    assert setupmeta.strip_dash('foo') == 'foo'
    assert setupmeta.strip_dash('--foo-') == 'foo'
Exemple #3
0
def test_strip():
    assert setupmeta.strip_dash(None) is None
    assert setupmeta.strip_dash("foo") == "foo"
    assert setupmeta.strip_dash("--foo-") == "foo"