Skip to content

Commit c585e20

Browse files
Merge pull request #670 from RonnyPfannschmidt/fix-669-get-version-signature
6.4.0 bugfixes
2 parents 4a1b43a + e28a7c9 commit c585e20

File tree

4 files changed

+32
-8
lines changed

4 files changed

+32
-8
lines changed

CHANGELOG.rst

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
v6.4.1
2+
=======
3+
14

5+
* fix regression #669: restore get_version signature
6+
* fix #668: harden the selftest for distribution extras
27

38
6.4.0
49
======

src/setuptools_scm/__init__.py

+19-3
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,32 @@ def _version_missing(config) -> NoReturn:
111111
)
112112

113113

114-
@_types.transfer_input_args(Configuration)
115-
def get_version(**kw) -> str:
114+
def get_version(
115+
root=".",
116+
version_scheme=DEFAULT_VERSION_SCHEME,
117+
local_scheme=DEFAULT_LOCAL_SCHEME,
118+
write_to=None,
119+
write_to_template=None,
120+
relative_to=None,
121+
tag_regex=DEFAULT_TAG_REGEX,
122+
parentdir_prefix_version=None,
123+
fallback_version=None,
124+
fallback_root=".",
125+
parse=None,
126+
git_describe_command=None,
127+
dist_name=None,
128+
version_cls=None,
129+
normalize=True,
130+
search_parent_directories=False,
131+
):
116132
"""
117133
If supplied, relative_to should be a file from which root may
118134
be resolved. Typically called by a script or module that is not
119135
in the root of the repository to direct setuptools_scm to the
120136
root of the repository by supplying ``__file__``.
121137
"""
122138

123-
config = Configuration(**kw)
139+
config = Configuration(**locals())
124140
maybe_version = _get_version(config)
125141
if maybe_version is None:
126142
_version_missing(config)

testing/test_basic_api.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@ def test_version_from_scm(wd):
5858
setuptools_scm.version_from_scm(str(wd))
5959

6060

61-
def test_root_parameter_pass_by(monkeypatch, tmpdir):
62-
assert_root(monkeypatch, tmpdir)
63-
setuptools_scm.get_version(root=tmpdir.strpath)
61+
def test_root_parameter_pass_by(monkeypatch: pytest.MonkeyPatch, tmp_path: Path):
62+
assert_root(monkeypatch, os.fspath(tmp_path))
63+
setuptools_scm.get_version(root=os.fspath(tmp_path))
64+
setuptools_scm.get_version(
65+
os.fspath(tmp_path)
66+
) # issue 669 - posarg difference between Configuration and get_version
6467

6568

6669
def test_parentdir_prefix(tmpdir, monkeypatch):

testing/test_integration.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ def testwarn_on_broken_setuptools():
142142

143143

144144
@pytest.mark.issue(611)
145-
def test_provides_toml_exta():
145+
def test_distribution_procides_extras():
146146
try:
147147
from importlib.metadata import distribution
148148
except ImportError:
149149
from importlib_metadata import distribution
150150

151151
dist = distribution("setuptools_scm")
152-
assert "toml" in dist.metadata["Provides-Extra"]
152+
assert sorted(dist.metadata.get_all("Provides-Extra")) == ["test", "toml"]

0 commit comments

Comments
 (0)