forked from marcgibbons/django-rest-swagger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
86 lines (75 loc) · 2.74 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
import os
import sys
import shutil
from setuptools import setup
from rest_framework_swagger import VERSION
if sys.argv[-1] == 'publish':
if os.system("pip freeze | grep wheel"):
print("wheel not installed.\nUse `pip install wheel`.\nExiting.")
sys.exit()
if os.system("pip freeze | grep twine"):
print("twine not installed.\nUse `pip install twine`.\nExiting.")
sys.exit()
os.system("python setup.py sdist bdist_wheel")
os.system("twine upload -r pypi dist/*")
print("You probably want to also tag the version now:")
print(" git tag -a %s -m 'version %s'" % (VERSION, VERSION))
print(" git push --tags")
shutil.rmtree('dist')
shutil.rmtree('build')
shutil.rmtree('django_rest_swagger.egg-info')
sys.exit()
README = """
Django REST Swagger
An API documentation generator for Swagger UI and Django REST Framework version 2.3.8+
Installation
From pip:
pip install django-rest-swagger
Project @ https://github.com/marcgibbons/django-rest-swagger
Docs @ http://django-rest-swagger.readthedocs.org/
"""
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
install_requires = [
'Django>=1.5',
'djangorestframework>=2.3.8',
'PyYAML>=3.10',
]
import platform
version = platform.python_version_tuple()
if version < ('2','7'):
install_requires.append('importlib>=1.0.1')
install_requires.append('ordereddict>=1.1')
setup(
name='django-rest-swagger',
version=VERSION,
packages=['rest_framework_swagger'],
package_data={'rest_framework_swagger': ['rest_framework_swagger/templates/rest_framework_swagger/*', 'rest_framework_swagger/static/rest_framework_swagger/*']},
include_package_data=True,
license='FreeBSD License',
description='Swagger UI for Django REST Framework 2.3.8+',
long_description=README,
install_requires=install_requires,
extras_require = {
'reST': ['docutils>=0.8'],
},
author='Marc Gibbons',
author_email='[email protected]',
maintainer='Ellery Newcomer',
maintainer_email='[email protected]',
url='http://github.com/marcgibbons/django-rest-swagger',
classifiers=[
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
)