summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/python-binance/default.nix
blob: 2824ec2ba090f3a9a29d2f23240952b1383c9dfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
{
  lib,
  aiohttp,
  aioresponses,
  buildPythonPackage,
  dateparser,
  fetchFromGitHub,
  pycryptodome,
  pytest-asyncio,
  pytestCheckHook,
  pythonOlder,
  requests-mock,
  requests,
  six,
  ujson,
  setuptools,
  websockets,
}:

buildPythonPackage rec {
  pname = "python-binance";
  version = "1.0.29";
  pyproject = true;

  disabled = pythonOlder "3.11";

  src = fetchFromGitHub {
    owner = "sammchardy";
    repo = "python-binance";
    tag = "v${version}";
    hash = "sha256-Hqd6228k2j1BPzBBCRpdEp0rAGxZt00XPnzpCPlwIfg=";
  };

  build-system = [ setuptools ];

  dependencies = [
    aiohttp
    dateparser
    requests
    pycryptodome
    six
    ujson
    websockets
  ];

  nativeCheckInputs = [
    aioresponses
    pytest-asyncio
    pytestCheckHook
    requests-mock
  ];

  disabledTestPaths = [
    # Tests require network access
    "tests/test_api_request.py"
    "tests/test_async_client.py"
    "tests/test_async_client_futures.py"
    "tests/test_async_client_margin.py"
    "tests/test_async_client_options.py"
    "tests/test_async_client_portfolio.py"
    "tests/test_async_client_ws_api.py"
    "tests/test_async_client_ws_futures_requests.py"
    "tests/test_client.py"
    "tests/test_client_futures.py"
    "tests/test_client_gift_card.py"
    "tests/test_client_margin.py"
    "tests/test_client_options.py"
    "tests/test_client_portfolio.py"
    "tests/test_client_ws_api.py"
    "tests/test_client_ws_futures_requests.py"
    "tests/test_depth_cache.py"
    "tests/test_get_order_book.py"
    "tests/test_ping.py"
    "tests/test_reconnecting_websocket.py"
    "tests/test_socket_manager.py"
    "tests/test_streams.py"
    "tests/test_threaded_socket_manager.py"
    "tests/test_threaded_stream.py"
    "tests/test_ws_api.py"
  ];

  pythonImportsCheck = [ "binance" ];

  meta = {
    description = "Binance Exchange API python implementation for automated trading";
    homepage = "https://github.com/sammchardy/python-binance";
    license = lib.licenses.mit;
  };
}