Completed
Push — develop ( 368482...24905c )
by A
54s
created

get_version()   A

Complexity

Conditions 4

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
dl 0
loc 10
rs 9.2
c 0
b 0
f 0
1
#!/usr/bin/env python
2
# -*- coding: utf-8 -*-
3
#
4
# Copyright (c) 2013-2016 Online SAS and Contributors. All Rights Reserved.
5
#                         Julien Castets <[email protected]>
6
#                         Kevin Deldycke <[email protected]>
7
#
8
# Licensed under the BSD 2-Clause License (the "License"); you may not use this
9
# file except in compliance with the License. You may obtain a copy of the
10
# License at https://opensource.org/licenses/BSD-2-Clause
11
12
import os
13
import re
14
import sys
15
from contextlib import closing
16
17
from setuptools import find_packages, setup
18
19
MODULE_NAME = 'scaleway'
20
21
22
def get_version():
23
24
    with open(os.path.join(
25
        os.path.dirname(__file__), MODULE_NAME, '__init__.py')
26
    ) as init:
27
28
        for line in init.readlines():
29
            res = re.match(r'__version__ *= *[\'"]([0-9\.]*)[\'"]$', line)
30
            if res:
31
                return res.group(1)
32
33
34
def get_long_description():
35
    readme = os.path.join(os.path.dirname(__file__), 'README.rst')
36
    changes = os.path.join(os.path.dirname(__file__), 'CHANGES.rst')
37
    with closing(open(readme)) as hreadme, closing(open(changes)) as hchanges:
38
        return hreadme.read() + '\n' + hchanges.read()
39
40
41
REQUIREMENTS = [
42
    'slumber >= 0.6.2',
43
    'six']
44
45
# Packages required to handle SNI, only for Python2.
46
if sys.version_info.major == 2:
47
    REQUIREMENTS += [
48
        'pyOpenSSL',
49
        'ndg-httpsclient',
50
        'pyasn1'
51
    ]
52
53
setup(
54
    name='scaleway-sdk',
55
    version=get_version(),
56
    description="Tools to query the REST APIs of Scaleway",
57
    long_description=get_long_description(),
58
59
    author='Scaleway',
60
    author_email='[email protected]',
61
    url='https://github.com/scaleway/python-scaleway',
62
    license='BSD',
63
64
    install_requires=REQUIREMENTS,
65
66
    packages=find_packages(),
67
68
    tests_require=[
69
        'httpretty >= 0.8.0',
70
        'mock',
71
    ],
72
    test_suite=MODULE_NAME + '.tests',
73
74
    classifiers=[
75
        'Development Status :: 5 - Production/Stable',
76
        'Environment :: Web Environment',
77
        'Intended Audience :: Developers',
78
        'License :: OSI Approved :: BSD License',
79
        'Operating System :: OS Independent',
80
        'Programming Language :: Python',
81
        'Programming Language :: Python :: 2',
82
        'Programming Language :: Python :: 2.7',
83
        'Programming Language :: Python :: 3',
84
        'Programming Language :: Python :: 3.3',
85
        'Programming Language :: Python :: 3.4',
86
        'Programming Language :: Python :: 3.5',
87
        'Programming Language :: Python :: Implementation :: PyPy',
88
        'Topic :: Software Development :: Libraries :: Python Modules',
89
        'Topic :: Internet',
90
        'Topic :: System :: Distributed Computing',
91
    ],
92
93
    entry_points={
94
        'console_scripts': [].
95
    }
96
)
97