From 4425771117fd437b801200b37077b29401c74ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 29 May 2019 14:32:46 +0200 Subject: [PATCH] Suppress Cerberus deprecation warning caused by Eve Eve is falling behind on Cerberus. See my bug report on https://github.com/pyeve/eve/issues/1278 for more info. --- pillar/__init__.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pillar/__init__.py b/pillar/__init__.py index 4f665e83..ed018f69 100644 --- a/pillar/__init__.py +++ b/pillar/__init__.py @@ -12,15 +12,25 @@ import typing import os import os.path import pathlib +import warnings import jinja2 -from eve import Eve import flask from flask import g, render_template, request from flask_babel import Babel, gettext as _ from flask.templating import TemplateNotFound import pymongo.database + + +# These warnings have to be suppressed before the first import. +# Eve is falling behind on Cerberus. See https://github.com/pyeve/eve/issues/1278 +warnings.filterwarnings( + 'ignore', category=DeprecationWarning, + message="Methods for type testing are deprecated, use TypeDefinition and the " + "'types_mapping'-property of a Validator-instance instead") + from werkzeug.local import LocalProxy +from eve import Eve # Declare pillar.current_app before importing other Pillar modules.