Skip to content

Commit cbd330d

Browse files
fix #297 - correct the invocation in version_from_scm
1 parent 3ae1cad commit cbd330d

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v3.1.0
2+
=======
3+
4+
* fix #297 - correct the invocation in version_from_scm and deprecate it as its exposed by accident
5+
16
v3.0.6
27
======
38
* fix #295 - correctly handle selfinstall from tarballs

src/setuptools_scm/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@
2424

2525

2626
def version_from_scm(root):
27+
warnings.warn(
28+
"version_from_scm is deprecated please use get_version",
29+
category=DeprecationWarning,
30+
)
31+
config = Configuration()
32+
config.root = root
2733
# TODO: Is it API?
28-
return _version_from_entrypoint(root, "setuptools_scm.parse_scm")
34+
return _version_from_entrypoint(config, "setuptools_scm.parse_scm")
2935

3036

3137
def _call_entrypoint_fn(config, fn):

testing/test_basic_api.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ def test_root_parameter_creation(monkeypatch):
4646
setuptools_scm.get_version()
4747

4848

49+
def test_version_from_scm(wd):
50+
with pytest.warns(DeprecationWarning, match=".*version_from_scm.*"):
51+
setuptools_scm.version_from_scm(str(wd))
52+
53+
4954
def test_root_parameter_pass_by(monkeypatch, tmpdir):
5055
assert_root(monkeypatch, tmpdir)
5156
setuptools_scm.get_version(root=tmpdir.strpath)

0 commit comments

Comments
 (0)