1{ lib
2, stdenv
3, buildPythonPackage
4, fetchFromGitHub
5, lxml
6, pyproj
7, pytestCheckHook
8, python-dateutil
9, pythonOlder
10, pytz
11, pyyaml
12, requests
13, python
14}:
15
16buildPythonPackage rec {
17 pname = "owslib";
18 version = "0.29.3";
19 format = "setuptools";
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchFromGitHub {
24 owner = "geopython";
25 repo = "OWSLib";
26 rev = "refs/tags/${version}";
27 hash = "sha256-yAJXknSsGXcerzaOVSrFO4j5E6B/4/0JfoSxZ+Szmws=";
28 };
29
30 postPatch = ''
31 substituteInPlace tox.ini \
32 --replace " --doctest-modules --doctest-glob 'tests/**/*.txt' --cov-report term-missing --cov owslib" ""
33 '';
34
35 propagatedBuildInputs = [
36 lxml
37 pyproj
38 python-dateutil
39 pytz
40 pyyaml
41 requests
42 ];
43
44 nativeCheckInputs = [
45 pytestCheckHook
46 ];
47
48 pythonImportsCheck = [
49 "owslib"
50 ];
51
52 preCheck = ''
53 # _pytest.pathlib.ImportPathMismatchError: ('owslib.swe.sensor.sml', '/build/source/build/...
54 export PY_IGNORE_IMPORTMISMATCH=1
55 '';
56
57 disabledTests = [
58 # Tests require network access
59 "test_ows_interfaces_wcs"
60 "test_wfs_110_remotemd"
61 "test_wfs_200_remotemd"
62 "test_wms_130_remotemd"
63 "test_wmts_example_informatievlaanderen"
64 "test_opensearch_creodias"
65 ] ++ lib.optionals stdenv.isDarwin [
66 "test_ogcapi_processes_pygeoapi"
67 "test_ogcapi_records_pycsw"
68 "test_ogcapi_records_pygeoapi"
69 "test_wms_getfeatureinfo_130"
70 ];
71
72 meta = with lib; {
73 description = "Client for Open Geospatial Consortium web service interface standards";
74 homepage = "https://www.osgeo.org/projects/owslib/";
75 changelog = "https://github.com/geopython/OWSLib/releases/tag/${version}";
76 license = licenses.bsd3;
77 maintainers = teams.geospatial.members;
78 };
79}