|
1 | | -from setuptools import setup |
2 | | -from setuptools import find_packages |
| 1 | +import codecs |
| 2 | +from setuptools import setup, find_packages |
| 3 | +from os import path |
| 4 | +import os |
| 5 | +from pip._internal.req import parse_requirements |
3 | 6 |
|
4 | | -with open("README.md", 'r') as fi: # pragma: no cover |
5 | | - long_desc = fi.read() |
| 7 | +here = path.abspath(path.dirname(__file__)) |
6 | 8 |
|
7 | | -with open("VERSION.txt", 'r') as ver: # pragma: no cover |
8 | | - version = ver.read() |
| 9 | +with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: |
| 10 | + README = readme.read() |
| 11 | + |
| 12 | +# allowes setup.py to be run from any path |
| 13 | +os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) |
| 14 | + |
| 15 | +# parse_requirements() returns generator of pip.req.InstallRequirement objects |
| 16 | +INSTALL_REQS = parse_requirements('requirements.txt', session='hack') |
| 17 | + |
| 18 | +# reqs is a list of requirements |
| 19 | +REQUIREMENTS = [str(ir.req) for ir in INSTALL_REQS] |
| 20 | + |
| 21 | +CLASSIFIERS = [ |
| 22 | + "Development Status :: 5 - Production/Stable", |
| 23 | + "Intended Audience :: Developers", |
| 24 | + "Natural Language :: Portuguese", |
| 25 | + "License :: OSI Approved :: GNU License", |
| 26 | + "Operating System :: OS Independent", |
| 27 | + "Programming Language :: Python", |
| 28 | + "Programming Language :: Python :: 3.6", |
| 29 | + "Programming Language :: Python :: Implementation :: CPython", |
| 30 | + "Programming Language :: Python :: Implementation :: PyPy", |
| 31 | + "Topic :: Software Development :: Libraries :: Python Modules", |
| 32 | +] |
9 | 33 |
|
10 | 34 | setup( # pragma: no cover |
11 | 35 | name='commit-helper', |
12 | 36 | description="A python program that helps you write commits following commit conventions", # nopep8 |
13 | 37 | url='https://github.com/andre-filho/commit-helper', |
14 | | - long_description=long_desc, |
| 38 | + long_description=codecs.open('README.md', 'rb', 'utf8').read(), |
15 | 39 | long_description_content_type='text/markdown', |
16 | 40 | author='Andre de Sousa Costa Filho', |
17 | 41 | author_email='andre.filho001@outlook.com', |
18 | | - version=str(version).replace('\n', ''), |
| 42 | + version=codecs.open('VERSION.txt', 'rb', 'utf8').read(), |
19 | 43 | packages=find_packages(), |
| 44 | + keywords=['commit', 'helper', 'git', 'version', 'versioning'], |
20 | 45 | entry_points={ |
21 | 46 | 'console_scripts': [ |
22 | 47 | 'commit = commit_helper.__main__:main', |
23 | 48 | 'commit-helper = commit_helper.__main__:main', |
24 | 49 | ] |
25 | 50 | }, |
26 | | - install_requires=[ |
27 | | - 'pathlib', |
28 | | - 'pyyaml', |
29 | | - 'argparse', |
30 | | - 'colored', |
31 | | - ], |
| 51 | + install_requires=REQUIREMENTS, |
| 52 | + license='GNU', |
| 53 | + classifiers=CLASSIFIERS, |
32 | 54 | ) |
0 commit comments