try using setuptools_scm for automatic versioning based on py-* tags (#187)

* try using setuptools_scm for automatic versioning based on py-* tags

* circument problem with pip-wheel isolation and setuptoosl_scm

* always provide version, address @flub comment
This commit is contained in:
holger krekel
2019-07-14 09:58:51 +02:00
committed by GitHub
parent 46c64b2511
commit 3e3403d3d7
5 changed files with 37 additions and 18 deletions

View File

@@ -4,14 +4,19 @@ import re
def main():
long_description, version = read_meta()
with open("README.rst") as f:
long_description = f.read()
setuptools.setup(
name='deltachat',
version=version,
setup_requires=['setuptools_scm', 'cffi>=1.0.0'],
use_scm_version = {
"root": "..",
"relative_to": __file__,
'tag_regex': r'^(?P<prefix>py-)?(?P<version>[^\+]+)(?P<suffix>.*)?$',
},
description='Python bindings for the Delta Chat Core library using CFFI against the Rust-implemented libdeltachat',
long_description=long_description,
author='holger krekel, Floris Bruynooghe, Bjoern Petersen and contributors',
setup_requires=['cffi>=1.0.0'],
install_requires=['cffi>=1.0.0', 'attrs', 'six'],
packages=setuptools.find_packages('src'),
package_dir={'': 'src'},
@@ -27,18 +32,5 @@ def main():
)
def read_meta():
with open(os.path.join("src", "deltachat", "__init__.py")) as f:
for line in f:
m = re.match('__version__ = "(\S*).*"', line)
if m:
version, = m.groups()
break
with open("README.rst") as f:
long_desc = f.read()
return long_desc, version
if __name__ == "__main__":
main()