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 = "8.1.0";
18 format = "setuptools";
19
20 disabled = pythonOlder "3.8";
21
22 src = fetchFromGitHub {
23 owner = "alphagov";
24 repo = pname;
25 rev = "refs/tags/${version}";
26 hash = "sha256-pdBPjc2j0/PSk224r8un22pNQ9g1jMdhPn8XmoKp+ng=";
27 };
28
29 propagatedBuildInputs = [
30 docopt
31 pyjwt
32 requests
33 ];
34
35 nativeCheckInputs = [
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 changelog = "https://github.com/alphagov/notifications-python-client/blob/${version}/CHANGELOG.md";
56 license = with licenses; [ mit ];
57 maintainers = with maintainers; [ fab ];
58 };
59}