From 9da4dd685d0eda2ff0de4abc1541b55cae713ebe Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Mon, 1 Feb 2021 15:02:55 -0800 Subject: [PATCH] update Certbot's mock usage --- certbot/certbot/tests/util.py | 7 +++++++ certbot/setup.py | 8 -------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/certbot/certbot/tests/util.py b/certbot/certbot/tests/util.py index b9d5caa08..acb31819f 100644 --- a/certbot/certbot/tests/util.py +++ b/certbot/certbot/tests/util.py @@ -6,12 +6,19 @@ import shutil import sys import tempfile import unittest +import warnings from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization import josepy as jose try: import mock + warnings.warn( + "The external mock module is being used for backwards compatibility " + "since it is available, however, future versions of Certbot's tests will " + "use unittest.mock. Be sure to update your code accordingly.", + PendingDeprecationWarning + ) except ImportError: # pragma: no cover from unittest import mock # type: ignore import OpenSSL diff --git a/certbot/setup.py b/certbot/setup.py index e1c86308e..b7f501290 100644 --- a/certbot/setup.py +++ b/certbot/setup.py @@ -72,14 +72,6 @@ elif os.name == 'nt': # setuptools, pywin32 will not be specified as a dependency. install_requires.append(pywin32_req) -if setuptools_known_environment_markers: - install_requires.append('mock ; python_version < "3.3"') -elif 'bdist_wheel' in sys.argv[1:]: - raise RuntimeError('Error, you are trying to build certbot wheels using an old version ' - 'of setuptools. Version 36.2+ of setuptools is required.') -elif sys.version_info < (3,3): - install_requires.append('mock') - dev_extras = [ 'coverage', 'pytest',