appveyor: remove pythonX.Y.bat hack and simplify

running 'py' as tox environment is a shorthand for 'basepython=python', which means
tox will create the venv using the 'python' executable which is first in the path,
which in the case of Appveyor environment, it's the same where tox was installed in.
This commit is contained in:
Cosimo Lupo 2018-07-25 19:33:39 +01:00
parent 553f23f1db
commit 4f94da9d4d
No known key found for this signature in database
GPG Key ID: 59D54DB0C9976482

View File

@ -2,15 +2,12 @@ environment:
matrix: matrix:
- JOB: "2.7 32-bit" - JOB: "2.7 32-bit"
PYTHON_HOME: "C:\\Python27" PYTHON_HOME: "C:\\Python27"
TOXENV: "py27-cov"
- JOB: "3.6 64-bit" - JOB: "3.6 64-bit"
PYTHON_HOME: "C:\\Python36-x64" PYTHON_HOME: "C:\\Python36-x64"
TOXENV: "py36-cov"
- JOB: "3.7 64-bit" - JOB: "3.7 64-bit"
PYTHON_HOME: "C:\\Python37-x64" PYTHON_HOME: "C:\\Python37-x64"
TOXENV: "py37-cov"
install: install:
# If there is a newer build queued for the same PR, cancel this one. # If there is a newer build queued for the same PR, cancel this one.
@ -36,19 +33,14 @@ install:
# install the dependencies to run the tests # install the dependencies to run the tests
- "python -m pip install tox" - "python -m pip install tox"
# Make a 'pythonX.X.bat' file in the current directory so that tox will find
# it and 'pythonX.X' will mean what we want it to. E.g. for 'TOXENV=py37',
# this will save a 'python3.7.bat' file containing "@C:\Python27\python %*"
# Credit: https://nedbatchelder.com/blog/201509/appveyor.html
- "python -c \"import os; open('python{0}.{1}.bat'.format(*os.environ['TOXENV'][2:4]), 'w').write('@{0}\\\\python \\x25*\\n'.format(os.environ['PYTHON_HOME']))\""
build: false build: false
test_script: test_script:
- "tox" # run tests with the current 'python' in %PATH%, and measure test coverage
- "tox -e py-cov"
after_test: after_test:
# upload test coverage to Codecov.io
- "tox -e codecov" - "tox -e codecov"
notifications: notifications: