Updated several dependencies to current version
Werkzeug update required a flask monkey patch since we can't update flask due to it depending on a newer jinja version which is backwards incompatible and hence would cause issues with third party plugins. Also added notes to the dependencies that are found to be hard to update so that future release preparations don't require to figure out the "why not" all over again.
This commit is contained in:
1 parent
4eb81aae9d
commit
4ed5f7ed28
3 files changed
+63
-32
No files matched your search
@@ -17,43 +17,47 @@ PYTHON_REQUIRES = ">=2.7.3,<3" # TODO change to >=2.7.9,<3 in 1.3.11
|
|||||||
|
|
||||||
# Requirements for our application
|
# Requirements for our application
|
||||||
INSTALL_REQUIRES = [
|
INSTALL_REQUIRES = [
|
||||||
"flask>=0.10.1,<0.11",
|
# the following dependencies are non trivial to update since later versions introduce backwards incompatible
|
||||||
"Jinja2>=2.8.1,<2.9", # Jinja 2.9 has breaking changes WRT template scope - we can't
|
# changes that might affect plugins, or due to other observed problems
|
||||||
# guarantee backwards compatibility for plugins and such with that
|
|
||||||
# version, hence we need to pin to a lower version for now. See #1697
|
"flask>=0.10.1,<0.11", # newer versions require newer Jinja versions
|
||||||
"werkzeug>=0.8.3,<0.9",
|
"Jinja2>=2.8.1,<2.9", # Jinja 2.9 has breaking changes WRT template scope - we can't
|
||||||
"tornado==4.5.3",
|
# guarantee backwards compatibility for plugins and such with that
|
||||||
#"sockjs-tornado>=1.0.3,<1.1", # current version is incompatible to tornado 5, we use a
|
# version, hence we need to pin to a lower version for now. See #1697
|
||||||
# vendored one
|
"tornado==4.5.3", # a memory leak was observed in tornado >= 5, see #2585
|
||||||
"PyYAML>=3.10,<3.11",
|
"Flask-Login>=0.2.11,<0.3", # some functions changed to properties in 0.3
|
||||||
"Flask-Login>=0.2.11,<0.3",
|
|
||||||
"Flask-Principal>=0.3.5,<0.4",
|
# anything below this should be checked on releases for new versions
|
||||||
"Flask-Babel>=0.9,<0.10",
|
|
||||||
"Flask-Assets>=0.10,<0.11",
|
"Flask-Principal>=0.4,<0.5",
|
||||||
"markdown>=2.6.9,<2.7",
|
"Flask-Babel>=0.12,<0.13",
|
||||||
|
"Flask-Assets>=0.12,<0.13",
|
||||||
|
"werkzeug>=0.14.1,<0.15",
|
||||||
|
"PyYAML>=3.13,<4",
|
||||||
|
"markdown>=3.0,<3.1",
|
||||||
"pyserial>=3.4,<3.5",
|
"pyserial>=3.4,<3.5",
|
||||||
"netaddr>=0.7.19,<0.8",
|
"netaddr>=0.7.19,<0.8",
|
||||||
"watchdog>=0.8.3,<0.9",
|
"watchdog>=0.9.0,<0.10",
|
||||||
"sarge==0.1.5post0",
|
"sarge==0.1.5post0",
|
||||||
"netifaces>=0.10.6,<0.11",
|
"netifaces>=0.10.7,<0.11",
|
||||||
"pylru>=1.0.9,<1.1",
|
"pylru>=1.1,<1.2",
|
||||||
"rsa>=3.2.3,<3.3",
|
"rsa>=4.0,<5",
|
||||||
"pkginfo>=1.4.2,<1.5",
|
"pkginfo>=1.4.2,<1.5",
|
||||||
"requests>=2.18.4,<3",
|
"requests>=2.20.0,<3",
|
||||||
"semantic_version>=2.4.2,<2.5",
|
"semantic_version>=2.6,<2.7",
|
||||||
"psutil>=5.4.6,<5.5",
|
"psutil>=5.4.8,<5.5",
|
||||||
"Click>=6.2,<6.3",
|
"Click>=7,<8",
|
||||||
"awesome-slugify>=1.6.5,<1.7",
|
"awesome-slugify>=1.6.5,<1.7",
|
||||||
"feedparser>=5.2.1,<5.3",
|
"feedparser>=5.2.1,<5.3",
|
||||||
"chainmap>=1.0.2,<1.1",
|
"chainmap>=1.0.2,<1.1",
|
||||||
"future>=0.15.2,<0.16",
|
"future>=0.17,<0.18",
|
||||||
"scandir>=1.3,<1.4",
|
"scandir>=1.9,<1.10",
|
||||||
"websocket-client>=0.40.0,<0.41",
|
"websocket-client>=0.53,<0.54",
|
||||||
"python-dateutil>=2.6.1,<2.7",
|
"python-dateutil>=2.7.5,<2.8",
|
||||||
"wrapt>=1.10.11,<1.11",
|
"wrapt>=1.10.11,<1.11",
|
||||||
"futures>=3.1.1,<3.2",
|
"futures>=3.2,<3.3",
|
||||||
"emoji>=0.4.5,<0.5",
|
"emoji>=0.5.1,<0.6",
|
||||||
"monotonic>=1.3,<1.4",
|
"monotonic>=1.5,<1.6",
|
||||||
"frozendict>=1.2,<1.3"
|
"frozendict>=1.2,<1.3"
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -66,11 +70,11 @@ EXTRA_REQUIRES = dict(
|
|||||||
develop=[
|
develop=[
|
||||||
# Testing dependencies
|
# Testing dependencies
|
||||||
"mock>=2.0.0,<3",
|
"mock>=2.0.0,<3",
|
||||||
"nose>=1.3.0,<1.4",
|
"nose>=1.3.7,<1.4",
|
||||||
"ddt",
|
"ddt",
|
||||||
|
|
||||||
# Documentation dependencies
|
# Documentation dependencies
|
||||||
"sphinx>=1.6,<1.7",
|
"sphinx>=1.8.1,<1.9",
|
||||||
"sphinxcontrib-httpdomain",
|
"sphinxcontrib-httpdomain",
|
||||||
"sphinxcontrib-mermaid>=0.3",
|
"sphinxcontrib-mermaid>=0.3",
|
||||||
"sphinx_rtd_theme",
|
"sphinx_rtd_theme",
|
||||||
@@ -78,7 +82,7 @@ EXTRA_REQUIRES = dict(
|
|||||||
|
|
||||||
# Dependencies for developing OctoPrint plugins
|
# Dependencies for developing OctoPrint plugins
|
||||||
plugins=[
|
plugins=[
|
||||||
"cookiecutter>=1.4,<1.7"
|
"cookiecutter>=1.6,<1.7"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -242,6 +242,7 @@ class Server(object):
|
|||||||
|
|
||||||
# monkey patch a bunch of stuff
|
# monkey patch a bunch of stuff
|
||||||
util.tornado.fix_json_encode()
|
util.tornado.fix_json_encode()
|
||||||
|
util.flask.fix_flask_jsonify()
|
||||||
util.flask.enable_additional_translations(additional_folders=[self._settings.getBaseFolder("translations")])
|
util.flask.enable_additional_translations(additional_folders=[self._settings.getBaseFolder("translations")])
|
||||||
|
|
||||||
# setup app
|
# setup app
|
||||||
|
|||||||
@@ -251,6 +251,32 @@ def fix_flask_login_remote_address():
|
|||||||
|
|
||||||
flask_login._get_remote_addr = fixed_get_remote_addr
|
flask_login._get_remote_addr = fixed_get_remote_addr
|
||||||
|
|
||||||
|
def fix_flask_jsonify():
|
||||||
|
def fixed_jsonify(*args, **kwargs):
|
||||||
|
"""Backported from https://github.com/pallets/flask/blob/7e714bd28b6e96d82b2848b48cf8ff48b517b09b/flask/json/__init__.py#L257"""
|
||||||
|
from flask.json import current_app, dumps
|
||||||
|
|
||||||
|
indent = None
|
||||||
|
separators = (',', ':')
|
||||||
|
|
||||||
|
if current_app.config['JSONIFY_PRETTYPRINT_REGULAR'] or current_app.debug:
|
||||||
|
indent = 2
|
||||||
|
separators = (', ', ': ')
|
||||||
|
|
||||||
|
if args and kwargs:
|
||||||
|
raise TypeError('jsonify() behavior undefined when passed both args and kwargs')
|
||||||
|
elif len(args) == 1: # single args are passed directly to dumps()
|
||||||
|
data = args[0]
|
||||||
|
else:
|
||||||
|
data = args or kwargs
|
||||||
|
|
||||||
|
return current_app.response_class(
|
||||||
|
dumps(data, indent=indent, separators=separators) + '\n',
|
||||||
|
mimetype='application/json'
|
||||||
|
)
|
||||||
|
|
||||||
|
flask.jsonify = fixed_jsonify
|
||||||
|
|
||||||
#~~ WSGI environment wrapper for reverse proxying
|
#~~ WSGI environment wrapper for reverse proxying
|
||||||
|
|
||||||
class ReverseProxiedEnvironment(object):
|
class ReverseProxiedEnvironment(object):
|
||||||
|
|||||||
Reference in new issue
Block a user