1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 setuptools,
7 pythonRelaxDepsHook,
8 requests,
9 cryptography,
10 pyjwt,
11 websockets,
12 backoff,
13 pytestCheckHook,
14 requests-mock,
15}:
16
17buildPythonPackage rec {
18 pname = "coinbase-advanced-py";
19 version = "1.8.2";
20 pyproject = true;
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchFromGitHub {
25 owner = "coinbase";
26 repo = "coinbase-advanced-py";
27 tag = "v${version}";
28 hash = "sha256-1XJ4QnFJVSbSCfkB16+UTARXqhlsy36Db3S6ju6nJUY=";
29 };
30
31 build-system = [
32 setuptools
33 ];
34
35 pythonRelaxDeps = [
36 "websockets"
37 ];
38
39 dependencies = [
40 requests
41 cryptography
42 pyjwt
43 websockets
44 backoff
45 ];
46
47 nativeCheckInputs = [
48 pytestCheckHook
49 requests-mock
50 ];
51
52 pythonImportsCheck = [
53 "coinbase"
54 "coinbase.rest"
55 "coinbase.websocket"
56 ];
57
58 disabledTestPaths = [
59 # WebSocket tests fail due to API changes in websockets >= 14.0
60 "tests/websocket/"
61 ];
62
63 meta = {
64 description = "Coinbase Advanced API Python SDK";
65 homepage = "https://github.com/coinbase/coinbase-advanced-py";
66 changelog = "https://github.com/coinbase/coinbase-advanced-py/releases/tag/v${version}";
67 license = lib.licenses.asl20;
68 maintainers = [ lib.maintainers.jamiemagee ];
69 };
70}