Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
tox: don't set basepython to %TOXPYTHON% on Windows
Browse files Browse the repository at this point in the history
We can simply call 'tox -e py' which means create a tox env with the current
'python' interpreter in the $PATH.
This also allows one to call tox with a python version that is not explicitly
listed in the [testenv] basepython list.
For example, I needed to run tests on python3.5 locally and I couldn't unless
I explicitly listed it in there.
That TOXPYTHON thing was a hack, this is the recommended way to use tox on
windows.
  • Loading branch information
anthrotype committed Sep 7, 2018
1 parent 3650f76 commit e0dfc72
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
14 changes: 2 additions & 12 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,33 @@ environment:
global:
TWINE_USERNAME: "adobe-type-tools-ci"
# TWINE_PASSWORD is set in Appveyor settings
TOXENV: "py-cov"

matrix:
- PYTHON: "C:\\Python27"
PYTHON_VERSION: "2.7"
PYTHON_ARCH: "32"
TOXENV: "py27-cov-tx"
TOXPYTHON: "C:\\Python27\\python.exe"
TOXENV: "py-cov-tx"

# - PYTHON: "C:\\Python36"
# PYTHON_VERSION: "3.6"
# PYTHON_ARCH: "32"
# TOXENV: "py36-cov"
# TOXPYTHON: "C:\\Python36\\python.exe"

# - PYTHON: "C:\\Python37"
# PYTHON_VERSION: "3.7"
# PYTHON_ARCH: "32"
# TOXENV: "py37-cov"
# TOXPYTHON: "C:\\Python37\\python.exe"

# - PYTHON: "C:\\Python27-x64"
# PYTHON_VERSION: "2.7"
# PYTHON_ARCH: "64"
# TOXENV: "py27-cov"
# TOXPYTHON: "C:\\Python27-x64\\python.exe"

- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6"
PYTHON_ARCH: "64"
TOXENV: "py36-cov"
TOXPYTHON: "C:\\Python36-x64\\python.exe"

- PYTHON: "C:\\Python37-x64"
PYTHON_VERSION: "3.7"
PYTHON_ARCH: "64"
TOXENV: "py37-cov"
TOXPYTHON: "C:\\Python37-x64\\python.exe"

matrix:
fast_finish: true
Expand Down
10 changes: 0 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ addopts =
--exitfirst

[testenv]
basepython =
py27: {env:TOXPYTHON:python2.7}
py36: {env:TOXPYTHON:python3.6}
py37: {env:TOXPYTHON:python3.7}
description = run the tests with pytest under {basepython}
setenv =
COVERAGE_FILE={toxinidir}/.coverage.{envname}
Expand All @@ -30,7 +26,6 @@ commands =
[testenv:coverage]
description = run locally after tests to combine coverage data and create reports;
generates a diff coverage against origin/master (or DIFF_AGAINST env var)
basepython = {env:TOXPYTHON:python}
deps =
coverage >= 4.4.1, < 5
diff_cover
Expand All @@ -50,7 +45,6 @@ commands =

[testenv:coverage-c]
description = generate coverage for C library
basepython = {env:TOXPYTHON:python}
deps =
-rrequirements.txt
pytest-xdist
Expand All @@ -68,7 +62,6 @@ commands =

[testenv:codecov]
description = upload Python coverage data to codecov (only run on CI)
basepython = {env:TOXPYTHON:python}
deps =
{[testenv:coverage]deps}
codecov
Expand All @@ -82,7 +75,6 @@ commands =

[testenv:coverage-codecov-c]
description = generate C coverage data and upload to codecov (only run on CI)
basepython = {env:TOXPYTHON:python}
deps =
{[testenv:coverage-c]deps}
codecov
Expand All @@ -96,7 +88,6 @@ commands =

[testenv:sdist]
description = build sdist to be uploaded to PyPI
basepython = {env:TOXPYTHON:python}
skip_install = true
deps =
setuptools >= 36.4.0
Expand All @@ -108,7 +99,6 @@ commands =

[testenv:wheel]
description = build wheel package for upload to PyPI
basepython = {env:TOXPYTHON:python}
skip_install = true
deps = {[testenv:sdist]deps}
changedir = {toxinidir}
Expand Down

0 comments on commit e0dfc72

Please sign in to comment.