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