From c21d54dcb5ad26fcbdecf902cff23e0dc17b3f93 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 17 Sep 2020 21:48:57 +0200 Subject: [PATCH] adding version in __init__.py instead of setup.py --- ereuse_devicehub/__init__.py | 1 + setup.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ereuse_devicehub/__init__.py b/ereuse_devicehub/__init__.py index e69de29b..7574bfd1 100644 --- a/ereuse_devicehub/__init__.py +++ b/ereuse_devicehub/__init__.py @@ -0,0 +1 @@ +__version__ = "1.0a1" diff --git a/setup.py b/setup.py index 5d7871a4..618caa30 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,11 @@ -from pathlib import Path +import re +from pathlib import Path from setuptools import find_packages, setup +with open("ereuse_devicehub/__init__.py", encoding="utf8") as f: + version = re.search(r'__version__ = "(.*?)"', f.read()).group(1) + test_requires = [ 'pytest', 'requests_mock' @@ -9,7 +13,7 @@ test_requires = [ setup( name='ereuse-devicehub', - version='0.1.0a1', + version=version, url='https://github.com/ereuse/devicehub-teal', project_urls={ 'Documentation': 'http://devicehub.ereuse.org',