Merge pull request #28953 from knedlsepp/add-geopandas

pythonPackages.geopandas: init at 0.3.0
This commit is contained in:
Jörg Thalheim
2017-09-05 08:45:23 +01:00
committed by GitHub
7 changed files with 220 additions and 34 deletions

View File

@@ -0,0 +1,29 @@
{ stdenv, buildPythonPackage, fetchPypi,
click, pytest
}:
buildPythonPackage rec {
pname = "click-plugins";
version = "1.0.3";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "1ifphgaw5mmcdnqd0qfnmrbm62q3k6p573aff4cxgpyjxmz5xk3s";
};
propagatedBuildInputs = [
click
];
checkInputs = [
pytest
];
meta = with stdenv.lib; {
description = "An extension module for click to enable registering CLI commands";
homepage = https://github.com/click-contrib/click-plugins;
license = licenses.bsd3;
maintainers = with maintainers; [ knedlsepp ];
};
}

View File

@@ -0,0 +1,33 @@
{ stdenv, buildPythonPackage, fetchFromGitHub
, click, pytest, glibcLocales
}:
buildPythonPackage rec {
pname = "cligj";
version = "0.4.0";
name = "${pname}-${version}";
src = fetchFromGitHub {
owner = "mapbox";
repo = "cligj";
rev = version;
sha256 = "0fclxagxv23v75yiypb29a8sja23dakhvmx3blmxyhg2sci92sx8";
};
propagatedBuildInputs = [
click
];
checkInputs = [ pytest glibcLocales ];
checkPhase = ''
LC_ALL=en_US.utf-8 pytest tests
'';
meta = with stdenv.lib; {
description = "Click params for commmand line interfaces to GeoJSON";
homepage = https://github.com/mapbox/cligj;
license = licenses.bsd3;
maintainers = with maintainers; [ knedlsepp ];
};
}

View File

@@ -0,0 +1,26 @@
{ stdenv, buildPythonPackage, fetchPypi,
matplotlib, shapely
}:
buildPythonPackage rec {
pname = "descartes";
version = "1.1.0";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "0nq36w9ylvfwmwn5qd9c8fsp2jzsqpmy4xcr6pzxcpmg8qhm0nhk";
};
propagatedBuildInputs = [
matplotlib
shapely
];
meta = with stdenv.lib; {
description = "Python library to use Shapely or GeoJSON objects as matplotlib paths";
homepage = https://bitbucket.org/sgillies/descartes/;
license = licenses.bsd3;
maintainers = with maintainers; [ knedlsepp ];
};
}

View File

@@ -0,0 +1,41 @@
{ stdenv, buildPythonPackage, fetchPypi,
six, cligj, munch, click-plugins, enum34, pytest, nose,
gdal
}:
buildPythonPackage rec {
pname = "Fiona";
version = "1.7.9";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "1fmdgpfnifaqfqwkfiwkpk19wmpi9avmh8a7jqylqi578jvp3fwi";
};
buildInputs = [
gdal
];
propagatedBuildInputs = [
six
cligj
munch
click-plugins
enum34
];
checkInputs = [
pytest
nose
];
doCheck = false;
meta = with stdenv.lib; {
description = "OGR's neat, nimble, no-nonsense API for Python";
homepage = http://toblerity.org/fiona/;
license = licenses.bsd3;
maintainers = with maintainers; [ knedlsepp ];
};
}

View File

@@ -0,0 +1,36 @@
{ stdenv, buildPythonPackage, fetchFromGitHub
, pandas, shapely, fiona, descartes, pyproj
, pytest }:
buildPythonPackage rec {
name = "geopandas-${version}";
version = "0.3.0";
src = fetchFromGitHub {
owner = "geopandas";
repo = "geopandas";
rev = "v${version}";
sha256 = "0maafafr7sjjmlg2f19bizg06c8a5z5igmbcgq6kgmi7rklx8xxz";
};
checkInputs = [ pytest ];
checkPhase = ''
py.test geopandas
'';
propagatedBuildInputs = [
pandas
shapely
fiona
descartes
pyproj
];
meta = with stdenv.lib; {
description = "Python geospatial data analysis framework";
homepage = https://geopandas.org;
license = licenses.bsd3;
maintainers = with maintainers; [ knedlsepp ];
};
}

View File

@@ -0,0 +1,44 @@
{ stdenv, buildPythonPackage, fetchPypi
, geos, glibcLocales, pytest, cython, sharedLibraryExtension
, numpy
}:
buildPythonPackage rec {
name = "${pname}-${version}";
pname = "Shapely";
version = "1.5.15";
src = fetchPypi {
inherit pname version;
sha256 = "0lfqxb3kpdn0g9zzlhzg79yc8iyy4fpsk0p5nd80gar1mmhr8pg7";
};
buildInputs = [ geos glibcLocales cython ];
checkInputs = [ pytest ];
propagatedBuildInputs = [ numpy ];
preConfigure = ''
export LANG="en_US.UTF-8";
'';
patchPhase = let
libc = if stdenv.isDarwin then "libc.dylib" else "libc.so.6";
in ''
sed -i "s|_lgeos = load_dll('geos_c', fallbacks=.*)|_lgeos = load_dll('geos_c', fallbacks=['${geos}/lib/libgeos_c${sharedLibraryExtension}'])|" shapely/geos.py
sed -i "s|free = load_dll('c').free|free = load_dll('c', fallbacks=['${stdenv.cc.libc}/lib/${stdenv.cc.libc}']).free|" shapely/geos.py
'';
# tests/test_voctorized fails because the vectorized extension is not
# available in when running tests
checkPhase = ''
py.test --ignore tests/test_vectorized.py
'';
meta = with stdenv.lib; {
description = "Geometric objects, predicates, and operations";
maintainers = with maintainers; [ knedlsepp ];
homepage = "https://pypi.python.org/pypi/Shapely/";
};
}