Skip to content

Commit 854a77e

Browse files
committed
Include swagger-ui template and static files.
[Resolves #9]
1 parent abb4631 commit 854a77e

8 files changed

+46
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules/
2+
flask_apispec/static/
23

34
*.py[cod]
45

CHANGELOG.rst

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
---------
33

4+
0.3.0 (2015-11-11)
5+
++++++++++++++++++
6+
7+
* Bundle templates and static files with install. Thanks @bmorgan21.
8+
* Use readthedocs for documentation.
9+
410
0.2.0 (2015-11-03)
511
++++++++++++++++++
612

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
include *.rst LICENSE
2-
recursive-include node_modules/swagger-ui/dist *
2+
recursive-include flask_apispec *

dev-requirements.txt

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1+
# Task running
2+
invoke
3+
4+
# Testing
15
flake8
26
pytest>=2.7.3
37
pytest-cov
48
webtest
9+
10+
# Distribution
11+
wheel
12+
twine

flask_apispec/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
__version__ = '0.2.0'
3+
__version__ = '0.3.0'
44

55
from flask_apispec.views import ResourceMeta, MethodResource
66
from flask_apispec.annotations import doc, wrap_with, use_kwargs, marshal_with

flask_apispec/extension.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def add_routes(self):
4646
blueprint = flask.Blueprint(
4747
'flask-apispec',
4848
__name__,
49+
static_folder='./static',
4950
template_folder='./templates',
50-
static_folder='../node_modules/swagger-ui/dist',
5151
static_url_path='/flask-apispec/static',
5252
)
5353

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flask-apispec",
3-
"version": "0.2.0",
3+
"version": "0.3.0",
44
"dependencies": {
55
"swagger-ui": "2.1.3"
66
},

tasks.py

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# -*- coding: utf-8 -*-
2+
3+
from invoke import task, run
4+
5+
@task
6+
def clean():
7+
run('rm -rf dist')
8+
run('rm -rf build')
9+
run('rm -rf flask_apispec.egg-info')
10+
11+
@task
12+
def install():
13+
run('npm install')
14+
run('rm -rf flask_apispec/static')
15+
run('cp -r node_modules/swagger-ui/dist flask_apispec/static')
16+
17+
@task
18+
def publish(test=False):
19+
"""Publish to the cheeseshop."""
20+
clean()
21+
install()
22+
if test:
23+
run('python setup.py register -r test sdist bdist_wheel', echo=True)
24+
run('twine upload dist/* -r test', echo=True)
25+
else:
26+
run('python setup.py register sdist bdist_wheel', echo=True)
27+
run('twine upload dist/*', echo=True)

0 commit comments

Comments
 (0)