Use python 2.7 as the default interpreter in tox

Infra uses Python 3.5 of tox jobs.
The pep8 job and py27djNNN jobs are now run with python3.5
while they are expected to run with python2.7 as of the release.

The pep8 job fails on Python2-specific code in the
openstack_dashboard/dashboards/admin/images/views.py module with 'long'
type cast. This patch enforces us to use Python 2.7 for pep8 job.

This probably could be fixed in the infra side but as a short term
solution we can cope with this situation in the horizon repo side.

[stable/ocata only]
karma.conf.js used in the nodejs-npm-run-test job assumes python 2.7
is used when searching JS libraries, so we need to ensure python 2.7
is used for "npm" tox env. This change fixes the issue too.

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: I25b0b00eb3d575f8a8c1705f987cfcc0336eccfb
(cherry picked from commit f294fa93c2)
This commit is contained in:
Ivan Kolodyazhny 2020-01-10 00:14:46 +02:00 committed by Akihiro Motoki
parent bef5eaef67
commit 9eaa4239fc
1 changed files with 3 additions and 0 deletions

View File

@ -4,6 +4,7 @@ minversion = 2.3.2
skipsdist = True
[testenv]
basepython = python2.7
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/ocata} {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
@ -29,12 +30,14 @@ commands =
venv: {posargs}
[testenv:py34]
basepython = python3.4
setenv =
PYTHONUNBUFFERED = 1
{[testenv]setenv}
commands = {[unit_tests]commands}
[testenv:py35]
basepython = python3.5
setenv =
PYTHONUNBUFFERED = 1
{[testenv]setenv}