5

If I have a project with:

$ cat pyproject.toml
[build-system]
requires = ["setuptools>=41.0", "setuptools-scm", "wheel"]
build-backend = "setuptools.build_meta"
$ git tag
0.1.0
$ git log
commit df40f0c6a207a0fa0fc03f8af01fbac939d6a5fa (HEAD -> master)
Author: [censored]
Date:   Thu Aug 12 14:27:24 2021 +0100

    foo

commit fe2f90978d1a02583841854f2c1433c4b1b8258a (tag: 0.1.0)
Author: [censored]
Date:   Thu Aug 12 14:26:57 2021 +0100

    init

then, trying to get the version from setuptools_scm, I get:

>>> import setuptools_scm
>>> setuptools_scm.get_version()
'0.1.1.dev1+gdf40f0c'

Is there a way, from within Python, to use setuptools-scm to get the latest tagged version, i.e. 0.1.0?

torek
  • 448,244
  • 59
  • 642
  • 775
ignoring_gravity
  • 6,677
  • 4
  • 32
  • 65

0 Answers0