diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 60bec4fbec..3ef27a4032 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -1 +1,4 @@ -from erpnext.__version__ import __version__ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +__version__ = '6.27.22' diff --git a/erpnext/__version__.py b/erpnext/__version__.py deleted file mode 100644 index c27ae20f2a..0000000000 --- a/erpnext/__version__.py +++ /dev/null @@ -1,2 +0,0 @@ -from __future__ import unicode_literals -__version__ = '6.27.22' diff --git a/erpnext/hooks.py b/erpnext/hooks.py index a94acffb76..184004c11a 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals from frappe import _ +from . import __version__ as app_version app_name = "erpnext" app_title = "ERPNext" @@ -7,7 +8,6 @@ app_publisher = "Frappe Technologies Pvt. Ltd." app_description = """ERP made simple""" app_icon = "icon-th" app_color = "#e74c3c" -app_version = "6.27.22" app_email = "info@erpnext.com" app_license = "GNU General Public License (v3)" source_link = "https://github.com/frappe/erpnext" diff --git a/setup.py b/setup.py index d592c5f3cd..5dd87abb5b 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,15 @@ +# -*- coding: utf-8 -*- from setuptools import setup, find_packages from pip.req import parse_requirements +import re, ast + +# get version from __version__ variable in erpnext/__init__.py +_version_re = re.compile(r'__version__\s+=\s+(.*)') + +with open('erpnext/__init__.py', 'rb') as f: + version = str(ast.literal_eval(_version_re.search( + f.read().decode('utf-8')).group(1))) -version = "6.27.22" requirements = parse_requirements("requirements.txt", session="") setup(