diff --git a/luigi/contrib/s3.py b/luigi/contrib/s3.py index 9fb21d283f..1ccc438d7c 100644 --- a/luigi/contrib/s3.py +++ b/luigi/contrib/s3.py @@ -31,9 +31,6 @@ import warnings from multiprocessing.pool import ThreadPool -import botocore -from boto3.s3.transfer import TransferConfig - try: from urlparse import urlsplit except ImportError: @@ -54,6 +51,13 @@ logger = logging.getLogger('luigi-interface') +try: + from boto3.s3.transfer import TransferConfig + import botocore +except ImportError: + logger.warning("Loading S3 module without the python package boto3. " + "Will crash at runtime if S3 functionality is used.") + # two different ways of marking a directory # with a suffix in S3 diff --git a/setup.py b/setup.py index 0fa21e38a2..ab78784bbf 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,6 @@ # the License. import os -import sys from setuptools import setup @@ -41,18 +40,16 @@ def get_static_files(path): 'tornado>=4.0,<5', # https://pagure.io/python-daemon/issue/18 'python-daemon<2.2.0', + 'enum34>1.1.0;python_version<"3.4"', ] if os.environ.get('READTHEDOCS', None) == 'True': # So that we can build documentation for luigi.db_task_history and luigi.contrib.sqla install_requires.append('sqlalchemy') # readthedocs don't like python-daemon, see #1342 - install_requires.remove('python-daemon<3.0') + install_requires.remove('python-daemon<2.2.0') install_requires.append('sphinx>=1.4.4') # Value mirrored in doc/conf.py -if sys.version_info < (3, 4): - install_requires.append('enum34>1.1.0') - setup( name='luigi', version='2.7.9',