nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
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.21";
10
11 src = fetchPypi {
12 pname = "Fiona";
13 inherit version;
14 sha256 = "sha256-Og7coqegcNtAXXEYchSkPSMzpXtAl1RKP8woIGali/w=";
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 ];
53
54 meta = with lib; {
55 description = "OGR's neat, nimble, no-nonsense API for Python";
56 homepage = "https://fiona.readthedocs.io/";
57 license = licenses.bsd3;
58 maintainers = with maintainers; [ knedlsepp ];
59 };
60}