Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Flask 0.8 compatibility and testing

  • Loading branch information...
commit c13064ae2044580fb947955320e7257f718578f9 1 parent c8714ae
@drdaeman authored
Showing with 44 additions and 4 deletions.
  1. +9 −0 flask_toybox/compat.py
  2. +7 −2 setup.py
  3. +28 −2 tox.ini
View
9 flask_toybox/compat.py
@@ -7,3 +7,12 @@
from collections import OrderedDict
except ImportError: # pragma: no cover
from ordereddict import OrderedDict
+
+# PATCH method was recognized only in Flask 0.9+, so monkey patching is needed
+# for older versions. Not pretty, but does the job and shouldn't have any
+# bad consequences.
+
+import flask.views
+if not "patch" in flask.views.http_method_funcs:
+ flask.views.http_method_funcs = frozenset(
+ list(flask.views.http_method_funcs) + ["patch"])
View
9 setup.py
@@ -1,10 +1,15 @@
#!/usr/bin/env python
from setuptools import setup
+import collections
+
+deps = ["Flask >=0.8"]
+if not hasattr(collections, "OrderedDict"):
+ deps.append("ordereddict")
setup(
name="Flask-ToyBox",
- version="0.0.2",
+ version="0.0.3",
url="https://github.com/drdaeman/flask-toybox/",
license="MIT",
author="Aleksey Zhukov",
@@ -15,7 +20,7 @@
test_suite="tests",
zip_safe=False,
platforms="any",
- install_requires=["Flask >=0.9"],
+ install_requires=deps,
classifiers=[
"Development Status :: 2 - Pre-Alpha",
"Environment :: Web Environment",
View
30 tox.ini
@@ -1,12 +1,14 @@
[tox]
-envlist=py2.6,py2.7,pypy
+envlist=py2.6,py2.7,pypy,py2.6-flask0.8,py2.7-flask0.8
+
+[testenv:common]
+deps=
[testenv]
commands=
coverage run --source flask_toybox -m unittest discover
coverage report -m
deps=
- flask >=0.9
coverage
sqlalchemy
pyyaml
@@ -16,6 +18,7 @@ basepython=python2.6
deps=
discover
ordereddict
+ flask >=0.9
{[testenv]deps}
commands=
coverage run --source flask_toybox -m discover
@@ -23,6 +26,29 @@ commands=
[testenv:py2.7]
basepython=python2.7
+deps=
+ flask >=0.9
+ {[testenv]deps}
[testenv:pypy]
basepython=pypy
+deps=
+ flask >=0.9
+ {[testenv]deps}
+
+[testenv:py2.6-flask0.8]
+basepython=python2.6
+deps=
+ discover
+ ordereddict
+ flask ==0.8
+ {[testenv]deps}
+commands=
+ coverage run --source flask_toybox -m discover
+ coverage report -m
+
+[testenv:py2.7-flask0.8]
+basepython=python2.7
+deps=
+ flask ==0.8
+ {[testenv]deps}
Please sign in to comment.
Something went wrong with that request. Please try again.