forked from jfinkels/flask-restless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
103 lines (85 loc) · 3.41 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
"""
Flask-Restless
~~~~~~~~~~~~~~
Flask-Restless is a `Flask <http://flask.pocoo.org>`_ extension which
facilitates the creation of ReSTful JSON APIs. It is compatible with models
which have been defined using `SQLAlchemy <http://sqlalchemy.org>`_ or
`FLask-SQLAlchemy <http://packages.python.org/Flask-SQLAlchemy>`_.
For more information, check the World Wide Web!
* `Documentation <http://readthedocs.org/docs/flask-restless>`_
* `PyPI listing <http://pypi.python.org/pypi/Flask-Restless>`_
* `Source code repository <http://github.com/jfinkels/flask-restless>`_
"""
import sys
from setuptools import Command
from setuptools import setup
#: The installation requirements for Flask-Restless. ``simplejson`` is only
#: required on Python version 2.5. ``Flask-SQLAlchemy`` is not required, so the
#: user must install it explicitly.
requirements = ['flask>=0.7', 'sqlalchemy', 'python-dateutil<2.0']
if sys.version_info < (2, 6):
requirements.append('simplejson')
class run_coverage(Command):
"""Runs ``coverage``, the Python code coverage tool to generate a test
coverage report.
This command requires that `coverage.py
<http://nedbatchelder.com/code/coverage>`_ is installed. This can be done
by doing, for example::
pip install coverage
"""
#: A brief description of the command.
description = "Generate a test coverage report."
#: Options which can be provided by the user.
user_options = []
def initialize_options(self):
"""Intentionally unimplemented."""
pass
def finalize_options(self):
"""Intentionally unimplemented."""
pass
def run(self):
"""Runs coverage.py on the test suite then generates an HTML report,
both in a subprocess.
"""
import subprocess
try:
subprocess.call(['coverage', 'run', '--source=flask_restless',
'--branch', 'run-tests.py'])
subprocess.call(['coverage', 'html'])
except OSError:
print('coverage.py not found.'
' Install it with "pip install coverage".')
sys.exit(-1)
print('HTML coverage report generated at "htmlcov/".')
setup(
author='Jeffrey Finkelstein',
author_email='jeffrey.finkelstein@gmail.com',
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Database :: Front-Ends',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development :: Libraries :: Python Modules'
],
cmdclass={'coverage': run_coverage},
description='A Flask extension for easy ReSTful API generation',
download_url='http://pypi.python.org/pypi/Flask-Restless',
install_requires=requirements,
include_package_data=True,
keywords=['ReST', 'API', 'Flask', 'Elixir'],
license='GNU AGPLv3+ or BSD',
long_description=__doc__,
name='Flask-Restless',
platforms='any',
packages=['flask_restless'],
test_suite='tests.suite',
tests_require=['unittest2'],
url='http://github.com/jfinkels/flask-restless',
version='0.6-sax',
zip_safe=False
)