From ef1a35f4e19c0460c27c9e0577e8e41d7dd52b0b Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 20 Apr 2021 15:44:43 -0700 Subject: [PATCH] Install PBR explicitly We do this because easy_install on python3.5 is failing to find pbr. I believe this is happening due to pypi's deprecation of non SNI tls connections. They report that the version of 3.5 on xenial should be able to do SNI but easy_install at least doesn't seem to do so. Note we restrict this to python>=3 and <=3.5 as python 2.7 had backported fixes. Also, this really only helps with unittesting via tox as we instruct tox to explicitly install the requirements files before creating/installing the package itself. This is the reason we stick this in test-requirements.txt rather than requirements.txt. Change-Id: Iac2c1f4f575de250ed0dba22d33b017322fd7562 --- test-requirements.txt | 4 ++++ tox.ini | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/test-requirements.txt b/test-requirements.txt index ad03fc16..c1755118 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,3 +1,7 @@ +# This is listed in order to preinstall PBR with pip as easy_install +# on these older python versions can no longer reliably talk to pypi +# due to non SNI TLS connections being disabled. +pbr ; python_version >= "3" and python_version <= "3.5" hacking>=2.0.0,<2.1.0 mock fixtures>=0.3.14 diff --git a/tox.ini b/tox.ini index 0152d7bc..66148bc9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,15 @@ [tox] envlist = linters,docs,py3 ignore_basepython_conflict = true +# We skipsdist to force test-requirements and specifically pbr +# to be installed prior to installing git-review. This ensures that +# easy_install doesn't try to talk to pypi.org for pbr which fails +# on older python due to a lack of SNI support. +skipsdist = true [testenv] basepython = python3 +usedevelop = true # See "testing behind a proxy" https://review.opendev.org/624496 passenv = http_proxy