-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from dave-shawley/releases/0.0.1
Release 0.0.1
- Loading branch information
Showing
7 changed files
with
57 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
language: python | ||
python: | ||
- '2.7' | ||
- '3.4' | ||
- '3.5' | ||
sudo: false | ||
install: | ||
- pip install -q -r requires/development.txt | ||
script: | ||
- "./setup.py build_sphinx" | ||
deploy: | ||
provider: pypi | ||
user: daveshawley | ||
password: | ||
secure: AFKcQSyfXnZGUAF5jfKZV8R5c+dFyPhJKBqaiVBaLoisOYpPksS4CBof/XTQfcB7lADWVHkIUv4vClmYaBU5CQ7XTJAwUQapDZMtNPiG7LIIxfecBeUI9kv+hnyqtVzzqZ/4cTP4J0+IqrmfePkNZ5QOgI+4pYiA/mvK6oBImx3LGc501vOxaLa9kag75u6J0ZCS0w4hq5LIhZZAWbVn963SZ4ChkAZJ7r2uzudKnQDD5EqJPLqWHzBA90sbnPkD2uin7r1BHHyKyYrxG9WcnSrqs98Hw/5AgypU2KEBS3XxJZqHI4eV5eAeG/pGmu2j51tYWG376Jnv5EaTfcFMYTsoXH2zrQjxQ3QzMi38BVIhQ+wIzcjY8nqVjT9oMpPFa8JEiPnVvES/hzdEFUjocakS/OtlePHy/6So8Dnbx25y4+YS7NnVytH6NEe6NqWuZ74CYQPiH5y+tjWL2P1QUZoka0Io1KsUSC8B+uKJpGrkbip1eQQsOm01zz2wGQ26Rb+Qrzu77iSZ75eZLCQw0zg0w26+SGHOfvB4qWNgspxrnZAeZyZTVFxuSm0yaG1CGj3vIyQD1kdIUE7sAK+XLNQefIUSgRlhP3uf3gczLo65AjnHJVyAfiBjW2M3Ffhu1rudt4DfimYjMKxwN3BFDms//ExgC0uLwaM+OYAGC4I= | ||
distributions: sdist bdist_wheel | ||
on: | ||
tags: true | ||
all_branches: true | ||
repo: dave-shawley/sphinx-swagger | ||
python: 3.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Release History | ||
=============== | ||
|
||
`0.0.1`_ (2016 Jun 06) | ||
---------------------- | ||
- Initial release with simple Sphinx writer+builder. | ||
|
||
.. _Next Release: https://github.com/dave-shawley/sphinx-swagger/compare/0.0.1...HEAD | ||
.. _0.0.1: https://github.com/dave-shawley/sphinx-swagger/compare/0.0.0...0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
|
||
advanced | ||
contributing | ||
history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,10 +24,22 @@ def read_requirements(name): | |
setuptools.setup( | ||
name='sphinx-swagger', | ||
version=sphinxswagger.__version__, | ||
url='https://github.com/dave-shawley/sphinx-swagger', | ||
description='Generate swagger definitions from sphinx docs', | ||
long_description='\n'+open('README.rst').read(), | ||
author='Dave Shawley', | ||
author_email='[email protected]', | ||
packages=['sphinxswagger'], | ||
install_requires=read_requirements('installation.txt'), | ||
classifiers=[ | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: BSD License', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.4', | ||
'Framework :: Sphinx :: Extension', | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version_info = (0, 0, 0) | ||
version_info = (0, 0, 1) | ||
__version__ = '.'.join(str(v) for v in version_info) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,11 +83,12 @@ def depart_desc(self, node): | |
return | ||
|
||
# TODO remove this ... useful for debugging only | ||
with open('out-{}.json'.format(len(self._swagger_doc._paths)), 'w') as f: | ||
data = _generate_debug_tree(node) | ||
data['signature'] = desc_signature['path'] | ||
data['url_template'] = url_template | ||
json.dump(data, f, indent=2) | ||
# debug_name = 'out-{}.json'.format(len(self._swagger_doc._paths)) | ||
# with open(debug_name, 'w') as f: | ||
# data = _generate_debug_tree(node) | ||
# data['signature'] = desc_signature['path'] | ||
# data['url_template'] = url_template | ||
# json.dump(data, f, indent=2) | ||
# END TODO | ||
|
||
default = 'default' | ||
|
@@ -216,7 +217,7 @@ def _generate_status_codes(body): | |
:rtype: tuple | ||
""" | ||
if len(body.children) > 1 or not isinstance(body[0], nodes.bullet_list): | ||
return None | ||
return | ||
|
||
bullet_list = body[0] | ||
|
||
|
@@ -314,42 +315,6 @@ def _convert_url(url): | |
'after {} tries'.format(start_url, attempt)) | ||
|
||
|
||
""" | ||
{"swagger":"2.0" | ||
,"info":{"title":"Title String" | ||
,"description":"in Github-Flavored Markdown" | ||
,"termsOfService":"http://swagger.io/terms/" | ||
,"contact":{"name":"$AUTHOR_NAME" | ||
,"email":"[email protected]" | ||
,"url":"http://api.aweber.com/"} | ||
,"license":{"name":"BSD" | ||
,"url":"http://license.url"} | ||
,"version":"$PROJECT_VERSION"} | ||
,"host":"localhost:8000" | ||
,"basePath":"/" | ||
,"schemes":["http"] | ||
,"consumes":["application/json"] | ||
,"produces":["application/json"] | ||
,"paths":{"/status":{"get":{"description":"" | ||
,"responses":{"200":{"description":"the application is functional" | ||
,"schema":{"$ref":"#/definitions/Status"}}}}}} | ||
,"definitions":{"Status":{"type":"object" | ||
,"description":"Application status information" | ||
,"required":["application","version","status"] | ||
,"properties":{"application":{"type":"string" | ||
,"description":"the name of the service"} | ||
,"version":{"type":"string" | ||
,"description":"the deployed application version"} | ||
,"status":{"type":"string" | ||
,"description":"status of the application"}}}} | ||
,"parameters":{} | ||
,"responses":{} | ||
,"securityDefinitions":{} | ||
,"security":[] | ||
,"tags":[]} | ||
""" | ||
|
||
|
||
class SwaggerDocument(object): | ||
|
||
def __init__(self): | ||
|