1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 pythonOlder,
7
8 certifi,
9 cython,
10 gdal,
11 numpy,
12 packaging,
13 setuptools,
14 versioneer,
15 wheel,
16}:
17
18buildPythonPackage rec {
19 pname = "pyogrio";
20 version = "0.11.1";
21 pyproject = true;
22 disabled = pythonOlder "3.9";
23
24 src = fetchFromGitHub {
25 owner = "geopandas";
26 repo = "pyogrio";
27 tag = "v${version}";
28 hash = "sha256-F6XfkihN3k2xquYS8jJMlqtLXzaTORaduJ2Q9LhSQGM=";
29 };
30
31 postPatch = ''
32 substituteInPlace pyproject.toml \
33 --replace-fail "versioneer[toml]==0.28" "versioneer[toml]"
34 '';
35
36 nativeBuildInputs = [
37 cython
38 gdal # for gdal-config
39 setuptools
40 versioneer
41 wheel
42 ]
43 ++ versioneer.optional-dependencies.toml;
44
45 buildInputs = [ gdal ];
46
47 propagatedBuildInputs = [
48 certifi
49 numpy
50 packaging
51 ];
52
53 nativeCheckInputs = [ pytestCheckHook ];
54
55 preCheck = ''
56 python setup.py build_ext --inplace
57 '';
58
59 disabledTestMarks = [
60 # disable tests which require network access
61 "network"
62 ];
63
64 pythonImportsCheck = [ "pyogrio" ];
65
66 meta = {
67 description = "Vectorized spatial vector file format I/O using GDAL/OGR";
68 homepage = "https://pyogrio.readthedocs.io/";
69 changelog = "https://github.com/geopandas/pyogrio/blob/${src.tag}/CHANGES.md";
70 license = lib.licenses.mit;
71 teams = [ lib.teams.geospatial ];
72 };
73}