Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_strip():
assert setupmeta.strip_dash(None) is None
assert setupmeta.strip_dash("foo") == "foo"
assert setupmeta.strip_dash("--foo-") == "foo"
def test_strip():
assert setupmeta.strip_dash(None) is None
assert setupmeta.strip_dash("foo") == "foo"
assert setupmeta.strip_dash("--foo-") == "foo"
def test_strip():
assert setupmeta.strip_dash(None) is None
assert setupmeta.strip_dash("foo") == "foo"
assert setupmeta.strip_dash("--foo-") == "foo"
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
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