summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2020-01-19 13:01:54 +0100
committerRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2020-01-19 13:01:54 +0100
commit8b8a6d622bbec52f30069ce6a899d936a9dde116 (patch)
treef94ade9238b49878ae07678b3423c41c3d0acc4d
parent823c3acac310aab86a57e4a26405db2a7296164a (diff)
downloadsetuptools-scm-8b8a6d622bbec52f30069ce6a899d936a9dde116.tar.gz
fix #395: correctly transfer tag regex in the Configuration constructorfix-395-pass-in-tag-regex
-rw-r--r--CHANGELOG.rst5
-rw-r--r--src/setuptools_scm/config.py2
-rw-r--r--testing/test_config.py8
3 files changed, 13 insertions, 2 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 8545f4f..5267e2b 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,3 +1,8 @@
+v3.4.2
+======
+
+* fix #395: correctly transfer tag regex in the Configuration constructor
+
v3.4.1
======
diff --git a/src/setuptools_scm/config.py b/src/setuptools_scm/config.py
index 7dee1e4..139512d 100644
--- a/src/setuptools_scm/config.py
+++ b/src/setuptools_scm/config.py
@@ -66,7 +66,7 @@ class Configuration(object):
self.fallback_version = fallback_version
self.fallback_root = fallback_root
self.parse = parse
- self.tag_regex = DEFAULT_TAG_REGEX
+ self.tag_regex = tag_regex
self.git_describe_command = git_describe_command
@property
diff --git a/testing/test_config.py b/testing/test_config.py
index 38bc8f4..b8ea265 100644
--- a/testing/test_config.py
+++ b/testing/test_config.py
@@ -1,7 +1,7 @@
from __future__ import unicode_literals
from setuptools_scm.config import Configuration
-
+import re
import pytest
@@ -26,3 +26,9 @@ def test_config_from_pyproject(tmpdir):
fn = tmpdir / "pyproject.toml"
fn.write_text("[tool.setuptools_scm]\n", encoding="utf-8")
assert Configuration.from_file(str(fn))
+
+
+def test_config_regex_init():
+ tag_regex = re.compile(r"v(\d+)")
+ conf = Configuration(tag_regex=tag_regex)
+ assert conf.tag_regex is tag_regex