|
2 | 2 | # coding=utf-8 |
3 | 3 |
|
4 | 4 | import os |
5 | | -import re |
6 | | -from setuptools import setup |
| 5 | +from setuptools import find_packages, setup |
7 | 6 |
|
8 | 7 | HERE = os.path.abspath(os.path.dirname(__file__)) |
9 | 8 | PACKAGE_NAME = 'mailjet_rest' |
10 | 9 |
|
11 | | -# Taken from https://stackoverflow.com/a/39671214/1506051 |
12 | | -__version__ = re.search( |
13 | | - r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', # It excludes inline comment too |
14 | | - open('mailjet_rest/_version.py').read()).group(1) |
| 10 | +# Dynamically calculate the version based on mailjet_rest.VERSION. |
| 11 | +version = __import__('mailjet_rest').get_version() |
15 | 12 |
|
16 | 13 | setup( |
17 | 14 | name=PACKAGE_NAME, |
18 | | - version=__version__, |
| 15 | + version=version, |
19 | 16 | author='starenka', |
20 | 17 | author_email='starenka0@gmail.com', |
21 | 18 | maintainer='Mailjet', |
22 | 19 | maintainer_email='api@mailjet.com', |
23 | | - download_url='https://github.com/mailjet/mailjet-apiv3-python/releases/tag/v'+__version__, |
| 20 | + download_url='https://github.com/mailjet/mailjet-apiv3-python/releases/tag/v' + version, |
24 | 21 | url='https://github.com/mailjet/mailjet-apiv3-python', |
25 | 22 | description=('Mailjet V3 API wrapper'), |
26 | 23 | classifiers=['Development Status :: 3 - Alpha', |
|
41 | 38 | install_requires=['requests>=2.4.3'], |
42 | 39 | tests_require=['unittest'], |
43 | 40 | entry_points={}, |
44 | | - packages=['mailjet_rest'], |
| 41 | + packages=find_packages(), |
45 | 42 | ) |
0 commit comments