[tox]
envlist =
    py27,py35,py36,py37,py38,py39,
    flake

[testenv]
basepython =
    py27: {env:TOX_PY27_BASEPYTHON:python2.7}
    py35: {env:TOX_PY35_BASEPYTHON:python3.5}
    py36: {env:TOX_PY36_BASEPYTHON:python3.6}
    py37: {env:TOX_PY37_BASEPYTHON:python3.7}
    py38: {env:TOX_PY38_BASEPYTHON:python3.8}
    py39: {env:TOX_PY39_BASEPYTHON:python3.9}
deps=pytest
commands=pytest

[testenv:flake8]
basepython=python
extras=lint
deps=flake8
commands=flake8 {toxinidir}

[tox]
envlist =
    py27,py35,py36,py37,py38,py39,
    flake

[testenv]
deps=pytest
commands=pytest

[testenv:flake8]
basepython=python
extras=lint
deps=flake8
commands=flake8 {toxinidir}

Remove reading basepython from env
Remove reading basepython from env
