8000 Release v2.0 by jacebrowning · Pull Request #111 · flask-api/flask-api · GitHub
[go: up one dir, main page]

Skip to content

Release v2.0 #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Nov 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Drop support for Python <3.5 and Flask <1.1
  • Loading branch information
jacebrowning committed Nov 27, 2019
commit adc4204d26f5f52ac9d504bc4d59ddde1e108fd2
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ dist: xenial

language: python
python:
- 2.7
- 3.5
- 3.6
- 3.7
Expand All @@ -16,8 +15,6 @@ env:
global:
- RANDOM_SEED=0
matrix:
- FLASK_VERSION=0.12.4
- FLASK_VERSION=1.0.4
- FLASK_VERSION=1.1.1

before_install:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Flask API is a drop-in replacement for Flask that provides an implementation of

Requirements:

* Python 2.7+ or 3.4+
* Flask 0.12.4+
* Python 3.5+
* Flask 1.1.+

Install using `pip`:

Expand Down
5 changes: 5 additions & 0 deletions docs/about/release-notes.md
8000
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release Notes

## Version 2.0 (unreleased)

* Dropped support for Python `<3.5`.
* Dropped support for Flask `<1.1`.

## Version 1.1

* Added support for custom JSON encoders.
Expand Down
32 changes: 16 additions & 16 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Flask API is a drop-in replacement for Flask that provides an implementation of

Requirements:

* Python 2.7+ or 3.4+
* Flask 0.12.3+
* Python 3.5+
* Flask 1.1+

The following packages are optional:

Expand All @@ -39,7 +39,7 @@ Return any valid response object as normal, or return a `list` or `dict`.
def example():
return {'hello': 'world'}

A renderer for the response data will be selected using content negotiation based on the client 'Accept' header. If you're making the API request from a regular client, this will default to a JSON response. If you're viewing the API in a browser it'll default to the browsable API HTML.
A renderer for the response data will be selected using content negotiation based on the client 'Accept' header. If you're making the API request from a regular client, this will default to a JSON response. If you're viewing the API in a browser it'll default to the browsable API HTML.

## Requests

Expand All @@ -55,23 +55,23 @@ The following example demonstrates a simple API for creating, listing, updating

from flask import request, url_for
from flask_api import FlaskAPI, status, exceptions

app = FlaskAPI(__name__)


notes = {
0: 'do the shopping',
1: 'build the codez',
2: 'paint the door',
}

def note_repr(key):
return {
'url': request.host_url.rstrip('/') + url_for('notes_detail', key=key),
'text': notes[key]
}


@app.route("/", methods=['GET', 'POST'])
def notes_list():
"""
Expand All @@ -82,11 +82,11 @@ The following example demonstrates a simple API for creating, listing, updating
idx = max(notes.keys()) + 1
notes[idx] = note
return note_repr(idx), status.HTTP_201_CREATED

# request.method == 'GET'
return [note_repr(idx) for idx in sorted(notes.keys())]


@app.route("/<int:key>/", methods=['GET', 'PUT', 'DELETE'])
def notes_detail(key):
"""
Expand All @@ -96,17 +96,17 @@ The following example demonstrates a simple API for creating, listing, updating
note = str(request.data.get('text', ''))
notes[key] = note
return note_repr(key)

elif request.method == 'DELETE':
notes.pop(key, None)
return '', status.HTTP_204_NO_CONTENT

# request.method == 'GET'
if key not in notes:
raise exceptions.NotFound()
return note_repr(key)


if __name__ == "__main__":
app.run(debug=True)

Expand Down
2 changes: 1 addition & 1 deletion flask_api/__init__.py
< 8000 td id="diff-d61103a7a17e0f50629f21dd8fadd149be09fce1a5ecac7ff74699b0fe19537eR2" data-line-number="2" class="blob-num blob-num-context js-linkable-line-number js-blob-rnum">
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from flask_api.app import FlaskAPI

__version__ = '1.1'
__version__ = '2.0b1'
6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
author = 'Tom Christie'
author_email = 'tom@tomchristie.com'
license = 'BSD'
install_requires = [
'Flask >= 0.12.3',
]
install_requires = ['Flask >= 1.1']

long_description = """Browsable web APIs for Flask."""

Expand Down Expand Up @@ -75,8 +73,6 @@ def get_package_data(package):
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
Expand Down
0