This repository has been archived by the owner on Jan 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
89 lines (79 loc) · 3.3 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
#! /usr/bin/env python
# coding=utf-8
"""Python Cloud Object Storage I/O setup script
run "./setup.py --help-commands" for help.
"""
from datetime import datetime
from os import chdir
from os.path import dirname, abspath, join
from sys import argv
from setuptools import setup, find_packages
# Sets Package information
PACKAGE_INFO = dict(
name='pycosio',
description='Python Cloud Object Storage I/O',
long_description_content_type='text/markdown; charset=UTF-8',
classifiers=[
# Must be listed on: https://pypi.org/classifiers/
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Topic :: System :: Filesystems',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Operating System :: OS Independent'],
keywords='cloud cloud-storage bucket io stream',
author='Accelize',
author_email='info@accelize.com',
url='https://github.com/Accelize/pycosio',
project_urls={
'Documentation': 'https://pycosio.readthedocs.io',
'Download': 'https://pypi.org/project/pycosio'},
license='Apache License, Version 2.0',
python_requires='>=3.5',
install_requires=['requests>=2.20.0', 'python-dateutil>=2.6.0'],
extras_require={
# Storage specific requirements
'azure_blob': ['azure-storage-blob>=1.3.0,<=2.1.0'],
'azure_file': ['azure-storage-file>=1.3.0'],
'oss': ['oss2>=2.3.0'],
's3': ['boto3>=1.5.0'],
'swift': ['python-swiftclient[keystone]>=3.3.0']},
setup_requires=['setuptools'],
tests_require=['pytest'],
packages=find_packages(exclude=['docs', 'tests', 'tests_storage_package']),
zip_safe=True, command_options={})
# Gets package __version__ from package
SETUP_DIR = abspath(dirname(__file__))
with open(join(SETUP_DIR, 'pycosio', '__init__.py')) as source_file:
for line in source_file:
if line.rstrip().startswith('__version__'):
PACKAGE_INFO['version'] = line.split('=', 1)[1].strip(" \"\'\n")
break
# Gets long description from readme
with open(join(SETUP_DIR, 'README.md')) as source_file:
PACKAGE_INFO['long_description'] = source_file.read()
# Add pytest_runner requirement if needed
if {'pytest', 'test', 'ptr'}.intersection(argv):
PACKAGE_INFO['setup_requires'].append('pytest-runner')
# Add Sphinx requirements if needed
elif 'build_sphinx' in argv:
PACKAGE_INFO['setup_requires'] += ['sphinx', 'sphinx_rtd_theme']
# Generates wildcard "all" extras_require
PACKAGE_INFO['extras_require']['all'] = list(set(
requirement for extra in PACKAGE_INFO['extras_require']
for requirement in PACKAGE_INFO['extras_require'][extra]))
# Gets Sphinx configuration
PACKAGE_INFO['command_options']['build_sphinx'] = {
'project': ('setup.py', PACKAGE_INFO['name'].capitalize()),
'version': ('setup.py', PACKAGE_INFO['version']),
'release': ('setup.py', PACKAGE_INFO['version']),
'copyright': ('setup.py', '2018-%s, %s' % (
datetime.now().year, PACKAGE_INFO['author']))}
# Runs setup
if __name__ == '__main__':
chdir(SETUP_DIR)
setup(**PACKAGE_INFO)