From d4ef151cc45e3a338f2e2ae56e29d75096231024 Mon Sep 17 00:00:00 2001 From: Yun Xu Date: Thu, 9 May 2019 20:52:24 -0700 Subject: [PATCH 1/2] deprecation: deprecate the use of remove_route --- sanic/app.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sanic/app.py b/sanic/app.py index be0d45bc..baf20e5c 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -555,12 +555,20 @@ class Sanic: This method provides the app user a mechanism by which an already existing route can be removed from the :class:`Sanic` object + .. warning:: + remove_route is deprecated in v19.06 and will be removed from future versions. + :param uri: URL Path to be removed from the app :param clean_cache: Instruct sanic if it needs to clean up the LRU route cache :param host: IP address or FQDN specific to the host :return: None """ + warnings.warn( + "remove_route is deprecated and will be removed from future versions.", + DeprecationWarning, + stacklevel=2, + ) self.router.remove(uri, clean_cache, host) # Decorator From bd89c7f2692f376ea27df7068630261c33183cd0 Mon Sep 17 00:00:00 2001 From: Yun Xu Date: Thu, 9 May 2019 21:14:27 -0700 Subject: [PATCH 2/2] fix lint issue --- sanic/app.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sanic/app.py b/sanic/app.py index baf20e5c..ce8770bd 100644 --- a/sanic/app.py +++ b/sanic/app.py @@ -556,7 +556,8 @@ class Sanic: existing route can be removed from the :class:`Sanic` object .. warning:: - remove_route is deprecated in v19.06 and will be removed from future versions. + remove_route is deprecated in v19.06 and will be removed + from future versions. :param uri: URL Path to be removed from the app :param clean_cache: Instruct sanic if it needs to clean up the LRU @@ -565,7 +566,8 @@ class Sanic: :return: None """ warnings.warn( - "remove_route is deprecated and will be removed from future versions.", + "remove_route is deprecated and will be removed " + "from future versions.", DeprecationWarning, stacklevel=2, )