diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9ff90e9ccdc5c5309dec23a1beda38ee97e03fa7..6bca8bf02ea5e77c89609b892d064f1f684d6a90 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,21 @@ before_script: - git lfs pull + +stages: + - test + - deploy + + test_enpt: + stage: test script: - source /root/anaconda3/bin/activate - export GDAL_DATA=/root/anaconda3/share/gdal - export PYTHONPATH=$PYTHONPATH:/root # /root <- here are the sicor tables - - make lint + # run nosetests - make nosetests # test are called here + # create the docs - make docs artifacts: paths: @@ -16,20 +24,41 @@ test_enpt: - nosetests.html - nosetests.xml - tests/linting + when: always + + +test_styles: + stage: test + script: + - source /root/anaconda3/bin/activate + - export GDAL_DATA=/root/anaconda3/share/gdal + - export PYTHONPATH=$PYTHONPATH:/root # /root <- directory needed later + - make lint + artifacts: + paths: + - tests/linting/flake8.log + - tests/linting/pycodestyle.log + - tests/linting/pydocstyle.log + when: always test_enpt_install: + stage: test script: - source /root/anaconda3/bin/activate - - conda create -y -q --name enpt python=3.5 + - conda create -y -q --name enpt python=3 - source activate enpt # install some dependencies that cause trouble when installed via pip - - conda install -y -q -c conda-forge gdal scikit-image matplotlib + - conda install -y -c conda-forge scipy # scikit-image, matplotlib + # install not pip-installable deps of geoarray + - conda install -y -c conda-forge numpy scikit-image matplotlib pandas gdal rasterio pyproj basemap shapely + - conda install -y -c conda-forge 'icu=58.*' lxml # fixes bug for conda-forge gdal build # install enpt - make install - cd .. - pwd - ls + # test importability - python -c "import enpt; print(enpt)" - python -c "from enpt.model.images import EnMAPL1Product_SensorGeo" @@ -39,14 +68,23 @@ pages: dependencies: - test_enpt script: + # Create the public directory + - rm -rf public + - mkdir public + - mkdir -p public/doc - mkdir -p public/coverage - - cp -r htmlcov/* public/coverage/ - mkdir -p public/nosetests_reports - - cp nosetests.* public/nosetests_reports/ - - mkdir -p public/doc + # Copy over the docs - cp -r docs/_build/html/* public/doc/ - - mkdir -p public/linting - - cp tests/linting/*.log public/linting + # Copy over the coverage reports + - cp -r htmlcov/* public/coverage/ + # Copy over the nosetests reports + - cp nosetests.* public/nosetests_reports/ + # Check if everything is working great + - ls -al public + - ls -al public/doc + - ls -al public/coverage + - ls -al public/nosetests_reports artifacts: paths: - public diff --git a/enpt/__init__.py b/enpt/__init__.py index a3df47458935e90b73040f1f3d0b10149dc12cea..3e9bd09cd05dfc420a0ac287cde849a464d5ef83 100644 --- a/enpt/__init__.py +++ b/enpt/__init__.py @@ -3,5 +3,5 @@ __author__ = """Karl Segl""" __email__ = 'segl@gfz-potsdam.de' -__version__ = '0.2.7' -__versionalias__ = '2017-08-30_02' +__version__ = '0.2.8' +__versionalias__ = '2017-10-11_01' diff --git a/requirements.txt b/requirements.txt index e18b4cf7323e4c9370af9235c1e9e7aaf387d6dd..2ae84987332acde24847fb136f2141e3a7a57e33 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ numpy scipy -geoarray \ No newline at end of file +geoarray>=0.6.12 +spectral>=0.16 \ No newline at end of file diff --git a/setup.py b/setup.py index 409dec247657066e2f5b79b4a7e20d227fd41dfa..80ad6bd84e9b168d325735e2a835b54405294b0f 100644 --- a/setup.py +++ b/setup.py @@ -10,14 +10,14 @@ with open('HISTORY.rst') as history_file: history = history_file.read() requirements = [ # put package requirements here - 'numpy', 'scipy', 'geoarray', 'spectral' + 'numpy', 'scipy', 'geoarray>=0.6.12', 'spectral>=0.16' ] test_requirements = ['coverage', 'nose', 'nose-htmloutput', 'rednose'] setup( name='enpt', - version='0.2.7', + version='0.2.8', description="EnMAP PT", long_description=readme + '\n\n' + history, author="Karl Segl", diff --git a/tests/gitlab_CI_docker/build_enpt_testsuite_image.sh b/tests/gitlab_CI_docker/build_enpt_testsuite_image.sh index ae58e210b4909c9b417ccb571c0b4be3b6b4d561..11194540bc7ca81074889a2f597433d5225557ec 100755 --- a/tests/gitlab_CI_docker/build_enpt_testsuite_image.sh +++ b/tests/gitlab_CI_docker/build_enpt_testsuite_image.sh @@ -25,6 +25,6 @@ sudo docker exec -it ${gitlab_runner} /bin/bash -c "export RUNNER_EXECUTOR=docke --registration-token '${token}' \ --run-untagged=true \ --locked=true \ - --tag-list sicor_client \ + --tag-list enpt_client \ --description '${runner_name}' \ --docker-image '${tag}' " diff --git a/tests/gitlab_CI_docker/context/enpt_ci.docker b/tests/gitlab_CI_docker/context/enpt_ci.docker index 87477a53e1696d13ac96c0ca27cf8bcd217b0520..f065c180347576ac5b2304ed691de638501f3c9f 100644 --- a/tests/gitlab_CI_docker/context/enpt_ci.docker +++ b/tests/gitlab_CI_docker/context/enpt_ci.docker @@ -1,28 +1,30 @@ FROM centos:7 +# matplotlib requires freetype, freetype-devel, libpng-devel under centos +# scikit-image requires blas-devel, lapack-devel, atlas-devel under centos RUN yum update -y && \ - yum install -y wget vim bzip2 gcc gcc-c++ make libgl1-mesa-glx mesa-libGL qt5-qtbase-gui git texlive + yum install -y wget vim bzip2 gcc gcc-c++ make libgl1-mesa-glx mesa-libGL qt5-qtbase-gui git nano tree gdb texlive -ENV anaconda_dl 'Anaconda3-4.3.1-Linux-x86_64.sh' -RUN /bin/bash -i -c "cd /root; wget https://repo.continuum.io/archive/$anaconda_dl ; \ - bash -i /root/$anaconda_dl -b ; \ - rm -f /root/$anaconda_dl" +# change version numbers for future upgrades +ENV miniconda_dl 'Miniconda3-latest-Linux-x86_64.sh' +ENV envconfig 'environment_enpt.yml' +ENV git_lfs_v='2.1.1' -# 'conda install --yes -c conda-forge 'icu=58.*' lxml' fixing a bug for conda-forge gdal build, as of 06/2017 -RUN /bin/bash -i -c "source /root/anaconda3/bin/activate ; \ - conda install --yes -c conda-forge gdal ; \ - conda install --yes -c conda-forge 'icu=58.*' lxml ; \ - conda install --yes -c conda-forge glymur ; \ - pip install sphinx-argparse flake8 pycodestyle pylint pydocstyle nose nose2 nose-htmloutput coverage rednose; " +RUN /bin/bash -i -c "cd /root; wget https://repo.continuum.io/miniconda/$miniconda_dl ; \ + bash -i /root/$miniconda_dl -b ; \ + rm -f /root/$miniconda_dl" -# installing git large file support, see here: https://git-lfs.github.com/ , change version number below for future upgrades -ENV git_lfs_v='2.1.1' +# copy some needed stuff to /root +COPY *.yml /root/ + +# create an environment with all packages specified in $envconfig +RUN /bin/bash -i -c "source /root/miniconda3/bin/activate ; \ + conda env update -f /root/$envconfig" + +# install git lfs +RUN /bin/bash -i -c "curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | bash" + +# install git large file support, see here: https://git-lfs.github.com/ RUN /bin/bash -i -c "wget https://github.com/git-lfs/git-lfs/releases/download/v${git_lfs_v}/git-lfs-linux-amd64-${git_lfs_v}.tar.gz; \ tar -zxvf git-lfs-linux-amd64-${git_lfs_v}.tar.gz; \ cd git-lfs-${git_lfs_v}; \ bash ./install.sh" - -# set matplotlib backend to Agg as default, Qt won't work in headless docker containers -RUN bash -i -c 'source /root/anaconda3/bin/activate; \ - sed -i "/backend : tkagg/c\backend : Agg" $(python -c "import matplotlib; print(matplotlib.matplotlib_fname())"); \ - sed -i "/backend : Qt4Agg/c\backend : Agg" $(python -c "import matplotlib; print(matplotlib.matplotlib_fname())"); \ - sed -i "/backend : qt5agg/c\backend : Agg" $(python -c "import matplotlib; print(matplotlib.matplotlib_fname())")' \ No newline at end of file diff --git a/tests/gitlab_CI_docker/context/environment_enpt.yml b/tests/gitlab_CI_docker/context/environment_enpt.yml new file mode 100644 index 0000000000000000000000000000000000000000..87d3ae66deaeab44924403ad53cb4354a2869dab --- /dev/null +++ b/tests/gitlab_CI_docker/context/environment_enpt.yml @@ -0,0 +1,38 @@ +name: enpt + +channels: &id1 + - http://conda.anaconda.org/ioam # only for holoviews + - http://conda.anaconda.org/conda-forge + +dependencies: + - python=3.*.* + - numpy + + # geoarray + - pyqt + - gdal + - scikit-image + - rasterio + - pyproj + - lxml + - geopandas + - ipython + - matplotlib + - basemap + - shapely + - holoviews + - bokeh + - pip: + - scipy + - geoarray>=0.6.12 + - spectral>=0.16 + - sphinx-argparse + - flake8 + - pycodestyle + - pylint + - pydocstyle + - nose + - nose2 + - nose-htmloutput + - coverage + - rednose \ No newline at end of file