2023-01-11 07:51:40 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, pytestCheckHook
|
2024-01-13 08:15:51 +00:00
|
|
|
, setuptools
|
2023-01-11 07:51:40 +00:00
|
|
|
, anyio
|
|
|
|
, httpx
|
|
|
|
, pytest-asyncio
|
|
|
|
, pytest-vcr
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "notion-client";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "2.2.1";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ramnes";
|
|
|
|
repo = "notion-sdk-py";
|
2024-01-13 08:15:51 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-IEWFrdqrawFbuwA8bUewanmBoGWsjHJ7ucgvHQEaMcA=";
|
2023-01-11 07:51:40 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
];
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
httpx
|
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
# disable coverage options as they don't provide us value, and they break the default pytestCheckHook
|
2023-01-11 07:51:40 +00:00
|
|
|
preCheck = ''
|
|
|
|
sed -i '/addopts/d' ./setup.cfg
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-01-11 07:51:40 +00:00
|
|
|
pytestCheckHook
|
|
|
|
anyio
|
|
|
|
pytest-asyncio
|
|
|
|
pytest-vcr
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"notion_client"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python client for the official Notion API";
|
|
|
|
homepage = "https://github.com/ramnes/notion-sdk-py";
|
|
|
|
changelog = "https://github.com/ramnes/notion-sdk-py/releases/tag/${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ jpetrucciani ];
|
|
|
|
};
|
|
|
|
}
|