Cleaned up some of the dependencies, added conditional mailcap-fix dep
This commit is contained in:
@@ -10,9 +10,8 @@ matrix:
|
||||
allow_failures:
|
||||
- python: nightly
|
||||
fast_finish: true
|
||||
before_install:
|
||||
- pip install coveralls pytest coverage mock pylint vcrpy
|
||||
install:
|
||||
- pip install .[test]
|
||||
- pip install .
|
||||
script:
|
||||
# https://github.com/PyCQA/pylint/issues/1113
|
||||
|
||||
@@ -20,12 +20,17 @@ import six
|
||||
#pylint: disable=import-error
|
||||
from six.moves.urllib.parse import quote
|
||||
from kitchen.text.display import textual_width_chop
|
||||
from mailcap_fix import mailcap
|
||||
|
||||
from . import exceptions
|
||||
from . import mime_parsers
|
||||
from .objects import LoadScreen, Color
|
||||
|
||||
try:
|
||||
# Fix only needed for versions prior to python 3.6
|
||||
from mailcap_fix import mailcap
|
||||
except ImportError:
|
||||
import mailcap
|
||||
|
||||
try:
|
||||
# Added in python 3.4+
|
||||
from html import unescape
|
||||
|
||||
11
setup.cfg
11
setup.cfg
@@ -1,11 +1,2 @@
|
||||
[wheel]
|
||||
universal = 1
|
||||
|
||||
[metadata]
|
||||
requires-dist =
|
||||
beautifulsoup4
|
||||
decorator
|
||||
kitchen
|
||||
mailcap-fix
|
||||
requests>=2.4.0
|
||||
six
|
||||
universal = 1
|
||||
61
setup.py
61
setup.py
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user