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