mirror of
https://github.com/internetarchive/warcprox.git
synced 2025-01-18 13:22:09 +01:00
make trough dependency optional
This commit is contained in:
parent
a8cd53bfe4
commit
90fba01514
4
setup.py
4
setup.py
@ -35,7 +35,6 @@ deps = [
|
||||
'idna>=2.5',
|
||||
'PyYAML>=5.1',
|
||||
'cachetools',
|
||||
'trough>=0.1.4',
|
||||
]
|
||||
try:
|
||||
import concurrent.futures
|
||||
@ -44,7 +43,7 @@ except:
|
||||
|
||||
setuptools.setup(
|
||||
name='warcprox',
|
||||
version='2.4.25',
|
||||
version='2.4.26',
|
||||
description='WARC writing MITM HTTP/S proxy',
|
||||
url='https://github.com/internetarchive/warcprox',
|
||||
author='Noah Levitt',
|
||||
@ -53,6 +52,7 @@ setuptools.setup(
|
||||
license='GPL',
|
||||
packages=['warcprox'],
|
||||
install_requires=deps,
|
||||
extras_require={'trough': ['trough>=0.1.4',],},
|
||||
setup_requires=['pytest-runner'],
|
||||
tests_require=['mock', 'pytest', 'warcio'],
|
||||
entry_points={
|
||||
|
@ -506,7 +506,14 @@ class TroughDedupDb(DedupDb, DedupableMixin):
|
||||
'values (%s, %s, %s, %s);')
|
||||
|
||||
def __init__(self, options=warcprox.Options()):
|
||||
import trough.client
|
||||
try:
|
||||
import trough.client
|
||||
except ImportError as e:
|
||||
logging.critical(
|
||||
'%s: %s\n\nYou might need to run "pip install '
|
||||
'warcprox[trough]".', type(e).__name__, e)
|
||||
sys.exit(1)
|
||||
|
||||
DedupableMixin.__init__(self, options)
|
||||
self.options = options
|
||||
self._trough_cli = trough.client.TroughClient(
|
||||
|
Loading…
x
Reference in New Issue
Block a user