Yueh-Shun Li 624897829b treewide: modernize Python package pytest flags
Use `(enabled|disabled)(TestPaths|TestMarks|Tests)` and `pytestFlags`
instead of the `__structuredAttrs`-incompatible `pytestFlagsArray`.
2025-07-15 03:00:08 +08:00

76 lines
1.5 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
lxml,
pytest-cov-stub,
pytest-httpserver,
pytestCheckHook,
python-dateutil,
pythonOlder,
pyyaml,
requests,
setuptools,
}:
buildPythonPackage rec {
pname = "owslib";
version = "0.34.1";
pyproject = true;
disabled = pythonOlder "3.10";
src = fetchFromGitHub {
owner = "geopython";
repo = "OWSLib";
tag = version;
hash = "sha256-eLSODYal9rcualQrM03/hwLBngty+9fIlPIJh1EZduA=";
};
postPatch = ''
substituteInPlace tox.ini \
--replace-fail "--doctest-modules" "" \
--replace-fail "--doctest-glob='tests/**/*.txt'" ""
'';
build-system = [ setuptools ];
dependencies = [
lxml
python-dateutil
pyyaml
requests
];
nativeCheckInputs = [
pytest-cov-stub
pytest-httpserver
pytestCheckHook
];
pythonImportsCheck = [ "owslib" ];
preCheck = ''
# _pytest.pathlib.ImportPathMismatchError: ('owslib.swe.sensor.sml', '/build/source/build/...
export PY_IGNORE_IMPORTMISMATCH=1
'';
disabledTestMarks = [
# Disable tests which require network access
"online"
];
disabledTestPaths = [
# Tests requires network access
"tests/test_ogcapi_connectedsystems_osh.py"
];
meta = with lib; {
description = "Client for Open Geospatial Consortium web service interface standards";
homepage = "https://www.osgeo.org/projects/owslib/";
changelog = "https://github.com/geopython/OWSLib/releases/tag/${src.tag}";
license = licenses.bsd3;
teams = [ teams.geospatial ];
};
}