From e3d277b37c2e65f07344372ec0a1b39e2a93f070 Mon Sep 17 00:00:00 2001 From: u214892 <u214892@sbb.ch> Date: Fri, 12 Jul 2019 13:26:21 +0200 Subject: [PATCH] #97 tox-conda #94 use miniconda instead of anaconda --- .gitlab-ci.yml | 8 +++---- tox.ini | 61 ++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 56 insertions(+), 13 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 977121e..5f264f5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,7 +46,7 @@ build_and_deploy_docs: - tests before_script: - apt update - - apt install -y libgl1-mesa-glx xvfb graphviz xdg-utils libcairo2-dev libjpeg-dev libgif-dev + - apt install -y libgl1-mesa-glx xvfb xdg-utils libcairo2-dev libjpeg-dev libgif-dev - wget -nv https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/Miniconda3-latest-Linux-x86_64.sh - bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p /tmp/miniconda3 - export PATH=/tmp/miniconda3/bin:$PATH @@ -72,7 +72,7 @@ benchmarks_and_profiling: - $BENCHMARKS_AND_PROFILING before_script: - apt update - - apt install -y libgl1-mesa-glx xvfb graphviz xdg-utils libcairo2-dev libjpeg-dev libgif-dev + - apt install -y libgl1-mesa-glx xvfb xdg-utils libcairo2-dev libjpeg-dev libgif-dev - wget -nv https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/Miniconda3-latest-Linux-x86_64.sh - bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p /tmp/miniconda3 - export PATH=/tmp/miniconda3/bin:$PATH @@ -86,12 +86,12 @@ test_conda_setup: stage: integration_testing before_script: - apt update - - apt install -y libgl1-mesa-glx xvfb graphviz xdg-utils libcairo2-dev libjpeg-dev libgif-dev + - apt install -y libgl1-mesa-glx xvfb xdg-utils libcairo2-dev libjpeg-dev libgif-dev - wget -nv https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/Miniconda3-latest-Linux-x86_64.sh - bash /tmp/Miniconda3-latest-Linux-x86_64.sh -b -p /tmp/miniconda3 + - export PATH=/tmp/miniconda3/bin:$PATH - conda update -n root conda -y script: - - export PATH=/tmp/miniconda3/bin:$PATH - bash getting_started/getting_started.sh diff --git a/tox.ini b/tox.ini index fb4959f..3903881 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,6 @@ [tox] -envlist = py36, py37, examples, notebooks, flake8 +envlist = py36, py37, examples, notebooks, flake8, docs, coverage + [travis] python = @@ -20,7 +21,12 @@ commands = flake8 flatland tests examples benchmarks [testenv:docs] -basepython = python +; TODO docs requires make and graphviz installed, therefore exclude Windows +platform = + linux2 + darwin +; use python3.6 because of incompatibility under Windows of the pycairo installed through conda for py37 +basepython = python3.6 whitelist_externals = make passenv = DISPLAY @@ -30,6 +36,7 @@ conda_deps = cairosvg pycairo tk + graphviz conda_channels : conda-forge anaconda @@ -41,7 +48,12 @@ commands = make docs [testenv:coverage] -basepython = python +; TODO coverage requires make, therefore exclude Windows +platform = + linux2 + darwin +; use python3.6 because of incompatibility under Windows of the pycairo installed through conda for py37 +basepython = python3.6 whitelist_externals = make passenv = DISPLAY @@ -63,7 +75,8 @@ commands = make coverage [testenv:benchmarks] -basepython = python +; use python3.6 because of incompatibility under Windows of the pycairo installed through conda for py37 +basepython = python3.6 setenv = PYTHONPATH = {toxinidir} passenv = @@ -81,7 +94,8 @@ commands = python benchmarks/benchmark_all_examples.py [testenv:profiling] -basepython = python +; use python3.6 because of incompatibility under Windows of the pycairo installed through conda for py37 +basepython = python3.6 setenv = PYTHONPATH = {toxinidir} passenv = @@ -104,7 +118,8 @@ commands = python benchmarks/profile_all_examples.py [testenv:examples] -basepython = python +; use python3.6 because of incompatibility under Windows of the pycairo installed through conda for py37 +basepython = python3.6 setenv = PYTHONPATH = {toxinidir} passenv = @@ -128,7 +143,7 @@ commands = python {toxinidir}/benchmarks/run_all_examples.py [testenv:notebooks] -basepython = python +basepython = python3.6 setenv = PYTHONPATH = {toxinidir} passenv = @@ -158,7 +173,8 @@ commands = python {toxinidir}/notebooks/run_all_notebooks.py [testenv:start_jupyter] -basepython = python +; use python3.6 because of incompatibility under Windows of the pycairo installed through conda for py37 +basepython = python3.6 setenv = PYTHONPATH = {toxinidir} passenv = @@ -187,7 +203,34 @@ commands = python -m jupyter notebook [testenv] -whitelist_externals = pip +setenv = + PYTHONPATH = {toxinidir} +passenv = + DISPLAY + XAUTHORITY +; HTTP_PROXY+HTTPS_PROXY required behind corporate proxies + HTTP_PROXY + HTTPS_PROXY +conda_deps = + cairosvg + pycairo + tk +conda_channels : + conda-forge + anaconda +deps = + -r{toxinidir}/requirements_dev.txt +; run tests from subfolder to ensure that resources are accessed via resources and not via relative paths +changedir = {envtmpdir}/fefed3ba12bf1ed81dbcc20fb52706ea +commands = + python --version + python -m pytest --basetemp={envtmpdir} {toxinidir} + +[testenv:py37] +; exclude py37 because of incompatibility under Windows of the pycairo installed through conda for py37 +platform = + linux2 + darwin setenv = PYTHONPATH = {toxinidir} passenv = -- GitLab