1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 hatchling,
6 requests,
7 six,
8 uritemplate,
9 pytestCheckHook,
10 pytest-mock,
11 aiohttp,
12 marshmallow,
13 pydantic,
14 pytest-asyncio,
15 pytest-twisted,
16 twisted,
17 pythonOlder,
18}:
19
20buildPythonPackage rec {
21 pname = "uplink";
22 version = "0.10.0";
23 pyproject = true;
24
25 src = fetchFromGitHub {
26 owner = "prkumar";
27 repo = "uplink";
28 tag = "v${version}";
29 hash = "sha256-gI7oHLyC6a5s3jhgG5jj+7q495seMSyUV4XVAp1URTA=";
30 };
31
32 build-system = [ hatchling ];
33
34 dependencies = [
35 requests
36 six
37 uritemplate
38 ];
39
40 optional-dependencies = {
41 aiohttp = [ aiohttp ];
42 marshmallow = [ marshmallow ];
43 pydantic = [ pydantic ];
44 twisted = [ twisted ];
45 };
46
47 nativeCheckInputs = [
48 pytestCheckHook
49 pytest-mock
50 pytest-asyncio
51 pytest-twisted
52 ]
53 ++ lib.flatten (lib.attrValues optional-dependencies);
54
55 pythonImportsCheck = [ "uplink" ];
56
57 meta = {
58 description = "Declarative HTTP client for Python";
59 homepage = "https://github.com/prkumar/uplink";
60 changelog = "https://github.com/prkumar/uplink/releases/tag/${src.tag}";
61 license = lib.licenses.mit;
62 maintainers = [ lib.maintainers.jamiemagee ];
63 };
64}