1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 cython,
8 gdal,
9 setuptools,
10
11 # dependencies
12 attrs,
13 certifi,
14 click,
15 click-plugins,
16 cligj,
17
18 # optional-dependencies
19 pyparsing,
20 shapely,
21 boto3,
22
23 # tests
24 fsspec,
25 pytestCheckHook,
26 pytz,
27 snuggs,
28}:
29
30buildPythonPackage rec {
31 pname = "fiona";
32 version = "1.10.1";
33 pyproject = true;
34
35 src = fetchFromGitHub {
36 owner = "Toblerity";
37 repo = "Fiona";
38 tag = version;
39 hash = "sha256-5NN6PBh+6HS9OCc9eC2TcBvkcwtI4DV8qXnz4tlaMXc=";
40 };
41
42 build-system = [
43 cython
44 gdal # for gdal-config
45 setuptools
46 ];
47
48 buildInputs = [ gdal ];
49
50 dependencies = [
51 attrs
52 certifi
53 click
54 click-plugins
55 cligj
56 ];
57
58 optional-dependencies = {
59 calc = [
60 pyparsing
61 shapely
62 ];
63 s3 = [ boto3 ];
64 };
65
66 nativeCheckInputs = [
67 fsspec
68 pytestCheckHook
69 pytz
70 shapely
71 snuggs
72 ]
73 ++ optional-dependencies.s3;
74
75 preCheck = ''
76 rm -r fiona # prevent importing local fiona
77 '';
78
79 disabledTestMarks = [
80 # Tests with gdal marker do not test the functionality of Fiona,
81 # but they are used to check GDAL driver capabilities.
82 "gdal"
83 ];
84
85 disabledTests = [
86 # Some tests access network, others test packaging
87 "http"
88 "https"
89 "wheel"
90
91 # see: https://github.com/Toblerity/Fiona/issues/1273
92 "test_append_memoryfile_drivers"
93 ];
94
95 pythonImportsCheck = [ "fiona" ];
96
97 doInstallCheck = true;
98
99 meta = {
100 changelog = "https://github.com/Toblerity/Fiona/blob/${src.rev}/CHANGES.txt";
101 description = "OGR's neat, nimble, no-nonsense API for Python";
102 mainProgram = "fio";
103 homepage = "https://fiona.readthedocs.io/";
104 license = lib.licenses.bsd3;
105 teams = [ lib.teams.geospatial ];
106 };
107}