diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/setuptools_scm/__init__.py | 2 | ||||
-rw-r--r-- | src/setuptools_scm/config.py | 1 | ||||
-rw-r--r-- | src/setuptools_scm/git.py | 5 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/setuptools_scm/__init__.py b/src/setuptools_scm/__init__.py index 1a39ac0..f49cce4 100644 --- a/src/setuptools_scm/__init__.py +++ b/src/setuptools_scm/__init__.py @@ -121,6 +121,7 @@ def get_version( relative_to=None, tag_regex=None, parse=None, + git_describe_command=None, ): """ If supplied, relative_to should be a file from which root may @@ -138,6 +139,7 @@ def get_version( config.relative_to = relative_to config.tag_regex = tag_regex config.parse = parse + config.git_describe_command = git_describe_command parsed_version = _do_parse(config) diff --git a/src/setuptools_scm/config.py b/src/setuptools_scm/config.py index f62f467..796dd0b 100644 --- a/src/setuptools_scm/config.py +++ b/src/setuptools_scm/config.py @@ -61,6 +61,7 @@ class Configuration(object): self.write_to_template = None self.parse = None self.tag_regex = DEFAULT_TAG_REGEX + self.git_describe_command = None @property def absolute_root(self): diff --git a/src/setuptools_scm/git.py b/src/setuptools_scm/git.py index 8a91ff3..91644c7 100644 --- a/src/setuptools_scm/git.py +++ b/src/setuptools_scm/git.py @@ -101,9 +101,12 @@ def parse( if pre_parse: pre_parse(wd) + if config.git_describe_command: + describe_command = config.git_describe_command + out, unused_err, ret = wd.do_ex(describe_command) if ret: - # If 'git describe' failed, try to get the information otherwise. + # If 'git git_describe_command' failed, try to get the information otherwise. rev_node = wd.node() dirty = wd.is_dirty() |