diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d197ac7e2fc76830908840bf238d32a5528238da..02a715503602cf016a3b0ba8253cb509e155d9d3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,13 +22,15 @@ before_script: tests: stage: tests - script: + before_script: - apt update - apt install -y libgl1-mesa-glx xvfb graphviz 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; bash getting_started/getting_started.sh - - pip install tox + - pip install tox awscli + - conda install -c conda-forge tox-conda + script: - xvfb-run tox -v --recreate build_and_deploy_docs: @@ -40,8 +42,12 @@ build_and_deploy_docs: - tests before_script: - apt update - - apt install -y graphviz libgl1-mesa-glx xvfb xdg-utils libcairo2-dev libjpeg-dev libgif-dev + - apt install -y libgl1-mesa-glx xvfb graphviz 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; bash getting_started/getting_started.sh - pip install tox awscli + - conda install -c conda-forge tox-conda script: - echo "Bucket=${BUCKET_NAME}" - echo "AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}" @@ -59,10 +65,15 @@ benchmarks_and_profiling: only: variables: - $BENCHMARKS_AND_PROFILING - script: + before_script: - apt update - apt install -y libgl1-mesa-glx xvfb graphviz xdg-utils libcairo2-dev libjpeg-dev libgif-dev - - pip install tox + - 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; bash getting_started/getting_started.sh + - pip install tox awscli + - conda install -c conda-forge tox-conda + script: - xvfb-run tox -e benchmarks,profiling -v --recreate diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index aef3f026d5cce98e20c1946d259de84a8af3c95e..66fb76e8023e881f2aa8abacf9ac33256e2b7f69 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -64,20 +64,17 @@ Ready to contribute? Here's how to set up `flatland` for local development. $ git clone git@gitlab.aicrowd.com:flatland/flatland.git -3. Install the software dependencies via Anaconda. (This assumes you have Anaconda installed by following the instructions `here <https://www.anaconda.com/distribution>`_) +3. Install the software dependencies via Anaconda-3 or Miniconda-3. (This assumes you have Anaconda installed by following the instructions `here <https://www.anaconda.com/distribution>`_) - $ conda create python=3.6 --name flatland-rl - $ conda activate flatland-rl - $ conda install -c conda-forge cairosvg pycairo - $ conda install -c anaconda tk - $ cd flatland - $ pip install -e . + $ conda install -c conda-forge tox-conda + $ conda install tox + $ tox -v --recreate These steps are performed if you run $ getting_started/getting_started.bat/.sh - from Anaconda prompt. Only prerequisites: git and Miniconda-3 or Anaconda-3. + from Anaconda prompt. 4. Create a branch for local development:: diff --git a/getting_started/getting_started.bat b/getting_started/getting_started.bat index 48833ab83ebc62a3bbb7edfc8312251c48bb17dc..3289769ba1f628def40200e7154b0245351b8f8a 100644 --- a/getting_started/getting_started.bat +++ b/getting_started/getting_started.bat @@ -8,8 +8,6 @@ echo "************ TESTING PREREQUISITES PYTHON3 + GIT + GIT ******************* git --version || goto :error python --version || goto :error -rem deactivate in case we're in virtualenv -call conda deactivate || call deactivate @echo off diff --git a/requirements_dev.txt b/requirements_dev.txt index ea46eb245842881f1c51ededa5284300836a36ba..25a1ff17cfa02a2e7c760ac912c828c376c3861f 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -14,4 +14,6 @@ svgutils>=0.3.1 screeninfo>=0.3.1 pyarrow>=0.13.0 importlib-metadata>=0.17 -importlib_resources>=1.0.2 +importlib-resources>=1.0.1 +six>=1.12.0 +attrs diff --git a/tox.ini b/tox.ini index 2047166aace141680561623c7edf4d11a2b4534f..7bd40ed43bf8ed2e9c7ac0d48302673b0b10292d 100644 --- a/tox.ini +++ b/tox.ini @@ -73,7 +73,13 @@ passenv = ; HTTP_PROXY+HTTPS_PROXY required behind corporate proxies HTTP_PROXY HTTPS_PROXY -whitelist_externals = sh +conda_deps= + cairosvg + pycairo + tk +conda_channels: + conda-forge + anaconda deps = -r{toxinidir}/requirements_dev.txt -r{toxinidir}/requirements_continuous_integration.txt @@ -90,13 +96,19 @@ passenv = ; HTTP_PROXY+HTTPS_PROXY required behind corporate proxies HTTP_PROXY HTTPS_PROXY -whitelist_externals = sh +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}/c236d3c240d61a0969d4cb59e2180ce5 commands = -; run examples from subfolder to ensure that resources are accessed via resources and not via relative paths - sh -c 'mkdir -p {envtmpdir}/c236d3c240d61a0969d4cb59e2180ce5' - sh -c 'cd {envtmpdir}/c236d3c240d61a0969d4cb59e2180ce5 && python {toxinidir}/benchmarks/run_all_examples.py' + python {toxinidir}/benchmarks/run_all_examples.py [testenv:notebooks] basepython = python @@ -112,20 +124,27 @@ whitelist_externals = sh deps = -r{toxinidir}/requirements_dev.txt -r{toxinidir}/requirements_continuous_integration.txt +conda_deps= + cairosvg + pycairo + tk +conda_channels: + conda-forge + anaconda +; run tests from subfolder to ensure that resources are accessed via resources and not via relative paths +changedir = {envtmpdir}/6f59bc68108c3895b1828abdd04b9a06 commands = ; run tests from subfolder to ensure that resources are accessed via resources and not via relative paths - sh -c 'mkdir -p {envtmpdir}/6f59bc68108c3895b1828abdd04b9a06' sh -c 'jupyter nbextension install --py --sys-prefix widgetsnbextension' sh -c 'jupyter nbextension enable --py --sys-prefix widgetsnbextension' sh -c 'jupyter nbextension install --py --sys-prefix jpy_canvas' sh -c 'jupyter nbextension enable --py --sys-prefix jpy_canvas' ; https://stackoverflow.com/questions/35545402/how-to-run-an-ipynb-jupyter-notebook-from-terminal/35545463 sh -c 'ls notebooks/*.ipynb | xargs -n 1 jupyter nbconvert --to python' - sh -c 'cd {envtmpdir}/6f59bc68108c3895b1828abdd04b9a06 && ls {toxinidir}/notebooks/*.py | xargs -I{} -n 1 sh -c "echo -e \"\n====== Running {} ========\n\"; ipython {}"' + sh -c 'ls {toxinidir}/notebooks/*.py | xargs -I{} -n 1 sh -c "echo -e \"\n====== Running {} ========\n\"; ipython {}"' [testenv] -whitelist_externals = sh - pip +whitelist_externals = pip setenv = PYTHONPATH = {toxinidir} passenv = @@ -134,9 +153,16 @@ passenv = ; 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 -commands = ; run tests from subfolder to ensure that resources are accessed via resources and not via relative paths - sh -c 'mkdir -p {envtmpdir}/fefed3ba12bf1ed81dbcc20fb52706ea' - sh -c 'cd {envtmpdir}/fefed3ba12bf1ed81dbcc20fb52706ea && py.test --basetemp={envtmpdir} {toxinidir}' +changedir = {envtmpdir}/fefed3ba12bf1ed81dbcc20fb52706ea +commands = + py.test --basetemp={envtmpdir} {toxinidir}