diff options
author | Sam Doran <sdoran@redhat.com> | 2021-05-18 16:12:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-18 16:12:32 -0400 |
commit | c0cb353ce1f735d514eb59a0783a51aa0ddd13e8 (patch) | |
tree | de5d0f65b54e9719349ba1048260d433c0f420e9 /setup.py | |
parent | 4bf420706b2bf8591366e9eadf0db0afc6eccb17 (diff) | |
download | ansible-c0cb353ce1f735d514eb59a0783a51aa0ddd13e8.tar.gz |
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.py | 38 |
1 files changed, 1 insertions, 37 deletions
@@ -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'), } |