forked from piskvorky/smart_open
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
116 lines (93 loc) · 3.18 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Radim Rehurek <me@radimrehurek.com>
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
import io
import os
from setuptools import setup, find_packages
def _get_version():
curr_dir = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(curr_dir, 'smart_open', 'version.py')) as fin:
line = fin.readline().strip()
parts = line.split(' ')
assert len(parts) == 3
assert parts[0] == '__version__'
assert parts[1] == '='
return parts[2].strip('\'"')
#
# We cannot do "from smart_open.version import __version__" because that will
# require the dependencies for smart_open to already be in place, and that is
# not necessarily the case when running setup.py for the first time.
#
__version__ = _get_version()
def read(fname):
return io.open(os.path.join(os.path.dirname(__file__), fname), encoding='utf-8').read()
tests_require = [
'mock',
'moto[server]',
'pathlib2',
'responses',
'boto3',
# Not used directly but allows boto GCE plugins to load.
# https://github.com/GoogleCloudPlatform/compute-image-packages/issues/262
'google-compute-engine==2.8.12',
'paramiko',
'parameterizedtestcase',
'pytest',
'pytest-rerunfailures',
]
install_requires = [
'requests',
]
aws_deps = ['boto', 'boto3']
gcp_deps = ['google-cloud-storage']
azure_deps = ['azure-storage-blob', 'azure-common', 'azure-core']
all_deps = install_requires + aws_deps + gcp_deps + azure_deps
setup(
name='smart_open',
version=__version__,
description='Utils for streaming large files (S3, HDFS, GCS, Azure Blob Storage, gzip, bz2...)',
long_description=read('README.rst'),
packages=find_packages(),
package_data={
"smart_open.tests": ["test_data/*"],
},
author='Radim Rehurek',
author_email='me@radimrehurek.com',
maintainer='Radim Rehurek',
maintainer_email='me@radimrehurek.com',
url='https://github.com/piskvorky/smart_open',
download_url='http://pypi.python.org/pypi/smart_open',
keywords='file streaming, s3, hdfs, gcs, azure blob storage',
license='MIT',
platforms='any',
# Concatenating the lists together is temporary and will
# eventually simply be install_requires dropping the cloud
# dependencies from being installed without explicitly being declared.
install_requires=install_requires + aws_deps,
tests_require=tests_require,
extras_require={
'test': tests_require,
'aws': aws_deps,
'gcp': gcp_deps,
'azure': azure_deps,
'all': all_deps,
},
python_requires=">=3.5.*",
test_suite="smart_open.tests",
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: System :: Distributed Computing',
'Topic :: Database :: Front-Ends',
],
)