1{
2 lib,
3 authlib,
4 buildPythonPackage,
5 fetchFromGitHub,
6 httpx,
7 mashumaro,
8 orjson,
9 pytest-asyncio,
10 pytest-cov-stub,
11 pytest-httpx,
12 poetry-core,
13 pytestCheckHook,
14 pythonOlder,
15 respx,
16}:
17
18buildPythonPackage rec {
19 pname = "pydiscovergy";
20 version = "3.1.0";
21 pyproject = true;
22
23 disabled = pythonOlder "3.11";
24
25 src = fetchFromGitHub {
26 owner = "jpbede";
27 repo = "pydiscovergy";
28 tag = "v${version}";
29 hash = "sha256-OrMuMGN1zB4q6t4fWyZeQ9WRmNZHFyq+wIRq1kG2N30=";
30 };
31
32 postPatch = ''
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-cov-stub
49 pytest-httpx
50 pytestCheckHook
51 respx
52 ];
53
54 pythonImportsCheck = [ "pydiscovergy" ];
55
56 meta = with lib; {
57 description = "Library for interacting with the Discovergy API";
58 homepage = "https://github.com/jpbede/pydiscovergy";
59 changelog = "https://github.com/jpbede/pydiscovergy/releases/tag/v${version}";
60 license = licenses.mit;
61 maintainers = with maintainers; [ fab ];
62 };
63}