From d4b8804abb876bda9803cee61c6c4298b475e6be Mon Sep 17 00:00:00 2001 From: Prashanth Pai Date: Tue, 9 Aug 2016 14:25:31 +0530 Subject: Simplify packaging * Rename .unittests.sh to .unitests * Fix entries in MANIFEST.in file * Mover version declaration to gfapi.py TODO: Fix the spec file. That'll be sent as a separate change. Change-Id: I0cba8964c1ecc337128c8edc9f301fc1d023bd28 Signed-off-by: Prashanth Pai --- setup.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 6f68a01..912959b 100644 --- a/setup.py +++ b/setup.py @@ -10,18 +10,28 @@ # later), or the GNU General Public License, version 2 (GPLv2), in all # cases as published by the Free Software Foundation. +import os +import re from setuptools import setup -from gluster import __canonical_version__ as version - -name = 'gfapi' +# Get version without importing. +gfapi_file_path = os.path.join(os.path.dirname(__file__), 'gluster/gfapi.py') +with open(gfapi_file_path) as f: + for line in f: + match = re.match(r"__version__.*'([0-9.]+)'", line) + if match: + version = match.group(1) + break + else: + raise Exception("Couldn't find version in setup.py") setup( - name=name, + name='gfapi', version=version, description='Python bindings for GlusterFS libgfapi', + long_description='Python bindings for GlusterFS libgfapi', license='GPLv2 or LGPLv3+', author='Red Hat, Inc.', author_email='gluster-devel@gluster.org', @@ -40,7 +50,4 @@ setup( 'Programming Language :: Python :: 2.7' 'Topic :: System :: Filesystems' ], - install_requires=[], - scripts=[], - entry_points={}, ) -- cgit