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:
- conda create -y -q --name py_tools_ds_testinstall python=3
- 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
- conda config --set channel_priority strict # otherwise gdal or libgdal may be installed from defaults channel
# 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
- python setup.py install
......@@ -130,7 +134,7 @@ deploy_anaconda:
script:
- source /root/miniconda3/bin/activate
- 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
# - 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
......
......@@ -62,7 +62,7 @@ Using conda_, the recommended approach is:
# create virtual environment for py_tools_ds, this is optional
conda create -y -q --name py_tools_ds python=3
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:
......
......@@ -22,13 +22,10 @@ requirements:
- sphinx-argparse
run:
- python
- pyqt
- numpy
- gdal
- scikit-image
- rasterio
- pyproj
- lxml
- scikit-image
- geopandas
- six
- spectral
......
......@@ -24,6 +24,7 @@
import numpy as np
import warnings
import multiprocessing
from pkgutil import find_loader
# custom
try:
......@@ -44,9 +45,9 @@ from ...compatibility.gdal import get_gdal_func
__author__ = "Daniel Scheffler"
def warp_ndarray_OLD(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,
outExtent_within=True): # pragma: no cover
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,
outExtent_within=True): # pragma: no cover
"""Reproject / warp a numpy array with given geo information to target coordinate system.
:param ndarray: numpy.ndarray [rows,cols,bands]
......@@ -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_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
# There is a maximum number and if this is exceeded an ImportError is raised:
# ImportError: dlopen: cannot load any more object with static TLS
......
......@@ -19,5 +19,5 @@
# 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/>.
__version__ = '0.14.24'
__versionalias__ = '20200107_01'
__version__ = '0.14.25'
__versionalias__ = '20200108_01'
......@@ -3,9 +3,8 @@ kealib # fix for libkea.so.1.4.7: cannot open shared object file: No such file
numpy
shapely
six
rasterio
scikit-image
pandas
geopandas
scikit-image
pyproj
spectral
......@@ -36,8 +36,7 @@ version = {}
with open("py_tools_ds/version.py") as version_file:
exec(version_file.read(), version)
requirements = ['gdal', 'numpy', 'shapely', 'six', 'rasterio', 'pandas', 'geopandas',
'scikit-image', 'pyproj', 'spectral']
requirements = ['gdal', 'numpy', 'shapely', 'six', 'pandas', 'scikit-image', 'geopandas', 'pyproj', 'spectral']
setup_requirements = [] # TODO(danschef): put setup requirements (distutils extensions, etc.) here
test_requirements = requirements + ["coverage", "nose", "nose2", "nose-htmloutput", "rednose"]
......@@ -69,8 +68,10 @@ setup(
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
test_suite='tests',
tests_require=test_requirements,
setup_requires=setup_requirements
setup_requires=setup_requirements,
extras_require={'rio_reproject': ["rasterio"]}
)
......@@ -5,20 +5,14 @@ channels: &id1
dependencies:
- python=3.*.*
- pyqt
- pip # avoids that conda uses the wrong pip
- numpy
- 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)
# - 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
- lxml
- scikit-image
- geopandas
- ipython
- conda-build # for conda deployment
- conda-build-all
- anaconda-client # for conda upload
- pip:
- sphinx-argparse
- six
......
......@@ -6,7 +6,9 @@ RUN yum update -y && \
COPY *.yml /root/
# 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 "\
source /root/miniconda3/bin/activate ; \
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