mirror of
https://github.com/certbot/certbot.git
synced 2026-01-26 07:41:33 +03:00
Do not require mock in Python 3 in certbot-compatibility-test module (#7899)
* Do not require mock in Python 3 in certbot-compatibility-test module * error when trying to build wheels with old setuptools * add type: ignores
This commit is contained in:
@@ -3,7 +3,10 @@ import os
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
import mock
|
||||
try:
|
||||
import mock
|
||||
except ImportError: # pragma: no cover
|
||||
from unittest import mock # type: ignore
|
||||
import zope.interface
|
||||
|
||||
from certbot import errors as le_errors
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
"""Tests for certbot_compatibility_test.validator."""
|
||||
import unittest
|
||||
|
||||
import mock
|
||||
try:
|
||||
import mock
|
||||
except ImportError: # pragma: no cover
|
||||
from unittest import mock # type: ignore
|
||||
import OpenSSL
|
||||
import requests
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
from distutils.version import StrictVersion
|
||||
import sys
|
||||
|
||||
from setuptools import __version__ as setuptools_version
|
||||
from setuptools import find_packages
|
||||
from setuptools import setup
|
||||
|
||||
@@ -8,12 +10,20 @@ version = '1.4.0.dev0'
|
||||
install_requires = [
|
||||
'certbot',
|
||||
'certbot-apache',
|
||||
'mock',
|
||||
'six',
|
||||
'requests',
|
||||
'zope.interface',
|
||||
]
|
||||
|
||||
setuptools_known_environment_markers = (StrictVersion(setuptools_version) >= StrictVersion('36.2'))
|
||||
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')
|
||||
|
||||
if sys.version_info < (2, 7, 9):
|
||||
# For secure SSL connexion with Python 2.7 (InsecurePlatformWarning)
|
||||
install_requires.append('ndg-httpsclient')
|
||||
|
||||
Reference in New Issue
Block a user