1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 lxml,
6 pytest-cov-stub,
7 pytest-httpserver,
8 pytestCheckHook,
9 python-dateutil,
10 pythonOlder,
11 pyyaml,
12 requests,
13 setuptools,
14}:
15
16buildPythonPackage rec {
17 pname = "owslib";
18 version = "0.34.1";
19 pyproject = true;
20
21 disabled = pythonOlder "3.10";
22
23 src = fetchFromGitHub {
24 owner = "geopython";
25 repo = "OWSLib";
26 tag = version;
27 hash = "sha256-eLSODYal9rcualQrM03/hwLBngty+9fIlPIJh1EZduA=";
28 };
29
30 postPatch = ''
31 substituteInPlace tox.ini \
32 --replace-fail "--doctest-modules" "" \
33 --replace-fail "--doctest-glob='tests/**/*.txt'" ""
34 '';
35
36 build-system = [ setuptools ];
37
38 dependencies = [
39 lxml
40 python-dateutil
41 pyyaml
42 requests
43 ];
44
45 nativeCheckInputs = [
46 pytest-cov-stub
47 pytest-httpserver
48 pytestCheckHook
49 ];
50
51 pythonImportsCheck = [ "owslib" ];
52
53 preCheck = ''
54 # _pytest.pathlib.ImportPathMismatchError: ('owslib.swe.sensor.sml', '/build/source/build/...
55 export PY_IGNORE_IMPORTMISMATCH=1
56 '';
57
58 disabledTestMarks = [
59 # Disable tests which require network access
60 "online"
61 ];
62
63 disabledTestPaths = [
64 # Tests requires network access
65 "tests/test_ogcapi_connectedsystems_osh.py"
66 ];
67
68 meta = with lib; {
69 description = "Client for Open Geospatial Consortium web service interface standards";
70 homepage = "https://www.osgeo.org/projects/owslib/";
71 changelog = "https://github.com/geopython/OWSLib/releases/tag/${src.tag}";
72 license = licenses.bsd3;
73 teams = [ teams.geospatial ];
74 };
75}