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