summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2020-10-30 21:52:10 +0100
committerGitHub <noreply@github.com>2020-10-30 21:52:10 +0100
commit54e7879af5429baf1ce52b489bb3613939c95baa (patch)
treeed53739d196cad824c096c3fcc064cecc662cc18
parentecc2348cbfafb5e9711e06b4c2dcef5633ce0d51 (diff)
parenta3c8d93408e4f5e2da1f942e8657ebd356eb374d (diff)
downloadsetuptools-scm-54e7879af5429baf1ce52b489bb3613939c95baa.tar.gz
Merge pull request #486 from s0undt3ch/hotfix/relaxed-git-describe
Relax the default git decribe command
-rw-r--r--src/setuptools_scm/git.py2
-rw-r--r--testing/test_git.py16
2 files changed, 17 insertions, 1 deletions
diff --git a/src/setuptools_scm/git.py b/src/setuptools_scm/git.py
index afefa34..76be436 100644
--- a/src/setuptools_scm/git.py
+++ b/src/setuptools_scm/git.py
@@ -12,7 +12,7 @@ except ImportError:
from .win_py31_compat import samefile
-DEFAULT_DESCRIBE = "git describe --dirty --tags --long --match *.*"
+DEFAULT_DESCRIBE = "git describe --dirty --tags --long --match *[0-9]*"
class GitWorkdir(object):
diff --git a/testing/test_git.py b/testing/test_git.py
index 9b75ae7..3980281 100644
--- a/testing/test_git.py
+++ b/testing/test_git.py
@@ -268,6 +268,22 @@ def test_non_dotted_version(wd):
assert wd.get_version().startswith("2")
+def test_non_dotted_version_with_updated_regex(wd):
+ wd.commit_testfile()
+ wd("git tag apache-arrow-1")
+ wd.commit_testfile()
+ assert wd.get_version(tag_regex=r"^apache-arrow-([\.0-9]+)$").startswith("2")
+
+
+def test_non_dotted_tag_no_version_match(wd):
+ wd.commit_testfile()
+ wd("git tag apache-arrow-0.11.1")
+ wd.commit_testfile()
+ wd("git tag apache-arrow")
+ wd.commit_testfile()
+ assert wd.get_version().startswith("0.11.2.dev2")
+
+
@pytest.mark.issue("https://github.com/pypa/setuptools_scm/issues/381")
def test_gitdir(monkeypatch, wd):
"""