From 84d3d95f564d4fead92b975a3335898cbbf45b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 26 Apr 2021 11:01:19 +0200 Subject: [PATCH] python3Packages.mock-services: init at 0.3.1 --- .../python-modules/mock-services/default.nix | 56 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 58 insertions(+) create mode 100644 pkgs/development/python-modules/mock-services/default.nix diff --git a/pkgs/development/python-modules/mock-services/default.nix b/pkgs/development/python-modules/mock-services/default.nix new file mode 100644 index 000000000000..2917b21dcfe4 --- /dev/null +++ b/pkgs/development/python-modules/mock-services/default.nix @@ -0,0 +1,56 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, fetchpatch +, attrs +, funcsigs +, requests-mock +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "mock-services"; + version = "0.3.1"; + + src = fetchFromGitHub { + owner = "peopledoc"; + repo = "mock-services"; + rev = version; + sha256 = "1rqyyfwngi1xsd9a81irjxacinkj1zf6nqfvfxhi55ky34x5phf9"; + }; + + patches = [ + # Fix issues due to internal API breaking in latest versions of requests-mock + (fetchpatch { + url = "https://github.com/peopledoc/mock-services/commit/88d3a0c9ef4dd7d5e011068ed2fdbbecc4a1a03a.patch"; + sha256 = "0a4pwxr33kr525sp8q4mb4cr3n2b51mj2a3052lhg6brdbi4gnms"; + }) + ]; + + propagatedBuildInputs = [ + attrs + funcsigs + requests-mock + ]; + + checkInputs = [ + pytestCheckHook + ]; + + disabledTests = [ + # require networking + "test_real_http_1" + "test_restart_http_mock" + "test_start_http_mock" + "test_stop_http_mock" + ]; + + pythonImportsCheck = [ "mock_services" ]; + + meta = with lib; { + description = "Mock an entire service API based on requests-mock"; + homepage = "https://github.com/peopledoc/mock-services"; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 439d4d8e4a5c..f5059edc63a5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4184,6 +4184,8 @@ in { mock-open = callPackage ../development/python-modules/mock-open { }; + mock-services = callPackage ../development/python-modules/mock-services { }; + modeled = callPackage ../development/python-modules/modeled { }; moderngl = callPackage ../development/python-modules/moderngl { };