Skip to content

Commit 3214d3e

Browse files
Merge pull request #282 from RonnyPfannschmidt/fix-281
fix #281 - reorder arguments to allow prior calls to work
2 parents ae5533a + 31295f6 commit 3214d3e

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-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.0.1
2+
=======
3+
4+
* fix a regression in setuptools_scm.git.parse - reorder arguments so the positional invocation from before works as expected
5+
16
v3.0.0
27
=======
38

src/setuptools_scm/git.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ def fail_on_shallow(wd):
8383
)
8484

8585

86-
def parse(root, config=None, describe_command=DEFAULT_DESCRIBE, pre_parse=warn_on_shallow):
86+
def parse(
87+
root, describe_command=DEFAULT_DESCRIBE, pre_parse=warn_on_shallow, config=None
88+
):
8789
"""
8890
:param pre_parse: experimental pre_parse action, may change at any time
8991
"""
@@ -120,7 +122,14 @@ def parse(root, config=None, describe_command=DEFAULT_DESCRIBE, pre_parse=warn_o
120122

121123
branch = wd.get_branch()
122124
if number:
123-
return meta(tag, config=config, distance=number, node=node, dirty=dirty, branch=branch)
125+
return meta(
126+
tag,
127+
config=config,
128+
distance=number,
129+
node=node,
130+
dirty=dirty,
131+
branch=branch,
132+
)
124133
else:
125134
return meta(tag, config=config, node=node, dirty=dirty, branch=branch)
126135

testing/test_git.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ def test_parse_describe_output(given, tag, number, node, dirty):
2828
assert parsed == (tag, number, node, dirty)
2929

3030

31+
@pytest.mark.issue("https://github.com/pypa/setuptools_scm/issues/281")
32+
def test_parse_call_order(wd):
33+
git.parse(str(wd.cwd), git.DEFAULT_DESCRIBE)
34+
35+
3136
def test_version_from_git(wd):
3237
assert wd.version == "0.1.dev0"
3338

0 commit comments

Comments
 (0)