1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 poetry-core,
7 pytest-asyncio,
8 pytestCheckHook,
9 pythonOlder,
10 requests,
11 responses,
12}:
13
14buildPythonPackage rec {
15 pname = "todoist-api-python";
16 version = "2.1.3";
17 format = "pyproject";
18
19 disabled = pythonOlder "3.11";
20
21 src = fetchFromGitHub {
22 owner = "Doist";
23 repo = pname;
24 rev = "refs/tags/v${version}";
25 hash = "sha256-Xi3B/Nl5bMbW0lYwrkEbBgFTEl07YkFyN18kN0WyGyw=";
26 };
27
28 patches = [
29 # Switch to poetry-core, https://github.com/Doist/todoist-api-python/pull/81
30 (fetchpatch {
31 name = "switch-to-poetry-core.patch";
32 url = "https://github.com/Doist/todoist-api-python/commit/42288e066d2f0c69611ab50cb57ca98b8c6bd1ca.patch";
33 hash = "sha256-yq+VVvjPYywvUn+ydyWVQPkiYPYWe9U6w38G54L2lkE=";
34 })
35 ];
36
37 nativeBuildInputs = [ poetry-core ];
38
39 propagatedBuildInputs = [ requests ];
40
41 nativeCheckInputs = [
42 pytest-asyncio
43 pytestCheckHook
44 responses
45 ];
46
47 pythonImportsCheck = [ "todoist_api_python" ];
48
49 meta = with lib; {
50 description = "Library for the Todoist REST API";
51 homepage = "https://github.com/Doist/todoist-api-python";
52 changelog = "https://github.com/Doist/todoist-api-python/blob/v${version}/CHANGELOG.md";
53 license = with licenses; [ mit ];
54 maintainers = with maintainers; [ fab ];
55 };
56}