Fix compatibility with werkzeug 1.0.0. Fixes #611 (#614)

This commit is contained in:
Jelmer Vernooij 2020-02-15 15:52:10 +01:00 committed by GitHub
parent 1633d9261e
commit 3e3ee8b641
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 9 additions and 11 deletions

View File

@ -3,8 +3,6 @@ matrix:
include:
- python: 2.7
env: TOX_ENV=py27
- python: 3.4
env: TOX_ENV=py34
- python: 3.5
env: TOX_ENV=py35
- python: 3.6

View File

@ -57,11 +57,11 @@ from itsdangerous import URLSafeTimedSerializer
from werkzeug.routing import Map
from werkzeug.exceptions import HTTPException, InternalServerError
from werkzeug.wsgi import SharedDataMiddleware
from werkzeug.middleware.shared_data import SharedDataMiddleware
from werkzeug.local import Local, LocalManager
from werkzeug.serving import run_simple
from werkzeug.contrib.fixers import ProxyFix
from werkzeug.contrib.profiler import ProfilerMiddleware
from werkzeug.middleware.proxy_fix import ProxyFix
from werkzeug.middleware.profiler import ProfilerMiddleware
local = Local()
local_manager = LocalManager([local])

View File

@ -19,7 +19,8 @@ if PY2K:
else:
import _thread as thread
from werkzeug.contrib.cache import NullCache, SimpleCache
from flask_caching.backends.null import NullCache
from flask_caching.backends.simple import SimpleCache
logger = logging.getLogger("isso")

View File

@ -8,7 +8,7 @@ import logging
from glob import glob
from werkzeug.wsgi import DispatcherMiddleware
from werkzeug.middleware.dispatcher import DispatcherMiddleware
from werkzeug.wrappers import Response
from isso import dist, make_app, wsgi, config

View File

@ -146,7 +146,7 @@ class CORSMiddleware(object):
if self.exposed:
headers.add("Access-Control-Expose-Headers",
", ".join(self.exposed))
return start_response(status, headers.to_list(), exc_info)
return start_response(status, headers.to_wsgi_list(), exc_info)
if environ.get("REQUEST_METHOD") == "OPTIONS":
add_cors_headers("200 Ok", [("Content-Type", "text/plain")])

View File

@ -6,7 +6,7 @@ import sys
from setuptools import setup, find_packages
requires = ['itsdangerous', 'Jinja2', 'misaka>=2.0,<3.0', 'html5lib',
'werkzeug>=0.9', 'bleach']
'werkzeug>=1.0', 'bleach', 'flask-caching']
if sys.version_info < (2, 7):
raise SystemExit("Python 2 versions < 2.7 are not supported.")
@ -31,7 +31,6 @@ setup(
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6"
],

View File

@ -1,5 +1,5 @@
[tox]
envlist = py27,py34,py35,py36,py37
envlist = py27,py35,py36,py37
[testenv]
deps =