1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 requests,
7 keyring,
8 pytestCheckHook,
9 responses,
10}:
11
12buildPythonPackage rec {
13 pname = "upcloud-api";
14 version = "2.9.0";
15 pyproject = true;
16
17 src = fetchFromGitHub {
18 owner = "UpCloudLtd";
19 repo = "upcloud-python-api";
20 tag = "v${version}";
21 hash = "sha256-OnHKKSlj6JbqXL1YDkmR7d6ae8eVdXOPx6Los5qPDJE=";
22 };
23
24 build-system = [ setuptools ];
25
26 dependencies = [ requests ];
27
28 optional-dependencies = {
29 keyring = [ keyring ];
30 };
31
32 nativeCheckInputs = [
33 pytestCheckHook
34 responses
35 ]
36 ++ lib.flatten (builtins.attrValues optional-dependencies);
37
38 pythonImportsCheck = [ "upcloud_api" ];
39
40 meta = with lib; {
41 changelog = "https://github.com/UpCloudLtd/upcloud-python-api/blob/${src.tag}/CHANGELOG.md";
42 description = "UpCloud API Client";
43 homepage = "https://github.com/UpCloudLtd/upcloud-python-api";
44 license = licenses.mit;
45 maintainers = with maintainers; [ dotlambda ];
46 };
47}