generate 'version.py' file with plain version string instead of using pkg_resources to read version from package metadata

See https://github.com/fonttools/fonttools/issues/697#issuecomment-252621005
This commit is contained in:
Cosimo Lupo 2016-10-10 15:06:11 +01:00
parent c719da5bca
commit 6b152f57ae
2 changed files with 10 additions and 5 deletions

View File

@ -1,4 +0,0 @@
try:
__version__ = __import__('pkg_resources').require('fontTools')[0].version
except Exception:
__version__ = 'unknown'

View File

@ -42,9 +42,18 @@ fonts. The package also contains a tool called "TTX" which converts
TrueType/OpenType fonts to and from an XML-based format. TrueType/OpenType fonts to and from an XML-based format.
""" """
version_template = """\
# file generated by setuptools_scm
# don't change, don't track in version control
__version__ = {version!r}
"""
setup( setup(
name="fonttools", name="fonttools",
use_scm_version=True, use_scm_version={
"write_to": "Lib/fontTools/version.py",
"write_to_template": version_template,
},
description="Tools to manipulate font files", description="Tools to manipulate font files",
author="Just van Rossum", author="Just van Rossum",
author_email="just@letterror.com", author_email="just@letterror.com",