1{ stdenv, lib, buildPythonPackage, fetchPypi, isPy3k, pythonOlder
2, attrs, click, cligj, click-plugins, six, munch, enum34
3, pytestCheckHook, boto3, mock, giflib, pytz
4, gdal, certifi
5}:
6
7buildPythonPackage rec {
8 pname = "fiona";
9 version = "1.8.20";
10
11 src = fetchPypi {
12 pname = "Fiona";
13 inherit version;
14 sha256 = "a70502d2857b82f749c09cb0dea3726787747933a2a1599b5ab787d74e3c143b";
15 };
16
17 CXXFLAGS = lib.optionalString stdenv.cc.isClang "-std=c++11";
18
19 nativeBuildInputs = [
20 gdal # for gdal-config
21 ];
22
23 buildInputs = [
24 gdal
25 ] ++ lib.optionals stdenv.cc.isClang [ giflib ];
26
27 propagatedBuildInputs = [
28 attrs
29 certifi
30 click
31 cligj
32 click-plugins
33 six
34 munch
35 pytz
36 ] ++ lib.optional (!isPy3k) enum34;
37
38 checkInputs = [
39 pytestCheckHook
40 boto3
41 ] ++ lib.optional (pythonOlder "3.4") mock;
42
43 preCheck = ''
44 rm -r fiona # prevent importing local fiona
45 # disable gdal deprecation warnings
46 export GDAL_ENABLE_DEPRECATED_DRIVER_GTM=YES
47 '';
48
49 disabledTests = [
50 # Some tests access network, others test packaging
51 "http" "https" "wheel"
52 # Assert not true
53 "test_no_append_driver_cannot_append"
54 ] ++ lib.optionals stdenv.isAarch64 [
55 # https://github.com/Toblerity/Fiona/issues/1012 the existence of this
56 # as a bug hasn't been challenged and other distributors seem to also
57 # be skipping these tests on aarch64, so this is not unique to nixpkgs.
58 "test_write_or_driver_error"
59 "test_append_or_driver_error"
60 ];
61
62 meta = with lib; {
63 description = "OGR's neat, nimble, no-nonsense API for Python";
64 homepage = "https://fiona.readthedocs.io/";
65 license = licenses.bsd3;
66 maintainers = with maintainers; [ knedlsepp ];
67 };
68}