Skip to content

Commit 6fe6005

Browse files
committed
Update version and refactor setup.py
1 parent a62464b commit 6fe6005

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

setup.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# -*- coding: utf-8 -*-
2-
2+
import re
33
import sys
44

55
from setuptools import setup
66

77
python_version = sys.version_info.major
88

9-
version = '0.2.6'
10-
11-
author = 'Gal Matijevic'
12-
email = 'gmatijevic@aip.de'
9+
with open('lib/python%d/queryparser/__init__.py' % python_version) as f:
10+
metadata = dict(re.findall(r'__(.*)__ = [\']([^\']*)[\']', f.read()))
1311

1412
requirements = [
1513
'pytest',
@@ -23,12 +21,12 @@
2321

2422
setup(
2523
name='queryparser-python%d' % python_version,
26-
version=version,
27-
author=author,
28-
author_email=email,
29-
maintainer=author,
30-
maintainer_email=email,
31-
license='Apache-2.0',
24+
version=metadata['version'],
25+
author=metadata['author'],
26+
author_email=metadata['email'],
27+
maintainer=metadata['author'],
28+
maintainer_email=metadata['email'],
29+
license=metadata['license'],
3230
url='https://github.com/aipescience/queryparser',
3331
description=u'Parses MySQL and translates ADQL to MySQL.',
3432
long_description=open('README.rst').read(),

src/queryparser/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
__title__ = 'queryparser'
2+
__version__ = '0.2.7'
3+
__author__ = 'Gal Matijevic'
4+
__email__ = 'gmatijevic@aip.de'
5+
__license__ = 'Apache-2.0'
6+
__copyright__ = 'Copyright 2016-2017 Leibniz Institute for Astrophysics Potsdam (AIP)'
7+
8+
VERSION = __version__
9+
110
from . import adql
211
from . import mysql
312
from . import postgresql

0 commit comments

Comments
 (0)