1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5
6# build
7, setuptools-scm
8
9# propagates
10, azure-storage-blob
11, boto3
12, requests
13
14# tests
15, responses
16, unittestCheckHook
17}:
18buildPythonPackage rec {
19 pname = "sapi-python-client";
20 version = "0.5.0";
21 format = "setuptools";
22
23 disabled = pythonOlder "3.7";
24
25 src = fetchFromGitHub {
26 owner = "keboola";
27 repo = pname;
28 rev = "refs/tags/${version}";
29 hash = "sha256-79v9quhzeNRXcm6Z7BhD76lTZtw+Z0T1yK3zhrdreXw=";
30 };
31
32 SETUPTOOLS_SCM_PRETEND_VERSION = version;
33
34 nativeBuildInputs = [
35 setuptools-scm
36 ];
37
38 propagatedBuildInputs = [
39 azure-storage-blob
40 boto3
41 requests
42 ];
43
44 # Requires API token and an active Keboola bucket
45 # ValueError: Root URL is required.
46 doCheck = false;
47
48 nativeCheckInputs = [
49 unittestCheckHook
50 responses
51 ];
52
53 pythonImportsCheck = [
54 "kbcstorage"
55 "kbcstorage.buckets"
56 "kbcstorage.client"
57 "kbcstorage.tables"
58 ];
59
60 meta = with lib; {
61 description = "Keboola Connection Storage API client";
62 homepage = "https://github.com/keboola/sapi-python-client";
63 changelog = "https://github.com/keboola/sapi-python-client/releases/tag/${version}";
64 license = licenses.mit;
65 maintainers = with maintainers; [ mrmebelman ];
66 };
67}