1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 pythonOlder,
7
8 beautifulsoup4,
9 fiona,
10 geodatasets,
11 geopandas,
12 numpy,
13 packaging,
14 pandas,
15 platformdirs,
16 requests,
17 scikit-learn,
18 scipy,
19 setuptools-scm,
20 shapely,
21}:
22
23buildPythonPackage rec {
24 pname = "libpysal";
25 version = "4.12.0";
26 pyproject = true;
27 disabled = pythonOlder "3.10";
28
29 src = fetchFromGitHub {
30 owner = "pysal";
31 repo = "libpysal";
32 rev = "refs/tags/v${version}";
33 hash = "sha256-m7jcTi51ngAXXWYJGkjMVA3KwAxL2aJysdjiS1pWEIQ=";
34 };
35
36 build-system = [ setuptools-scm ];
37
38 propagatedBuildInputs = [
39 beautifulsoup4
40 fiona
41 geopandas
42 numpy
43 packaging
44 pandas
45 platformdirs
46 requests
47 scikit-learn
48 scipy
49 shapely
50 ];
51
52 nativeCheckInputs = [
53 geodatasets
54 pytestCheckHook
55 ];
56
57 preCheck = ''
58 export HOME=$TMPDIR
59 '';
60
61 # requires network access
62 disabledTestPaths = [
63 "libpysal/graph/tests/test_summary.py"
64 "libpysal/cg/tests/test_geoJSON.py"
65 "libpysal/examples/tests/test_available.py"
66 "libpysal/graph/tests/test_base.py"
67 "libpysal/graph/tests/test_builders.py"
68 "libpysal/graph/tests/test_contiguity.py"
69 "libpysal/graph/tests/test_kernel.py"
70 "libpysal/graph/tests/test_matching.py"
71 "libpysal/graph/tests/test_plotting.py"
72 "libpysal/graph/tests/test_triangulation.py"
73 "libpysal/graph/tests/test_utils.py"
74 "libpysal/graph/tests/test_set_ops.py"
75 "libpysal/weights/tests/test_contiguity.py"
76 "libpysal/weights/tests/test_util.py"
77 ];
78
79 pythonImportsCheck = [ "libpysal" ];
80
81 meta = {
82 description = "Library of spatial analysis functions";
83 homepage = "https://pysal.org/libpysal/";
84 license = lib.licenses.bsd3;
85 maintainers = lib.teams.geospatial.members;
86 };
87}