mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 02:54:34 +02:00
Allow to execute a tox target without pinned dependencies (#6590)
This PR passes the CERTBOT_NO_PIN environment variable to the unit tests tox envs. By setting CERTBOT_NO_PIN to 1 before executing a given tox env, certbot dependencies will be installed at their latest version instead of the usual pinned version. I also moved the unpin logic one layer below to allow it to be used potentially more widely, and avoid unnecessary merging constraints operation in this case. As warnings are errors now, latest versions of Python will break now the tests, because collections launch a warning when some classes are imported from collections instead of collections.abc. Certbot code is patched, and warning is ignored for now, because a lot of third party libraries still depend on this behavior. * Allow to execute a tox target without pinned dependencies * Correct lint * Retrigger build. * Remove debug code * Added test against unpinned dependencies from test-everything-unpinned-dependencies branch * Remove duplicated assertion to pass TRAVIS and APPVEYOR in default tox environment.
This commit is contained in:
committed by
Brad Warren
parent
6f388945cd
commit
835f4b9271
+17
-10
@@ -80,19 +80,26 @@ def main(args):
|
||||
test_constraints = os.path.join(working_dir, 'test_constraints.txt')
|
||||
all_constraints = os.path.join(working_dir, 'all_constraints.txt')
|
||||
|
||||
requirements = None
|
||||
if os.environ.get('CERTBOT_OLDEST') == '1':
|
||||
requirements = certbot_oldest_processing(tools_path, args, test_constraints)
|
||||
if os.environ.get('CERTBOT_NO_PIN') == '1':
|
||||
# With unpinned dependencies, there is no constraint
|
||||
call_with_print('"{0}" -m pip install --ignore-installed {1}'
|
||||
.format(sys.executable, ' '.join(args)))
|
||||
else:
|
||||
certbot_normal_processing(tools_path, test_constraints)
|
||||
# Otherwise, we merge requirements to build the constraints and pin dependencies
|
||||
requirements = None
|
||||
if os.environ.get('CERTBOT_OLDEST') == '1':
|
||||
requirements = certbot_oldest_processing(tools_path, args, test_constraints)
|
||||
else:
|
||||
certbot_normal_processing(tools_path, test_constraints)
|
||||
|
||||
merge_requirements(tools_path, test_constraints, all_constraints)
|
||||
if requirements:
|
||||
call_with_print('"{0}" -m pip install --constraint "{1}" --requirement "{2}"'
|
||||
.format(sys.executable, all_constraints, requirements))
|
||||
merge_requirements(tools_path, test_constraints, all_constraints)
|
||||
|
||||
call_with_print('"{0}" -m pip install --constraint "{1}" {2}'
|
||||
.format(sys.executable, all_constraints, ' '.join(args)))
|
||||
if requirements:
|
||||
call_with_print('"{0}" -m pip install --constraint "{1}" --requirement "{2}"'
|
||||
.format(sys.executable, all_constraints, requirements))
|
||||
|
||||
call_with_print('"{0}" -m pip install --constraint "{1}" {2}'
|
||||
.format(sys.executable, all_constraints, ' '.join(args)))
|
||||
finally:
|
||||
if os.environ.get('TRAVIS'):
|
||||
print('travis_fold:end:install_certbot_deps')
|
||||
|
||||
Reference in New Issue
Block a user