1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 pytestCheckHook,
7 setuptools,
8 anyio,
9 httpx,
10 pytest-asyncio,
11 pytest-vcr,
12}:
13
14buildPythonPackage rec {
15 pname = "notion-client";
16 version = "2.2.1";
17 pyproject = true;
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "ramnes";
23 repo = "notion-sdk-py";
24 rev = "refs/tags/${version}";
25 hash = "sha256-IEWFrdqrawFbuwA8bUewanmBoGWsjHJ7ucgvHQEaMcA=";
26 };
27
28 nativeBuildInputs = [ setuptools ];
29
30 propagatedBuildInputs = [ httpx ];
31
32 # disable coverage options as they don't provide us value, and they break the default pytestCheckHook
33 preCheck = ''
34 sed -i '/addopts/d' ./setup.cfg
35 '';
36
37 nativeCheckInputs = [
38 pytestCheckHook
39 anyio
40 pytest-asyncio
41 pytest-vcr
42 ];
43
44 pythonImportsCheck = [ "notion_client" ];
45
46 meta = with lib; {
47 description = "Python client for the official Notion API";
48 homepage = "https://github.com/ramnes/notion-sdk-py";
49 changelog = "https://github.com/ramnes/notion-sdk-py/releases/tag/${version}";
50 license = licenses.mit;
51 maintainers = with maintainers; [ jpetrucciani ];
52 };
53}