From f5f9010d60dd2290214d8c9329e542be9a0c4dde Mon Sep 17 00:00:00 2001 From: "Danilo J. S. Bellini" Date: Tue, 28 Aug 2018 13:17:38 -0300 Subject: [PATCH] Fix installation to make every Travis CI job pass - Replace Python 3.7 by 3.7-dev since 3.7 doesn't exist on Travis CI (though [1] states that 3.7, 3.7-dev, 3.8-dev and nightly don't work on Trusty because of its old OpenSSL version, the 3.7 doesn't exist and 3.7-dev seem to be the same to nightly) - Fix the broken pip on Python 2.6 and 3.2 from Travis CI, installing it (as well as wheel and setuptools) with the get-pip.py script specific to these Python versions - Install a newer virtualenv on Python 2.6, since virtualenv 15.1 had been forcing an older pip which is broken on this Python version - List the environment packages installed during the build - Install an older version of PyYAML on Python 3.2 (actually, PyYAML 3.13 seem to require Python 2.7 or Python 3.4+, as stated in [2], but nothing wrong happened on the tests on Python 2.6/3.3) - Force Cython < 0.27 on Python 3.2, since it's required to install PyYAML from the source distribution Some of these requirements are Travis-specific, e.g. Cython doesn't need to be installed on a ubuntu:trusty Docker image that installed Python 3.2 from the deadsnakes PPA, but it's hard to tell why the CI environment with the same packages in the same version behaves differently [1] https://docs.travis-ci.com/user/languages/python [2] https://pyyaml.org/wiki/PyYAML --- .travis.yml | 15 ++++++++++----- setup.py | 6 +++++- tox.ini | 2 ++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index db211c140..6ddc6fb87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,20 +8,25 @@ python: - 3.4 - 3.5 - 3.6 - - 3.7 + - 3.7-dev - pypy - pypy3 before_install: - SED_GET_PY='s/[^0-9]//g;s/.//3g;2s/.*/py/;1!G;h;$!d;s/y.2./y/;s/y.3./y3/' - PY=$(python -V 2>&1 | sed "$SED_GET_PY") - - TOX=tox - - test $PY != 32 || TOX='virtualenv<14 tox<3' - - test $PY != 33 -a $PY != 26 || TOX='virtualenv<15.2 tox<3' - export TOXENV=py$PY + # On Travis CI environments for Python 2.6 and 3.2, pip is broken + - GET_PIP_URL=https://bootstrap.pypa.io/${PY::1}.${PY:1}/get-pip.py + - if [[ "26 32" =~ $PY ]] ; then python <(curl -fsSL "$GET_PIP_URL") ; fi + - DEPS_TABLE=([26]='virtualenv<16 tox<3' + [32]='virtualenv<14 tox<3' + [33]='virtualenv<15.2 tox<3') + - DEPS=${DEPS_TABLE[$PY]:-'tox'} install: - - pip install $TOX + - pip install --upgrade $DEPS + - pip list # Helpful when debugging - tox --notest script: diff --git a/setup.py b/setup.py index 7d686a929..878b0312d 100644 --- a/setup.py +++ b/setup.py @@ -81,7 +81,11 @@ def run_tests(self): if sys.version_info < (2, 7, 0): tests_require.append('unittest2') -install_requires = ['PyYAML >=3.10', 'argh >=0.24.1', 'pathtools >=0.1.1'] +install_requires = [ + "PyYAML<3.13" if sys.version_info[:2] == (3, 2) else "PyYAML>=3.10", + "argh>=0.24.1", + "pathtools>=0.1.1", +] if sys.version_info < (2, 7, 0): # argparse is merged into Python 2.7 in the Python 2x series # and Python 3.2 in the Python 3x series. diff --git a/tox.ini b/tox.ini index 586d9241a..0b2712253 100644 --- a/tox.ini +++ b/tox.ini @@ -9,6 +9,8 @@ deps = pytest-cov py32: coverage<4 py{33,26}: pytest<3.3 py32: pytest<3 + ; Cython is required in order to install PyYAML from source + py32: cython<0.27 commands = py.test {posargs} [pytest]