Cleaned up some of the dependencies, added conditional mailcap-fix dep

This commit is contained in:
Michael Lazar
2017-04-09 19:59:59 -07:00
parent 21f998c043
commit aefbc4e985
5 changed files with 55 additions and 39 deletions

View File

@@ -1,13 +1,52 @@
import sys
import codecs
import setuptools
from version import __version__ as version
install_requires = [
'beautifulsoup4',
'decorator',
'kitchen',
'requests >=2.4.0', # https://github.com/michael-lazar/rtv/issues/325
'six',
]
tests_require = [
'coveralls',
'pytest',
'coverage',
'mock',
'pylint',
'vcrpy',
]
extras_require = {}
# https://hynek.me/articles/conditional-python-dependencies/
if int(setuptools.__version__.split(".", 1)[0]) < 18:
assert "bdist_wheel" not in sys.argv
if sys.version_info[0:2] < (3, 6):
install_requires.append("mailcap-fix")
else:
# Building the bdist_wheel with conditional environment dependencies
# requires setuptools version > 18. For older setuptools versions this
# will raise an error.
extras_require.update({":python_version<'3.6'": ["mailcap-fix"]})
def long_description():
with codecs.open('README.rst', encoding='utf8') as f:
return f.read()
setuptools.setup(
name='rtv',
version=version,
description='A simple terminal viewer for Reddit (Reddit Terminal Viewer)',
long_description=open('README.rst').read(),
long_description=long_description(),
url='https://github.com/michael-lazar/rtv',
author='Michael Lazar',
author_email='lazar.michael22@gmail.com',
@@ -16,22 +55,16 @@ setuptools.setup(
packages=[
'rtv',
'rtv.packages',
'rtv.packages.praw',
],
'rtv.packages.praw'
],
package_data={
'rtv': ['templates/*'],
'rtv.packages.praw': ['praw.ini'],
},
'rtv.packages.praw': ['praw.ini']
},
data_files=[("share/man/man1", ["rtv.1"])],
install_requires=[
'beautifulsoup4',
'decorator',
'kitchen',
'mailcap-fix',
# For info on why this is pinned, see https://github.com/michael-lazar/rtv/issues/325
'requests >=2.4.0',
'six',
],
install_requires=install_requires,
tests_require=tests_require,
extras_require=extras_require,
entry_points={'console_scripts': ['rtv=rtv.__main__:main']},
classifiers=[
'Intended Audience :: End Users/Desktop',