setup.py 2.89 KB
Newer Older
1 2
#!/usr/bin/env python

3
# Copyright 2009-2018 Canonical Ltd.  All rights reserved.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
#
# This file is part of lazr.restfulclient
#
# lazr.restfulclient is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# lazr.restfulclient is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
# License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with lazr.restfulclient.  If not, see <http://www.gnu.org/licenses/>.

from setuptools import setup, find_packages

# generic helpers primarily for the long_description
def generate(*docname_or_string):
    res = []
    for value in docname_or_string:
25
        if value.endswith('.rst'):
26 27 28 29 30 31 32 33 34 35 36 37
            f = open(value)
            value = f.read()
            f.close()
        res.append(value)
        if not value.endswith('\n'):
            res.append('')
    return '\n'.join(res)
# end generic helpers


__version__ = open("src/lazr/restfulclient/version.txt").read().strip()

38 39 40 41 42 43 44 45 46 47 48
tests_require = [
    'fixtures>=1.3.0',
    'lazr.authentication',
    'lazr.restful>=0.11.0',
    'mock; python_version < "3"',
    'oauth',
    'testtools',
    'wsgi_intercept',
    'zope.testrunner',
    ]

49 50 51 52 53 54
setup(
    name='lazr.restfulclient',
    version=__version__,
    namespace_packages=['lazr'],
    packages=find_packages('src'),
    package_dir={'':'src'},
55
    package_data={'lazr.restfulclient': ['version.txt']},
56 57 58 59
    include_package_data=True,
    zip_safe=False,
    maintainer='LAZR Developers',
    maintainer_email='lazr-developers@lists.launchpad.net',
60
    description=open('README.rst').readline().strip(),
61
    long_description=generate(
62 63
        'src/lazr/restfulclient/docs/index.rst',
        'src/lazr/restfulclient/docs/NEWS.rst'),
64 65
    license='LGPL v3',
    install_requires=[
66
        'distro',
67 68
        'httplib2; python_version < "3"',
        'httplib2>=0.7.7; python_version >= "3"',
69
        'oauthlib',
70
        'setuptools',
71
        'six',
72
        'wadllib>=1.1.4',
73 74 75 76 77 78 79 80
        ],
    url='https://launchpad.net/lazr.restfulclient',
    download_url= 'https://launchpad.net/lazr.restfulclient/+download',
    classifiers=[
        "Development Status :: 5 - Production/Stable",
        "Intended Audience :: Developers",
        "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
        "Operating System :: OS Independent",
81 82 83 84 85
        "Programming Language :: Python",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 3",
        ],
    tests_require=tests_require,
86
    extras_require=dict(
87 88
        docs=['Sphinx'],
        test=tests_require,
89 90 91
    ),
    test_suite='lazr.restfulclient.tests',
    )