From a4b8ad04551bd79dd39862fb1384c6af4a30c4b6 Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Thu, 4 Aug 2016 12:29:22 -0700 Subject: [PATCH 1/7] Drop support for Python 2.6 --- .travis.yml | 8 -------- README.md | 2 +- docs/index.rst | 2 +- scripts/install.sh | 8 -------- setup.py | 5 ++--- tox.ini | 16 +--------------- 6 files changed, 5 insertions(+), 36 deletions(-) diff --git a/.travis.yml b/.travis.yml index a8c01faa2..093c163c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,7 @@ language: python -python: 2.7 sudo: false -# TODO(issue 532): Fix syntax when 3.5 is natively available upstream -matrix: - include: - - python: 3.5 - env: - - TOX_ENV=py35 env: matrix: - - TOX_ENV=py26 - TOX_ENV=py27 - TOX_ENV=py33 - TOX_ENV=py34 diff --git a/README.md b/README.md index 17e69fcbc..e1b824bb5 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ agreement. Supported Python Versions ========================= -We support Python 2.6, 2.7, 3.3+. More information [in the docs][2]. +We support Python 2.7 and 3.3+. More information [in the docs][2]. [1]: https://github.com/google/oauth2client/blob/master/CONTRIBUTING.md [2]: https://oauth2client.readthedocs.io/#supported-python-versions diff --git a/docs/index.rst b/docs/index.rst index 0543e1aad..6ae6621d2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -107,7 +107,7 @@ contributor license agreement. Supported Python Versions ------------------------- -We support Python 2.6, 2.7, 3.3+. (Whatever this file says, the truth is +We support Python 2.7 and 3.3+. (Whatever this file says, the truth is always represented by our `tox.ini`_). .. _tox.ini: https://github.com/google/oauth2client/blob/master/tox.ini diff --git a/scripts/install.sh b/scripts/install.sh index 0ef7ad2ba..fe0538e1a 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -17,14 +17,6 @@ set -ev pip install tox -if [[ "${TOX_ENV}" == "pypy" ]]; then - git clone https://github.com/yyuu/pyenv.git ${HOME}/.pyenv - PYENV_ROOT="${HOME}/.pyenv" - PATH="${PYENV_ROOT}/bin:${PATH}" - eval "$(pyenv init -)" - pyenv install pypy-2.6.0 - pyenv global pypy-2.6.0 -fi if [[ "${TOX_ENV}" == "gae" && ! -d ${GAE_PYTHONPATH} ]]; then python scripts/fetch_gae_sdk.py `dirname ${GAE_PYTHONPATH}` diff --git a/setup.py b/setup.py index 686d1db72..3d9212c1f 100644 --- a/setup.py +++ b/setup.py @@ -26,8 +26,8 @@ import oauth2client -if sys.version_info < (2, 6): - print('oauth2client requires python2 version >= 2.6.', file=sys.stderr) +if sys.version_info < (2, 7): + print('oauth2client requires python2 version >= 2.7.', file=sys.stderr) sys.exit(1) if (3, 1) <= sys.version_info < (3, 3): print('oauth2client requires python3 version >= 3.3.', file=sys.stderr) @@ -58,7 +58,6 @@ keywords="google oauth 2.0 http client", classifiers=[ 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', diff --git a/tox.ini b/tox.ini index b0781a8a1..31a638e71 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py26,py27,py33,py34,py35,pypy,gae,cover +envlist = py27,py33,py34,py35,pypy,gae,cover [testenv] basedeps = mock>=1.3.0 @@ -50,20 +50,6 @@ deps = {[testenv]deps} coverage nosegae -[testenv:py26] -basepython = - python2.6 -commands = - nosetests \ - --ignore-files=test_appengine\.py \ - --ignore-files=test__appengine_ndb\.py \ - --ignore-files=test_keyring_storage\.py \ - --exclude-dir=oauth2client/contrib/django_util \ - --exclude-dir=tests/contrib/django_util \ - {posargs} -deps = {[testenv]basedeps} - nose-exclude - [testenv:py33] basepython = python3.3 From b4e0e782296f19d815ee06f3c3e5e633df48bdb3 Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Thu, 4 Aug 2016 12:31:44 -0700 Subject: [PATCH 2/7] Add Py 3.5 back to Travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 093c163c3..4635a655b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ env: - TOX_ENV=py27 - TOX_ENV=py33 - TOX_ENV=py34 + - TOX_ENV=py35 - TOX_ENV=pypy - TOX_ENV=docs - TOX_ENV=system-tests From 76c3a9d6b3e9ff664fbe013145d99a0bd2cf83ec Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Thu, 4 Aug 2016 12:49:24 -0700 Subject: [PATCH 3/7] Fix pypy activation --- scripts/run.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/scripts/run.sh b/scripts/run.sh index 0b537e241..66333250d 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -15,11 +15,4 @@ # limitations under the License. set -ev - -if [[ "${TOX_ENV}" == "pypy" ]]; then - PYENV_ROOT="${HOME}/.pyenv" - PATH="${PYENV_ROOT}/bin:${PATH}" - eval "$(pyenv init -)" - pyenv global pypy-2.6.0 -fi tox -e ${TOX_ENV} From 60c37a50abf0e66f179241328f7e867175929939 Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Thu, 4 Aug 2016 13:02:54 -0700 Subject: [PATCH 4/7] Re-organize Travis matrix --- .travis.yml | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4635a655b..019eeb533 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,29 @@ language: python sudo: false + +matrix: + include: + - python: 2.7 + env: TOX_ENV=flake8 + - python: 2.7 + env: TOX_ENV=docs + - python: 2.7 + env: TOX_ENV=gae + - python: 2.7 + env: TOX_ENV=py27 + - python: 3.3 + env: TOX_ENV=py33 + - python: 3.4 + env: TOX_ENV=py34 + - python: 3.5 + env: TOX_ENV=py35 + - python: pypy + env: TOX_ENV=pypy + - python: 2.7 + env: TOX_ENV=system-tests + - python: 3.4 + env: TOX_ENV=system-tests3 env: - matrix: - - TOX_ENV=py27 - - TOX_ENV=py33 - - TOX_ENV=py34 - - TOX_ENV=py35 - - TOX_ENV=pypy - - TOX_ENV=docs - - TOX_ENV=system-tests - - TOX_ENV=system-tests3 - - TOX_ENV=gae - - TOX_ENV=flake8 global: - GAE_PYTHONPATH=${HOME}/.cache/google_appengine cache: From 0350a58c16a5d15f2b3c80092cd42c381cbd45f5 Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Thu, 4 Aug 2016 13:12:45 -0700 Subject: [PATCH 5/7] Add back pypy install --- scripts/install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/install.sh b/scripts/install.sh index fe0538e1a..71cd2c907 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -18,6 +18,13 @@ set -ev pip install tox +# App Engine tests require the App Engine SDK. if [[ "${TOX_ENV}" == "gae" && ! -d ${GAE_PYTHONPATH} ]]; then python scripts/fetch_gae_sdk.py `dirname ${GAE_PYTHONPATH}` fi + +# Travis ships with an old version of PyPy, so install at least version 2.6. +if [[ "${TOX_ENV}" == "pypy" ]]; then + pyenv install pypy-2.6.0 + pyenv global pypy-2.6.0 +fi From e4e9459c41e9aebdf73c7a8e3a66ae2e11d8b411 Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Thu, 4 Aug 2016 13:28:07 -0700 Subject: [PATCH 6/7] Add back pyenv install --- scripts/install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/install.sh b/scripts/install.sh index 71cd2c907..be9fdf5e0 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -25,6 +25,10 @@ fi # Travis ships with an old version of PyPy, so install at least version 2.6. if [[ "${TOX_ENV}" == "pypy" ]]; then + git clone https://github.com/yyuu/pyenv.git ${HOME}/.pyenv + PYENV_ROOT="${HOME}/.pyenv" + PATH="${PYENV_ROOT}/bin:${PATH}" + eval "$(pyenv init -)" pyenv install pypy-2.6.0 pyenv global pypy-2.6.0 fi From ca3cb6dfcfd52fd92c89f9971e9c7913f33f1ffb Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Thu, 4 Aug 2016 13:46:17 -0700 Subject: [PATCH 7/7] Set PATH for pypy2.6 --- .travis.yml | 1 + scripts/install.sh | 6 +----- scripts/run.sh | 8 ++++++++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 019eeb533..9ab2f44e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,7 @@ env: cache: directories: - ${HOME}/.cache + - ${HOME}/.pyenv install: - ./scripts/install.sh script: diff --git a/scripts/install.sh b/scripts/install.sh index be9fdf5e0..1f2378bc6 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -26,9 +26,5 @@ fi # Travis ships with an old version of PyPy, so install at least version 2.6. if [[ "${TOX_ENV}" == "pypy" ]]; then git clone https://github.com/yyuu/pyenv.git ${HOME}/.pyenv - PYENV_ROOT="${HOME}/.pyenv" - PATH="${PYENV_ROOT}/bin:${PATH}" - eval "$(pyenv init -)" - pyenv install pypy-2.6.0 - pyenv global pypy-2.6.0 + ${HOME}/.pyenv/bin/pyenv install pypy-2.6.0 fi diff --git a/scripts/run.sh b/scripts/run.sh index 66333250d..c774f2489 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -15,4 +15,12 @@ # limitations under the License. set -ev + +# If in the pypy environment, activate the never version of pypy provided by +# pyenv. +if [[ "${TOX_ENV}" == "pypy" ]]; then + PATH="${HOME}/.pyenv/versions/pypy-2.6.0/bin:${PATH}" + export PATH +fi + tox -e ${TOX_ENV}