build: Single source version number

As of setuptools 46.4.0, one can accomplish single source version
number with
    version = attr: package.__version__
in setup.cfg: As long as setuptools simplified AST parser is able to
read the file, this works without actually importing anything.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
This commit is contained in:
Jussi Kukkonen 2022-03-03 15:30:13 +02:00
parent 248dabddd8
commit 5155ba7431
2 changed files with 2 additions and 2 deletions

View file

@ -1,6 +1,6 @@
# Build-system section
[build-system]
requires = ["setuptools>=40.8.0", "wheel"]
requires = ["setuptools>=46.4.0", "wheel"]
build-backend = "setuptools.build_meta"
# Black section

View file

@ -1,6 +1,6 @@
[metadata]
name = tuf
version = 1.0.0
version = attr: tuf.__version__
author = https://www.updateframework.com
author_email = theupdateframework@googlegroups.com
description = A secure updater framework for Python