Skip to content

Commit 8b8a6d6

Browse files
fix #395: correctly transfer tag regex in the Configuration constructor
1 parent 823c3ac commit 8b8a6d6

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v3.4.2
2+
======
3+
4+
* fix #395: correctly transfer tag regex in the Configuration constructor
5+
16
v3.4.1
27
======
38

src/setuptools_scm/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(
6666
self.fallback_version = fallback_version
6767
self.fallback_root = fallback_root
6868
self.parse = parse
69-
self.tag_regex = DEFAULT_TAG_REGEX
69+
self.tag_regex = tag_regex
7070
self.git_describe_command = git_describe_command
7171

7272
@property

testing/test_config.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import unicode_literals
22

33
from setuptools_scm.config import Configuration
4-
4+
import re
55
import pytest
66

77

@@ -26,3 +26,9 @@ def test_config_from_pyproject(tmpdir):
2626
fn = tmpdir / "pyproject.toml"
2727
fn.write_text("[tool.setuptools_scm]\n", encoding="utf-8")
2828
assert Configuration.from_file(str(fn))
29+
30+
31+
def test_config_regex_init():
32+
tag_regex = re.compile(r"v(\d+)")
33+
conf = Configuration(tag_regex=tag_regex)
34+
assert conf.tag_regex is tag_regex

0 commit comments

Comments
 (0)