Commit 81cfdd9b authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Merge branch 'enhancement/clean_deps' into 'master'

Enhancement/clean deps

See merge request !16
parents b2394ba8 0490729a
Pipeline #5531 failed with stages
in 57 minutes and 57 seconds
...@@ -58,11 +58,15 @@ test_py_tools_ds_install: ...@@ -58,11 +58,15 @@ test_py_tools_ds_install:
- conda create -y -q --name py_tools_ds_testinstall python=3 - conda create -y -q --name py_tools_ds_testinstall python=3
- source activate py_tools_ds_testinstall - source activate py_tools_ds_testinstall
# update conda and python
- conda update -n base -c defaults conda
# - conda update -c conda-forge python
# avoid package incompatibilities due to usage of wrong channels # avoid package incompatibilities due to usage of wrong channels
- conda config --set channel_priority strict # otherwise gdal or libgdal may be installed from defaults channel - conda config --set channel_priority strict # otherwise gdal or libgdal may be installed from defaults channel
# resolve some requirements with conda # resolve some requirements with conda
- conda install --yes -q -c conda-forge numpy gdal scikit-image pyproj rasterio shapely geopandas - conda install --yes -q -c conda-forge numpy gdal pyproj shapely geopandas
# run installer # run installer
- python setup.py install - python setup.py install
...@@ -130,7 +134,7 @@ deploy_anaconda: ...@@ -130,7 +134,7 @@ deploy_anaconda:
script: script:
- source /root/miniconda3/bin/activate - source /root/miniconda3/bin/activate
- source activate ci_env - source activate ci_env
- conda install -y -q conda-build anaconda-client - conda install -y -q conda-build conda-build-all anaconda-client
- yum install -y patch # https://stackoverflow.com/questions/40392161/building-conda-skeleton-from-pypi-package-throws-error - yum install -y patch # https://stackoverflow.com/questions/40392161/building-conda-skeleton-from-pypi-package-throws-error
# - conda skeleton pypi py_tools_ds --output-dir public/conda.recipe/py_tools_ds # create recipe # - conda skeleton pypi py_tools_ds --output-dir public/conda.recipe/py_tools_ds # create recipe
- conda config --set anaconda_upload yes # enable auto-upload to anaconda - conda config --set anaconda_upload yes # enable auto-upload to anaconda
......
...@@ -62,7 +62,7 @@ Using conda_, the recommended approach is: ...@@ -62,7 +62,7 @@ Using conda_, the recommended approach is:
# create virtual environment for py_tools_ds, this is optional # create virtual environment for py_tools_ds, this is optional
conda create -y -q --name py_tools_ds python=3 conda create -y -q --name py_tools_ds python=3
source activate py_tools_ds source activate py_tools_ds
conda install -c conda-forge numpy gdal scikit-image pyproj rasterio shapely pandas conda install -c conda-forge numpy gdal pyproj shapely scikit-image pandas
Then install py_tools_ds using the pip installer: Then install py_tools_ds using the pip installer:
......
...@@ -22,13 +22,10 @@ requirements: ...@@ -22,13 +22,10 @@ requirements:
- sphinx-argparse - sphinx-argparse
run: run:
- python - python
- pyqt
- numpy - numpy
- gdal - gdal
- scikit-image
- rasterio
- pyproj - pyproj
- lxml - scikit-image
- geopandas - geopandas
- six - six
- spectral - spectral
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
import numpy as np import numpy as np
import warnings import warnings
import multiprocessing import multiprocessing
from pkgutil import find_loader
# custom # custom
try: try:
...@@ -44,7 +45,7 @@ from ...compatibility.gdal import get_gdal_func ...@@ -44,7 +45,7 @@ from ...compatibility.gdal import get_gdal_func
__author__ = "Daniel Scheffler" __author__ = "Daniel Scheffler"
def warp_ndarray_OLD(ndarray, in_gt, in_prj, out_prj, out_gt=None, outRowsCols=None, outUL=None, out_res=None, def warp_ndarray_rasterio(ndarray, in_gt, in_prj, out_prj, out_gt=None, outRowsCols=None, outUL=None, out_res=None,
out_extent=None, out_dtype=None, rsp_alg=0, in_nodata=None, out_nodata=None, out_extent=None, out_dtype=None, rsp_alg=0, in_nodata=None, out_nodata=None,
outExtent_within=True): # pragma: no cover outExtent_within=True): # pragma: no cover
"""Reproject / warp a numpy array with given geo information to target coordinate system. """Reproject / warp a numpy array with given geo information to target coordinate system.
...@@ -71,6 +72,11 @@ def warp_ndarray_OLD(ndarray, in_gt, in_prj, out_prj, out_gt=None, outRowsCols=N ...@@ -71,6 +72,11 @@ def warp_ndarray_OLD(ndarray, in_gt, in_prj, out_prj, out_gt=None, outRowsCols=N
:return out_gt: warped gdal GeoTransform :return out_gt: warped gdal GeoTransform
:return out_prj: warped projection as WKT string :return out_prj: warped projection as WKT string
""" """
if not find_loader('rasterio'):
raise ImportError('This function requires rasterio. You need to install it manually '
'(conda install -c conda-forge rasterio). It is not automatically installed.')
# NOTE: rasterio seems to increase the number of objects with static TLS # NOTE: rasterio seems to increase the number of objects with static TLS
# There is a maximum number and if this is exceeded an ImportError is raised: # There is a maximum number and if this is exceeded an ImportError is raised:
# ImportError: dlopen: cannot load any more object with static TLS # ImportError: dlopen: cannot load any more object with static TLS
......
...@@ -19,5 +19,5 @@ ...@@ -19,5 +19,5 @@
# You should have received a copy of the GNU Lesser General Public License along # You should have received a copy of the GNU Lesser General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>. # with this program. If not, see <http://www.gnu.org/licenses/>.
__version__ = '0.14.24' __version__ = '0.14.25'
__versionalias__ = '20200107_01' __versionalias__ = '20200108_01'
...@@ -3,9 +3,8 @@ kealib # fix for libkea.so.1.4.7: cannot open shared object file: No such file ...@@ -3,9 +3,8 @@ kealib # fix for libkea.so.1.4.7: cannot open shared object file: No such file
numpy numpy
shapely shapely
six six
rasterio scikit-image
pandas pandas
geopandas geopandas
scikit-image
pyproj pyproj
spectral spectral
...@@ -36,8 +36,7 @@ version = {} ...@@ -36,8 +36,7 @@ version = {}
with open("py_tools_ds/version.py") as version_file: with open("py_tools_ds/version.py") as version_file:
exec(version_file.read(), version) exec(version_file.read(), version)
requirements = ['gdal', 'numpy', 'shapely', 'six', 'rasterio', 'pandas', 'geopandas', requirements = ['gdal', 'numpy', 'shapely', 'six', 'pandas', 'scikit-image', 'geopandas', 'pyproj', 'spectral']
'scikit-image', 'pyproj', 'spectral']
setup_requirements = [] # TODO(danschef): put setup requirements (distutils extensions, etc.) here setup_requirements = [] # TODO(danschef): put setup requirements (distutils extensions, etc.) here
test_requirements = requirements + ["coverage", "nose", "nose2", "nose-htmloutput", "rednose"] test_requirements = requirements + ["coverage", "nose", "nose2", "nose-htmloutput", "rednose"]
...@@ -69,8 +68,10 @@ setup( ...@@ -69,8 +68,10 @@ setup(
'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
], ],
test_suite='tests', test_suite='tests',
tests_require=test_requirements, tests_require=test_requirements,
setup_requires=setup_requirements setup_requires=setup_requirements,
extras_require={'rio_reproject': ["rasterio"]}
) )
...@@ -5,20 +5,14 @@ channels: &id1 ...@@ -5,20 +5,14 @@ channels: &id1
dependencies: dependencies:
- python=3.*.* - python=3.*.*
- pyqt - pip # avoids that conda uses the wrong pip
- numpy - numpy
- gdal - gdal
- conda-forge::libgdal # force to use conda-forge for libgdal to avoid package version incompatiblies due to mixed channels (libkea.so.1.4.7: cannot open shared object file: No such file or directory) - conda-forge::libgdal # force to use conda-forge for libgdal to avoid package version incompatiblies due to mixed channels (libkea.so.1.4.7: cannot open shared object file: No such file or directory)
# - kealib # fix for libkea.so.1.4.7: cannot open shared object file: No such file or directory (not needed as long as libgdal and gdal are conda-forge packages) # - kealib # fix for libkea.so.1.4.7: cannot open shared object file: No such file or directory (not needed as long as libgdal and gdal are conda-forge packages)
- scikit-image
- rasterio
- pyproj - pyproj
- lxml - scikit-image
- geopandas - geopandas
- ipython
- conda-build # for conda deployment
- conda-build-all
- anaconda-client # for conda upload
- pip: - pip:
- sphinx-argparse - sphinx-argparse
- six - six
......
...@@ -6,7 +6,9 @@ RUN yum update -y && \ ...@@ -6,7 +6,9 @@ RUN yum update -y && \
COPY *.yml /root/ COPY *.yml /root/
# update the ci_env environment (that already contains all packages installed via 'docker_pyenvs' repo) # update the ci_env environment (that already contains all packages installed via 'docker_pyenvs' repo)
# -> also include packages for conda deployment and upload
RUN /bin/bash -i -c "\ RUN /bin/bash -i -c "\
source /root/miniconda3/bin/activate ; \ source /root/miniconda3/bin/activate ; \
source activate ci_env; \ source activate ci_env; \
conda env update -n ci_env -f /root/environment_py_tools_ds.yml" conda env update -n ci_env -f /root/environment_py_tools_ds.yml ; \
conda install -c conda-forge conda-build conda-build-all anaconda-client"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment