Add warnings about Python 3.5 deprecation in Certbot (#8154)

Fixes #8149

This PR adds warnings to warn about the incoming deprecation of Python 3.5 in Certbot.

* Add warnings about Python 3.5 deprecation in Certbot

* Update certbot/certbot/__init__.py

Co-authored-by: Brad Warren <bmw@users.noreply.github.com>

Co-authored-by: Brad Warren <bmw@users.noreply.github.com>
This commit is contained in:
Adrien Ferrand
2020-07-20 17:46:38 -07:00
committed by GitHub
co-authored by Brad Warren
parent 74b0340a13
commit 270b5535e2
4 changed files with 23 additions and 0 deletions
+8
View File
@@ -20,3 +20,11 @@ for mod in list(sys.modules):
# preserved (acme.jose.* is josepy.*)
if mod == 'josepy' or mod.startswith('josepy.'):
sys.modules['acme.' + mod.replace('josepy', 'jose', 1)] = sys.modules[mod]
if sys.version_info[:2] == (3, 5):
warnings.warn(
"Python 3.5 support will be dropped in the next release of "
"acme. Please upgrade your Python version.",
PendingDeprecationWarning,
) # pragma: no cover
+2
View File
@@ -14,6 +14,8 @@ Certbot adheres to [Semantic Versioning](https://semver.org/).
* The Linode DNS plugin now waits 120 seconds for DNS propagation, instead of 1200,
due to https://www.linode.com/blog/linode/linode-turns-17/
* We deprecated support for Python 3.5 in Certbot and its ACME library.
Support for Python 3.5 will be removed in the next major release of Certbot.
### Fixed
+9
View File
@@ -1,4 +1,13 @@
"""Certbot client."""
import warnings
import sys
# version number like 1.2.3a0, must have at least 2 parts, like 1.2
__version__ = '1.7.0.dev0'
if sys.version_info[:2] == (3, 5):
warnings.warn(
"Python 3.5 support will be dropped in the next release of "
"certbot. Please upgrade your Python version.",
PendingDeprecationWarning,
) # pragma: no cover
+4
View File
@@ -1343,6 +1343,10 @@ def main(cli_args=None):
if config.func != plugins_cmd: # pylint: disable=comparison-with-callable
raise
if sys.version_info[:2] == (3, 5):
logger.warning("Python 3.5 support will be dropped in the next release "
"of Certbot - please upgrade your Python version.")
set_displayer(config)
# Reporter