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

@@ -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

View File

@@ -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

View File

@@ -1,11 +1,2 @@
[wheel]
universal = 1
[metadata]
requires-dist =
beautifulsoup4
decorator
kitchen
mailcap-fix
requests>=2.4.0
six

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',

12
tox.ini
View File

@@ -1,12 +0,0 @@
[tox]
envlist = py27,py34
[testenv]
deps =
pytest
pylint
mock
vcrpy
commands =
pylint --rcfile .pylintrc rtv/ -E
py.test -v {posargs}