1{
2 lib,
3 authlib,
4 buildPythonPackage,
5 fetchFromGitHub,
6 httpx,
7 mashumaro,
8 orjson,
9 pytest-asyncio,
10 pytest-httpx,
11 poetry-core,
12 pytestCheckHook,
13 pythonOlder,
14 respx,
15}:
16
17buildPythonPackage rec {
18 pname = "pydiscovergy";
19 version = "3.0.2";
20 pyproject = true;
21
22 disabled = pythonOlder "3.11";
23
24 src = fetchFromGitHub {
25 owner = "jpbede";
26 repo = "pydiscovergy";
27 rev = "refs/tags/v${version}";
28 hash = "sha256-g6KWX7APdqB0dNe7p6WGualxSj5fiw+jRq+0qfqTs4w=";
29 };
30
31 postPatch = ''
32 sed -i '/addopts =/d' pyproject.toml
33 substituteInPlace pyproject.toml \
34 --replace-fail 'version = "0.0.0"' 'version = "${version}"'
35 '';
36
37 build-system = [ poetry-core ];
38
39 dependencies = [
40 authlib
41 httpx
42 mashumaro
43 orjson
44 ];
45
46 nativeCheckInputs = [
47 pytest-asyncio
48 pytest-httpx
49 pytestCheckHook
50 respx
51 ];
52
53 pythonImportsCheck = [ "pydiscovergy" ];
54
55 meta = with lib; {
56 description = "Library for interacting with the Discovergy API";
57 homepage = "https://github.com/jpbede/pydiscovergy";
58 changelog = "https://github.com/jpbede/pydiscovergy/releases/tag/v${version}";
59 license = licenses.mit;
60 maintainers = with maintainers; [ fab ];
61 };
62}