mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-08 16:53:23 +00:00
Add travis testing support for python 3.8 (#477)
* Add travis testing support for python 3.8 * Use Xenial for all * Simplify matrix * Consistent indents * Add py38 to tox and update contributing guide for how to use pyenv * Fix travis spec to allow 3.8-dev to fail and tox should pass 90% coverage for full suite
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -10,6 +10,8 @@ coverage.xml
|
|||||||
htmlcov/
|
htmlcov/
|
||||||
*.egg-info/
|
*.egg-info/
|
||||||
pytestdebug.log
|
pytestdebug.log
|
||||||
|
pip-wheel-metadata/
|
||||||
|
.python-version
|
||||||
|
|
||||||
fixtures/
|
fixtures/
|
||||||
/docs/_build
|
/docs/_build
|
||||||
|
|||||||
55
.travis.yml
55
.travis.yml
@@ -1,3 +1,4 @@
|
|||||||
|
dist: xenial
|
||||||
language: python
|
language: python
|
||||||
before_install: openssl version
|
before_install: openssl version
|
||||||
env:
|
env:
|
||||||
@@ -13,55 +14,31 @@ env:
|
|||||||
- TOX_SUFFIX="aiohttp"
|
- TOX_SUFFIX="aiohttp"
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
# Only run lint on a single 3.x
|
||||||
- env: TOX_SUFFIX="lint"
|
- env: TOX_SUFFIX="lint"
|
||||||
python: 3.7
|
python: "3.7"
|
||||||
dist: xenial
|
|
||||||
- env: TOX_SUFFIX="requests"
|
|
||||||
python: 3.7
|
|
||||||
dist: xenial
|
|
||||||
- env: TOX_SUFFIX="httplib2"
|
|
||||||
python: 3.7
|
|
||||||
dist: xenial
|
|
||||||
- env: TOX_SUFFIX="boto3"
|
|
||||||
python: 3.7
|
|
||||||
dist: xenial
|
|
||||||
- env: TOX_SUFFIX="urllib3"
|
|
||||||
python: 3.7
|
|
||||||
dist: xenial
|
|
||||||
- env: TOX_SUFFIX="tornado4"
|
|
||||||
python: 3.7
|
|
||||||
dist: xenial
|
|
||||||
- env: TOX_SUFFIX="aiohttp"
|
|
||||||
python: 3.7
|
|
||||||
dist: xenial
|
|
||||||
allow_failures:
|
allow_failures:
|
||||||
- env: TOX_SUFFIX="aiohttp"
|
- env: TOX_SUFFIX="aiohttp"
|
||||||
python: "pypy3"
|
python: "pypy3"
|
||||||
|
- python: "3.8-dev"
|
||||||
exclude:
|
exclude:
|
||||||
# Only run lint on a single 3.x
|
|
||||||
- env: TOX_SUFFIX="lint"
|
|
||||||
python: 2.7
|
|
||||||
- env: TOX_SUFFIX="lint"
|
|
||||||
python: 3.5
|
|
||||||
- env: TOX_SUFFIX="lint"
|
|
||||||
python: pypy
|
|
||||||
- env: TOX_SUFFIX="lint"
|
|
||||||
python: "pypy3"
|
|
||||||
# Exclude aiohttp support
|
# Exclude aiohttp support
|
||||||
- env: TOX_SUFFIX="aiohttp"
|
- env: TOX_SUFFIX="aiohttp"
|
||||||
python: 2.7
|
python: "2.7"
|
||||||
- env: TOX_SUFFIX="aiohttp"
|
- env: TOX_SUFFIX="aiohttp"
|
||||||
python: pypy
|
python: "pypy"
|
||||||
python:
|
python:
|
||||||
- 2.7
|
- "2.7"
|
||||||
- 3.5
|
- "3.5"
|
||||||
- 3.6
|
- "3.6"
|
||||||
- pypy
|
- "3.7"
|
||||||
- "pypy3"
|
- "3.8-dev"
|
||||||
|
- "pypy"
|
||||||
|
- "pypy3"
|
||||||
install:
|
install:
|
||||||
- pip install tox-travis codecov
|
- pip install tox-travis codecov
|
||||||
- if [[ $TOX_SUFFIX != 'lint' ]]; then python setup.py install ; fi
|
- if [[ $TOX_SUFFIX != 'lint' ]]; then python setup.py install ; fi
|
||||||
script:
|
script:
|
||||||
- tox -e "${TOX_SUFFIX}"
|
- tox -e "${TOX_SUFFIX}"
|
||||||
after_success:
|
after_success:
|
||||||
- codecov
|
- codecov
|
||||||
|
|||||||
@@ -27,6 +27,38 @@ for how to set this up. I have marked the boto tests as optional in
|
|||||||
Travis so you don't have to worry about them failing if you submit a
|
Travis so you don't have to worry about them failing if you submit a
|
||||||
pull request.
|
pull request.
|
||||||
|
|
||||||
|
Using PyEnv with VCR's test suite
|
||||||
|
---------------------------------
|
||||||
|
|
||||||
|
PyEnv is a tool for managing multiple installation of python on your system.
|
||||||
|
See the full documentation at their `github <https://github.com/pyenv/pyenv>`
|
||||||
|
but we are also going to use `tox-pyenv <https://pypi.org/project/tox-pyenv/>`
|
||||||
|
in this example::
|
||||||
|
|
||||||
|
git clone https://github.com/pyenv/pyenv ~/.pyenv
|
||||||
|
|
||||||
|
# Add ~/.pyenv/bin to your PATH
|
||||||
|
export PATH="$PATH:~/.pyenv/bin"
|
||||||
|
|
||||||
|
# Setup shim paths
|
||||||
|
eval "$(pyenv init -)"
|
||||||
|
|
||||||
|
# Setup your local system tox tooling
|
||||||
|
pip install tox tox-pyenv
|
||||||
|
|
||||||
|
# Install supported versions (at time of writing), this does not activate them
|
||||||
|
pyenv install 2.7.10 3.5.7 3.6.9 3.7.4 3.8-dev pypy2.6-7.1.1 pypy3.6-7.1.1
|
||||||
|
|
||||||
|
# This activates them
|
||||||
|
pyenv local 2.7.10 3.5.7 3.6.9 3.7.4 3.8-dev pypy2.6-7.1.1 pypy3.6-7.1.1
|
||||||
|
|
||||||
|
# Run the whole test suite
|
||||||
|
tox
|
||||||
|
|
||||||
|
# Run the whole test suite or just part of it
|
||||||
|
tox -e lint
|
||||||
|
tox -e py37-requests
|
||||||
|
|
||||||
|
|
||||||
Troubleshooting on MacOSX
|
Troubleshooting on MacOSX
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|||||||
9
tox.ini
9
tox.ini
@@ -1,6 +1,11 @@
|
|||||||
[tox]
|
[tox]
|
||||||
skip_missing_interpreters=true
|
skip_missing_interpreters=true
|
||||||
envlist = cov-clean,{py27,py35,py36,py37,pypy}-{lint,requests,httplib2,urllib3,tornado4,boto3},{py35,py36,py37}-{aiohttp},cov-report
|
envlist =
|
||||||
|
cov-clean,
|
||||||
|
lint,
|
||||||
|
{py27,py35,py36,py37,py38,pypy,pypy3}-{requests,httplib2,urllib3,tornado4,boto3},
|
||||||
|
{py35,py36,py37,py38}-{aiohttp},
|
||||||
|
cov-report
|
||||||
|
|
||||||
|
|
||||||
# Coverage environment tasks: cov-clean and cov-report
|
# Coverage environment tasks: cov-clean and cov-report
|
||||||
@@ -15,7 +20,7 @@ deps = coverage
|
|||||||
skip_install=true
|
skip_install=true
|
||||||
commands =
|
commands =
|
||||||
coverage html
|
coverage html
|
||||||
coverage report --fail-under=80
|
coverage report --fail-under=90
|
||||||
|
|
||||||
[testenv:lint]
|
[testenv:lint]
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
|
|||||||
Reference in New Issue
Block a user