Use python3 to calculate freezes

We need the integration gate to work with both trusty (python3.4) and
xenial (python3.5).  Rather than hard code the full python binary just
use python 3 and let the OS mange this for us. This is less than ideal
but it's the best we can do right now to unblock the gate.

We also address a short term issue with out upper-constraints.txt files
and manually copy the constraints from 3.4 to 3.5

Related-Bug: 1620436
Change-Id: I6acabf86933b7a7bce7baf44e6b512e7d0d2f6db
This commit is contained in:
Ihar Hrachyshka 2016-08-29 06:43:59 +00:00 committed by Tony Breeds
parent 4b29193248
commit b97f008059
4 changed files with 9 additions and 7 deletions

View File

@ -154,7 +154,7 @@ generate-constraints
Compile a constraints file showing the versions resulting from installing all Compile a constraints file showing the versions resulting from installing all
of ``global-requirements.txt``:: of ``global-requirements.txt``::
generate-constraints -p /usr/bin/python2.7 -p /usr/bin/python3.4 \ generate-constraints -p /usr/bin/python2.7 -p /usr/bin/python3 \
-b blacklist.txt -r global-requirements.txt > new-constraints.txt -b blacklist.txt -r global-requirements.txt > new-constraints.txt
edit-constraints edit-constraints
@ -185,12 +185,12 @@ Regenerating involves five steps.
2) Create a reference file (do this without your patch applied):: 2) Create a reference file (do this without your patch applied)::
generate-constraints -p /usr/bin/python2.7 -p /usr/bin/python3.4 \ generate-constraints -p /usr/bin/python2.7 -p /usr/bin/python3 \
-b blacklist.txt -r global-requirements.txt > baseline -b blacklist.txt -r global-requirements.txt > baseline
3) Apply your patch and generate a new reference file:: 3) Apply your patch and generate a new reference file::
generate-constraints -p /usr/bin/python2.7 -p /usr/bin/python3.4 \ generate-constraints -p /usr/bin/python2.7 -p /usr/bin/python3 \
-b blacklist.txt -r global-requirements.txt > updated -b blacklist.txt -r global-requirements.txt > updated
4) Diff them:: 4) Diff them::

View File

@ -56,11 +56,11 @@ def _freeze(requirements, python):
executables to test under, and then union the results. This is in fact the executables to test under, and then union the results. This is in fact the
key difference between a constraints file and a requirements file: we're key difference between a constraints file and a requirements file: we're
not triggering installation, so we can and will list packages that are not triggering installation, so we can and will list packages that are
not relevant to e.g. Python3.4 in the constraints output. not relevant to e.g. Python3 in the constraints output.
:param requirements: The path to a requirements file to use when generating :param requirements: The path to a requirements file to use when generating
the constraints. the constraints.
:param python: A Python binary to use. E.g. /usr/bin/python3.4 :param python: A Python binary to use. E.g. /usr/bin/python3
:return: A tuple (python_version, list of (package, version)'s) :return: A tuple (python_version, list of (package, version)'s)
""" """
output = [] output = []
@ -167,7 +167,7 @@ def main(argv=None, stdout=None):
parser.add_option( parser.add_option(
"-p", dest="pythons", action="append", "-p", dest="pythons", action="append",
help="Specify Python versions to use when generating constraints." help="Specify Python versions to use when generating constraints."
"e.g. -p /usr/bin/python3.4") "e.g. -p /usr/bin/python3")
parser.add_option( parser.add_option(
"-r", dest="requirements", help="Requirements file to process.") "-r", dest="requirements", help="Requirements file to process.")
parser.add_option( parser.add_option(

View File

@ -67,7 +67,7 @@ UPDATE="$tmpdir/all_requirements/bin/update-requirements"
# Check that we can generate an upper-requirements.txt file with the change # Check that we can generate an upper-requirements.txt file with the change
# that is being proposed. # that is being proposed.
$tmpdir/all_requirements/bin/generate-constraints -p /usr/bin/python2.7 \ $tmpdir/all_requirements/bin/generate-constraints -p /usr/bin/python2.7 \
-p /usr/bin/python3.4 -b $REPODIR/requirements/blacklist.txt \ -p /usr/bin/python3 -b $REPODIR/requirements/blacklist.txt \
-r $REPODIR/requirements/global-requirements.txt -r $REPODIR/requirements/global-requirements.txt
for PROJECT in $PROJECTS ; do for PROJECT in $PROJECTS ; do

View File

@ -111,6 +111,7 @@ django-openstack-auth===2.4.0
django-pyscss===2.0.2 django-pyscss===2.0.2
dnspython===1.14.0 dnspython===1.14.0
dnspython3===1.12.0;python_version=='3.4' dnspython3===1.12.0;python_version=='3.4'
dnspython3===1.12.0;python_version=='3.5'
doc8===0.7.0 doc8===0.7.0
docker-py===1.7.2 docker-py===1.7.2
docutils===0.12 docutils===0.12
@ -230,6 +231,7 @@ oslotest===2.10.0
osprofiler===1.4.0 osprofiler===1.4.0
ovs===2.5.0;python_version=='2.7' ovs===2.5.0;python_version=='2.7'
ovs===2.6.0.dev3;python_version=='3.4' ovs===2.6.0.dev3;python_version=='3.4'
ovs===2.6.0.dev3;python_version=='3.5'
packaging===16.7 packaging===16.7
paramiko===2.0.2 paramiko===2.0.2
passlib===1.6.5 passlib===1.6.5