Cleaned up some of the dependencies, added conditional mailcap-fix dep
This commit is contained in:
@@ -10,9 +10,8 @@ matrix:
|
|||||||
allow_failures:
|
allow_failures:
|
||||||
- python: nightly
|
- python: nightly
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
before_install:
|
|
||||||
- pip install coveralls pytest coverage mock pylint vcrpy
|
|
||||||
install:
|
install:
|
||||||
|
- pip install .[test]
|
||||||
- pip install .
|
- pip install .
|
||||||
script:
|
script:
|
||||||
# https://github.com/PyCQA/pylint/issues/1113
|
# https://github.com/PyCQA/pylint/issues/1113
|
||||||
|
|||||||
@@ -20,12 +20,17 @@ import six
|
|||||||
#pylint: disable=import-error
|
#pylint: disable=import-error
|
||||||
from six.moves.urllib.parse import quote
|
from six.moves.urllib.parse import quote
|
||||||
from kitchen.text.display import textual_width_chop
|
from kitchen.text.display import textual_width_chop
|
||||||
from mailcap_fix import mailcap
|
|
||||||
|
|
||||||
from . import exceptions
|
from . import exceptions
|
||||||
from . import mime_parsers
|
from . import mime_parsers
|
||||||
from .objects import LoadScreen, Color
|
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:
|
try:
|
||||||
# Added in python 3.4+
|
# Added in python 3.4+
|
||||||
from html import unescape
|
from html import unescape
|
||||||
|
|||||||
11
setup.cfg
11
setup.cfg
@@ -1,11 +1,2 @@
|
|||||||
[wheel]
|
[wheel]
|
||||||
universal = 1
|
universal = 1
|
||||||
|
|
||||||
[metadata]
|
|
||||||
requires-dist =
|
|
||||||
beautifulsoup4
|
|
||||||
decorator
|
|
||||||
kitchen
|
|
||||||
mailcap-fix
|
|
||||||
requests>=2.4.0
|
|
||||||
six
|
|
||||||
61
setup.py
61
setup.py
@@ -1,13 +1,52 @@
|
|||||||
|
import sys
|
||||||
|
import codecs
|
||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
from version import __version__ as version
|
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(
|
setuptools.setup(
|
||||||
name='rtv',
|
name='rtv',
|
||||||
version=version,
|
version=version,
|
||||||
description='A simple terminal viewer for Reddit (Reddit Terminal Viewer)',
|
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',
|
url='https://github.com/michael-lazar/rtv',
|
||||||
author='Michael Lazar',
|
author='Michael Lazar',
|
||||||
author_email='lazar.michael22@gmail.com',
|
author_email='lazar.michael22@gmail.com',
|
||||||
@@ -16,22 +55,16 @@ setuptools.setup(
|
|||||||
packages=[
|
packages=[
|
||||||
'rtv',
|
'rtv',
|
||||||
'rtv.packages',
|
'rtv.packages',
|
||||||
'rtv.packages.praw',
|
'rtv.packages.praw'
|
||||||
],
|
],
|
||||||
package_data={
|
package_data={
|
||||||
'rtv': ['templates/*'],
|
'rtv': ['templates/*'],
|
||||||
'rtv.packages.praw': ['praw.ini'],
|
'rtv.packages.praw': ['praw.ini']
|
||||||
},
|
},
|
||||||
data_files=[("share/man/man1", ["rtv.1"])],
|
data_files=[("share/man/man1", ["rtv.1"])],
|
||||||
install_requires=[
|
install_requires=install_requires,
|
||||||
'beautifulsoup4',
|
tests_require=tests_require,
|
||||||
'decorator',
|
extras_require=extras_require,
|
||||||
'kitchen',
|
|
||||||
'mailcap-fix',
|
|
||||||
# For info on why this is pinned, see https://github.com/michael-lazar/rtv/issues/325
|
|
||||||
'requests >=2.4.0',
|
|
||||||
'six',
|
|
||||||
],
|
|
||||||
entry_points={'console_scripts': ['rtv=rtv.__main__:main']},
|
entry_points={'console_scripts': ['rtv=rtv.__main__:main']},
|
||||||
classifiers=[
|
classifiers=[
|
||||||
'Intended Audience :: End Users/Desktop',
|
'Intended Audience :: End Users/Desktop',
|
||||||
|
|||||||
Reference in New Issue
Block a user