1{ lib
2, buildPythonPackage
3, docopt
4, fetchFromGitHub
5, freezegun
6, mock
7, pyjwt
8, pytest-mock
9, pytestCheckHook
10, pythonOlder
11, requests
12, requests-mock
13}:
14
15buildPythonPackage rec {
16 pname = "notifications-python-client";
17 version = "6.4.1";
18 format = "setuptools";
19
20 disabled = pythonOlder "3.8";
21
22 src = fetchFromGitHub {
23 owner = "alphagov";
24 repo = pname;
25 rev = version;
26 sha256 = "sha256-HEHerdwplsPAld23Al8sUARu4T5IJLmY5kucAz2791c=";
27 };
28
29 propagatedBuildInputs = [
30 docopt
31 pyjwt
32 requests
33 ];
34
35 checkInputs = [
36 freezegun
37 mock
38 pytest-mock
39 pytestCheckHook
40 requests-mock
41 ];
42
43 postPatch = ''
44 substituteInPlace setup.py \
45 --replace "'pytest-runner'" ""
46 '';
47
48 pythonImportsCheck = [
49 "notifications_python_client"
50 ];
51
52 meta = with lib; {
53 description = "Python client for the GOV.UK Notify API";
54 homepage = "https://github.com/alphagov/notifications-python-client";
55 license = with licenses; [ mit ];
56 maintainers = with maintainers; [ fab ];
57 };
58}