Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ansible/ansible.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Doran <sdoran@redhat.com>2021-05-18 23:12:32 +0300
committerGitHub <noreply@github.com>2021-05-18 23:12:32 +0300
commitc0cb353ce1f735d514eb59a0783a51aa0ddd13e8 (patch)
treede5d0f65b54e9719349ba1048260d433c0f420e9 /setup.py
parent4bf420706b2bf8591366e9eadf0db0afc6eccb17 (diff)
Remove PyCrypto (#74699)
* Remove PyCrypto from setup.py and packaging script * Remove mention of pycrpto from installation docs * Remove PyCrypto from vault * Remove pycryto constraint and unit test requirement * Remove PyCrypto tests from unit tests * Add docs and fix warning message * Remove section about cryptography library in Ansible Vault docs
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py38
1 files changed, 1 insertions, 37 deletions
diff --git a/setup.py b/setup.py
index b22e6cb5772..1cf9f08ff17 100644
--- a/setup.py
+++ b/setup.py
@@ -295,48 +295,12 @@ def read_requirements(file_name):
return reqs
-PYCRYPTO_DIST = 'pycrypto'
-
-
-def get_crypto_req():
- """Detect custom crypto from ANSIBLE_CRYPTO_BACKEND env var.
-
- pycrypto or cryptography. We choose a default but allow the user to
- override it. This translates into pip install of the sdist deciding what
- package to install and also the runtime dependencies that pkg_resources
- knows about.
- """
- crypto_backend = os.environ.get('ANSIBLE_CRYPTO_BACKEND', '').strip()
-
- if crypto_backend == PYCRYPTO_DIST:
- # Attempt to set version requirements
- return '%s >= 2.6' % PYCRYPTO_DIST
-
- return crypto_backend or None
-
-
-def substitute_crypto_to_req(req):
- """Replace crypto requirements if customized."""
- crypto_backend = get_crypto_req()
-
- if crypto_backend is None:
- return req
-
- def is_not_crypto(r):
- CRYPTO_LIBS = PYCRYPTO_DIST, 'cryptography'
- return not any(r.lower().startswith(c) for c in CRYPTO_LIBS)
-
- return [r for r in req if is_not_crypto(r)] + [crypto_backend]
-
-
def get_dynamic_setup_params():
"""Add dynamically calculated setup params to static ones."""
return {
# Retrieve the long description from the README
'long_description': read_file('README.rst'),
- 'install_requires': substitute_crypto_to_req(
- read_requirements('requirements.txt'),
- ),
+ 'install_requires': read_requirements('requirements.txt'),
}