diff --git a/pkgs/development/python-modules/kmock/default.nix b/pkgs/development/python-modules/kmock/default.nix new file mode 100644 index 000000000000..153c92cf1f39 --- /dev/null +++ b/pkgs/development/python-modules/kmock/default.nix @@ -0,0 +1,78 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + setuptools-scm, + + # dependencies + aiohttp, + attrs, + jsonpatch, + yarl, + typing-extensions, + + # tests + pytestCheckHook, + pytest-asyncio, + looptime, + aresponses, +}: + +buildPythonPackage (finalAttrs: { + pname = "kmock"; + version = "0.6"; + pyproject = true; + + src = fetchFromGitHub { + owner = "nolar"; + repo = "kmock"; + tag = finalAttrs.version; + hash = "sha256-qpRuSWwaPEgfE+wN1ADSyn2AbXPDzZfZ7dOf8Vw0zJA="; + }; + + build-system = [ + setuptools + setuptools-scm + ]; + + dependencies = [ + aiohttp + attrs + jsonpatch + yarl + typing-extensions + ]; + + pythonImportsCheck = [ "kmock" ]; + + nativeCheckInputs = [ + pytestCheckHook + pytest-asyncio + aresponses + looptime + ]; + + disabledTests = [ + # Could not contact DNS servers + "test_bare_host_resolution" + # Cannot connect to host clients3.google.com + "test_hostname_interception" + # Timeout + "test_arbitrary_stream" + "test_kubernetes_watch_stream" + # assert 0 == 1 + "test_sync_condition_notifying" + ]; + + __darwinAllowLocalNetworking = true; + + meta = { + description = "HTTP/API/Kubernetes Mock Server in Python"; + changelog = "https://github.com/nolar/kmock/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ sigmanificient ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d5de3da1ee2a..1904d75d6ac7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8289,6 +8289,8 @@ self: super: with self; { kml2geojson = callPackage ../development/python-modules/kml2geojson { }; + kmock = callPackage ../development/python-modules/kmock { }; + kmsxx = toPythonModule ( pkgs.kmsxx.override { withPython = true;