Commit 9dfa186e authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Fix: Conda build-and-test script: Avoid pytest that's too new for Py2

parent 6ddf0c1c
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -65,13 +65,10 @@ rm -f .miniconda3/envs/testing/etc/OpenCL/vendors/apple.icd
# https://github.com/pypa/pip/issues/5345#issuecomment-386443351
export XDG_CACHE_HOME=$HOME/.cache/$CI_RUNNER_ID

if test -f "$REQUIREMENTS_TXT"; then
  conda install --quiet --yes pip
  pip install -r "$REQUIREMENTS_TXT"
fi

# }}}

PY_EXE=python

# {{{ install pytest

# Using pip instead of conda here avoids ridiculous uninstall chains
@@ -79,14 +76,17 @@ fi

PY_VER=$($PY_EXE -c 'import sys; print(".".join(str(s) for s in sys.version_info[:2]))')
if [[ "${PY_VER}" == 2* ]]; then
  ${PY_EXE} -mpip install "pytest<5"
  $PY_EXE -mpip install "pytest<5"
else
  ${PY_EXE} -mpip install pytest
  $PY_EXE -mpip install pytest
fi

# }}}

PY_EXE=python
if test -f "$REQUIREMENTS_TXT"; then
  conda install --quiet --yes pip
  pip install -r "$REQUIREMENTS_TXT"
fi

${PY_EXE} setup.py install