Files
manila-ui/tox.ini
Victoria Martinez de la Cruz 39d9896c47 Make manila-ui python3 compatible
In order to make manila-ui python3 compatible,
this patch set:
- replace dict.iteritems() with six.iteritems(dict)
- replace print msg with print(msg)
- replace dict.viewkeys() with error.keys()
- python 3 getting the keys() of a dict returns
  a dict_keys object instead of a list and hence
  sort() fails
- in python 2.x calling keys makes a copy of the key
  that you can iterate over while modifying the dict.
  This doesn't work in python 3.x because keys
  returns an iterator instead of a list.
  Another way is to use list to force a copy of the keys
  to be made.
- use getattr instead of relying on overriden __getattr__
  in the client to get params that not neccesarily need to
  be available (share_group_id and supports_share_migration)
- refactor ShareGroupTypeTests

Plus, enable py35 and py35dj20 jobs in tox and drop
old oslo-incubator files (install_venv.py)

Also add openstack-tox-py35 job to check python3 env.
openstack-tox-py35 should be defined in project-config later
but it is added to check python3 UT status.

Change-Id: I30582184904dc19e9cb4ca171b1fd2d161e09c48
2018-05-07 02:03:21 +09:00

80 lines
2.1 KiB
INI

[tox]
minversion = 1.6
envlist = py27,py35,pep8,py27dj19,py27dj110,py35dj20
skipsdist = True
[testenv]
usedevelop = True
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = /bin/bash run_tests.sh -N --no-pep8 {posargs}
[testenv:py27]
setenv = DJANGO_SETTINGS_MODULE=manila_ui.tests.settings
[testenv:py35]
setenv = DJANGO_SETTINGS_MODULE=manila_ui.tests.settings
[testenv:pep8]
commands = flake8
[testenv:venv]
commands = {posargs}
# Django-1.8 is LTS
[testenv:py27dj18]
basepython = python2.7
commands = pip install django>=1.8,<1.9
/bin/bash run_tests.sh -N --no-pep8 {posargs}
[testenv:py27dj19]
basepython = python2.7
commands = pip install django>=1.9,<1.10
/bin/bash run_tests.sh -N --no-pep8 {posargs}
[testenv:py27dj110]
basepython = python2.7
commands = pip install django>=1.10,<1.11
/bin/bash run_tests.sh -N --no-pep8 {posargs}
[testenv:py35dj20]
basepython = python3.5
commands = pip install django>=2.0,<2.1
/bin/bash run_tests.sh -N --no-pep8 {posargs}
[testenv:cover]
commands = {toxinidir}/tools/cover.sh {posargs}
[testenv:docs]
whitelist_externals = rm
commands =
rm -rf doc/build
python setup.py build_sphinx
[testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees \
-b html releasenotes/source releasenotes/build/html
[testenv:debug]
commands = oslo_debug_helper {posargs}
[flake8]
show-source = True
# E123, E125 skipped as they are invalid PEP-8.
# H405 multi line docstring summary not separated with an empty line
ignore = E123,E125,H405
enable-extensions = H203,H106
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.ropeproject,tools
[testenv:lower-constraints]
# TODO: basepython must be switched to python3
# after manila-ui supports python3.
# basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt