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.5.0";
17 pyproject = true;
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchFromGitHub {
22 owner = "ramnes";
23 repo = "notion-sdk-py";
24 tag = version;
25 hash = "sha256-5SuSfjKs5+2lAVyzK3JVk1naiaYYYBF+X2I+k53Fqx4=";
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 disabledTests = [
47 # requires network access
48 "test_api_http_response_error"
49 ];
50
51 meta = with lib; {
52 description = "Python client for the official Notion API";
53 homepage = "https://github.com/ramnes/notion-sdk-py";
54 changelog = "https://github.com/ramnes/notion-sdk-py/releases/tag/${src.tag}";
55 license = licenses.mit;
56 maintainers = with maintainers; [ jpetrucciani ];
57 };
58}