37 lines
1005 B
INI
Raw Normal View History

[tox]
Update tox.ini for correct py3 support and remove py2 When running 'tox' on a system where 'python3' is any version of python other that 3.5 tox will complain that the py35 testenv isn't py35 ... for example: [tony@thor election]$ tox -r /usr/lib/python3.7/site-packages/tox/config.py:570: UserWarning: conflicting basepython version (set 37, should be 35) for env 'py35';resolve conflict or set ignore_basepython_conflict proposed_version, implied_version, testenv_config.envname /usr/lib/python3.7/site-packages/tox/config.py:570: UserWarning: conflicting basepython version (set 37, should be 27) for env 'py27';resolve conflict or set ignore_basepython_conflict proposed_version, implied_version, testenv_config.envname docs recreate: /home/tony/tmp/election/.tox/docs <snip> ________________________________________________ summary _________________________________________________ docs: commands succeeded linters: commands succeeded py35: commands succeeded py27: commands succeeded congratulations :) [tony@thor election]$ for py in .tox/py*/bin/python ; do $py --version ; done Python 3.7.3 Python 3.7.3 As you can see the py35 and py27 interpreters are both in fact py37. Update tox.ini to that we can enforce python3 but still test on py35 and py37. While ther update the default envlist to remove py27 as that will always fail since I20184300f0a6cb6d230428cafc49f1b917376380 merged. As we're using ignore_basepython_conflict we need to set the tox minvcersion to 3.1.0 as that's the earliest version with that support Change-Id: Ia23682a285f6ee539dbeb9e1eb790cad8575da25
2019-05-28 13:45:13 +10:00
envlist = docs,linters,py35,py37
minversion = 3.1.0
skipsdist = True
Update tox.ini for correct py3 support and remove py2 When running 'tox' on a system where 'python3' is any version of python other that 3.5 tox will complain that the py35 testenv isn't py35 ... for example: [tony@thor election]$ tox -r /usr/lib/python3.7/site-packages/tox/config.py:570: UserWarning: conflicting basepython version (set 37, should be 35) for env 'py35';resolve conflict or set ignore_basepython_conflict proposed_version, implied_version, testenv_config.envname /usr/lib/python3.7/site-packages/tox/config.py:570: UserWarning: conflicting basepython version (set 37, should be 27) for env 'py27';resolve conflict or set ignore_basepython_conflict proposed_version, implied_version, testenv_config.envname docs recreate: /home/tony/tmp/election/.tox/docs <snip> ________________________________________________ summary _________________________________________________ docs: commands succeeded linters: commands succeeded py35: commands succeeded py27: commands succeeded congratulations :) [tony@thor election]$ for py in .tox/py*/bin/python ; do $py --version ; done Python 3.7.3 Python 3.7.3 As you can see the py35 and py27 interpreters are both in fact py37. Update tox.ini to that we can enforce python3 but still test on py35 and py37. While ther update the default envlist to remove py27 as that will always fail since I20184300f0a6cb6d230428cafc49f1b917376380 merged. As we're using ignore_basepython_conflict we need to set the tox minvcersion to 3.1.0 as that's the earliest version with that support Change-Id: Ia23682a285f6ee539dbeb9e1eb790cad8575da25
2019-05-28 13:45:13 +10:00
ignore_basepython_conflict=true
[testenv]
basepython = python3
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
# NOTE: If py35 fails with "db type could not be determined", delete
# .testrepository and try again. Running py35 before py27 is OK, but not the
# other way around. See: https://bugs.launchpad.net/testrepository/+bug/1212909
commands = stestr run --slowest {posargs}
[testenv:linters]
commands = yamllint configuration.yaml
flake8
[testenv:venv]
commands = {posargs}
[testenv:docs]
commands = sphinx-build -v -W -b html -d doc/build/doctrees doc/source doc/build/html
[testenv:ci-checks-review]
commands = ci-check-all-candidate-files -v -v {posargs:--HEAD}
[testenv:ci-checks-election]
commands = ci-check-all-candidate-files
[flake8]
exclude=.tox,doc/source/conf.py