fix tox python3 overrides

We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: Ib45159432550c6c15a29443d8c786e8f28c1d0c4
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Co-Authored-By: Bartosz Zurkowski <b.zurkowski@samsung.com>
This commit is contained in:
Doug Hellmann 2018-09-26 19:04:59 -04:00 committed by Bartosz Zurkowski
parent 43d5fa5def
commit dc7c4cdf3f
2 changed files with 7 additions and 1 deletions

View File

@ -17,9 +17,11 @@ commands = /bin/bash run_tests.sh -N --no-pep8 {posargs}
setenv = DJANGO_SETTINGS_MODULE=trove_dashboard.test.settings
[testenv:pep8]
basepython = python3
commands = flake8
[testenv:venv]
basepython = python3
commands = {posargs}
[testenv:py35dj20]
@ -32,15 +34,18 @@ basepython = python2.7
commands = /bin/bash run_tests.sh -N --integration --selenium-headless {posargs}
[testenv:cover]
basepython = python3
commands = python setup.py testr --coverage --testr-args='{posargs}'
[testenv:docs]
basepython = python3
commands = python setup.py build_sphinx
[testenv:debug]
commands = oslo_debug_helper {posargs}
[testenv:releasenotes]
basepython = python3
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8]

View File

@ -19,6 +19,7 @@ from django.utils.translation import ugettext_lazy as _
from trove_dashboard import api
from oslo_serialization import jsonutils
from six.moves import builtins
def get(request, configuration_group_id):
@ -185,7 +186,7 @@ def adjust_type(data_type, value):
if data_type == "float":
new_value = float(value)
elif data_type == "long":
new_value = long(value)
new_value = builtins.int(value)
elif data_type == "integer":
new_value = int(value)
else: