Skip to content

Commit

Permalink
Fix compatibility to Sanic v21.3
Browse files Browse the repository at this point in the history
Replace sanic-plugins-framework with sanic-plugin-toolkit
Continue to slowly fix some tests
  • Loading branch information
ashleysommer committed Jun 11, 2021
1 parent d4a84d8 commit 000bb2f
Show file tree
Hide file tree
Showing 21 changed files with 166 additions and 199 deletions.
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
language: python

python:
- 2.7
- 3.4
- 3.5
- 3.6
- 3.7
- 3.8
- 3.9
- pypy
- pypy3

matrix:
include:
- python: 3.8-dev
- python: 3.8
dist: xenial
allow_failures:
- python: pypy3
- python: 3.8-dev

install:
- pip install .[dev]
Expand Down
17 changes: 10 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ and expose its documentation properly using `Swagger`_.
Compatibility
=============

Sanic-RestPlus requires Python 3.5+.
Sanic-RestPlus works with Sanic v18.12+
* Sanic-RestPlus requires Python 3.7+.
* Sanic-RestPlus works with Sanic v21.3+



Important Compatibility Notice
------------------------------

Sanic-RestPlus version 0.6.0 was reworked and now requires Sanic v21.3 or later.

Sanic-RestPlus version 0.4.1 (and previous versions) **does not work** on Sanic 19.12+, see this bug here: https://github.com/ashleysommer/sanicpluginsframework/issues/15

Please use latest Sanic-Restplus (v0.5.3 or greater) if you need to deploy on Sanic v19.12+.
Please use Sanic-Restplus v0.5.x if you need to deploy on Sanic v19.12 or v20.12

If you are using the new Sanic v20.12LTS, please use Sanic-RestPlus v0.5.5 or greater.
If you are using the Sanic v20.12LTS, please use Sanic-RestPlus v0.5.6.


Installation
Expand Down Expand Up @@ -52,10 +55,10 @@ With Sanic-Restplus, you only import the api instance to route and document your
from sanic import Sanic
from sanic_restplus import Api, Resource, fields
from sanic_restplus.restplus import restplus
from spf import SanicPluginsFramework
from sanic_plugin_toolkit import SanicPluginRealm
app = Sanic(__name__)
spf = SanicPluginsFramework(app)
rest_assoc = spf.register_plugin(restplus)
realm = SanicPluginRealm(app)
rest_assoc = realm.register_plugin(restplus)
api = Api(version='1.0', title='TodoMVC API',
description='A simple TodoMVC API')
Expand Down
2 changes: 1 addition & 1 deletion doc/scaling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Each `apivX` module will have the following pattern:
# ...
from .apis.namespaceX import api as nsX
blueprint = Blueprint('api', __name__, url_prefix='/api/1')
blueprint = Blueprint('api', url_prefix='/api/1')
api = Api(blueprint
title='My Title',
version='1.0',
Expand Down
2 changes: 1 addition & 1 deletion doc/swagger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ You can control the Swagger UI path with the ``doc`` parameter (defaults to the
from flask_restplus import Api
app = Flask(__name__)
blueprint = Blueprint('api', __name__, url_prefix='/api')
blueprint = Blueprint('api', url_prefix='/api')
api = Api(blueprint, doc='/doc/')
app.register_blueprint(blueprint)
Expand Down
6 changes: 3 additions & 3 deletions examples/complex.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from sanic import Sanic
from sanic_restplus.restplus import restplus
from spf import SanicPluginsFramework
from sanic_plugin_toolkit import SanicPluginRealm
from examples.zoo import api

app = Sanic(__name__)
spf = SanicPluginsFramework(app)
rest_assoc = spf.register_plugin(restplus)
realm = SanicPluginRealm(app)
rest_assoc = realm.register_plugin(restplus)
rest_assoc.api(api)

app.run(debug=True, auto_reload=False)
6 changes: 3 additions & 3 deletions examples/todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from sanic_restplus import Api, fields, Resource
from sanic_restplus.cors import crossdomain
from sanic_restplus.restplus import restplus
from spf import SanicPluginsFramework
from sanic_plugin_toolkit import SanicPluginRealm
app = Sanic(__name__)
spf = SanicPluginsFramework(app)
rest_assoc = spf.register_plugin(restplus)
realm = SanicPluginRealm(app)
rest_assoc = realm.register_plugin(restplus)

api = Api(version='1.0', title='Todo API',
description='A simple TODO API')
Expand Down
2 changes: 1 addition & 1 deletion examples/todo_blueprint.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from flask import Flask, Blueprint
from flask_restplus import Api, Resource, fields

api_v1 = Blueprint('api', __name__, url_prefix='/api/1')
api_v1 = Blueprint('api', url_prefix='/api/1')

api = Api(api_v1, version='1.0', title='Todo API',
description='A simple TODO API',
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions requirements/install.pip
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
aniso8601>=0.82
jsonschema
methodtools
sanic>=18.12.0,<21
sanic-jinja2-spf>=0.8.0
sanic-plugins-framework>=0.9.5
sanic>=21.3.4,<22
sanic-jinja2>=0.10.0
sanic-plugin-toolkit>=1.0.1
1 change: 1 addition & 0 deletions requirements/test.pip
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ pytest-asyncio
pytest-mock==1.10.4
pytest-profiling==1.7.0
pytest-sugar==0.9.2
sanic-testing>=0.4.0
tzlocal
2 changes: 1 addition & 1 deletion sanic_restplus/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: latin-1 -*-
#
__version__ = '0.5.6'
__version__ = '0.6.0'
__description__ = 'Fully featured framework for fast, easy and documented API development with Sanic'
Loading

0 comments on commit 000bb2f

Please sign in to comment.