From 0c6717db1d973c5d0d66bba05a20f37352ecca73 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 15 May 2021 09:44:22 +0200 Subject: [PATCH 1/2] python3Packages.python-binance: 0.7.9 -> 1.0.10 --- .../python-modules/python-binance/default.nix | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/python-binance/default.nix b/pkgs/development/python-modules/python-binance/default.nix index a750f02505ac..de881459043a 100644 --- a/pkgs/development/python-modules/python-binance/default.nix +++ b/pkgs/development/python-modules/python-binance/default.nix @@ -1,20 +1,37 @@ { lib, buildPythonPackage, fetchPypi , pytest, requests-mock, tox -, autobahn, certifi, chardet, cryptography, dateparser, pyopenssl, requests, service-identity, twisted, ujson }: +, aiohttp +, dateparser +, requests +, six +, ujson +, websockets +}: buildPythonPackage rec { - version = "0.7.9"; + version = "1.0.10"; pname = "python-binance"; src = fetchPypi { inherit pname version; - sha256 = "476459d91f6cfe0a37ccac38911643ea6cca632499ad8682e0957a075f73d239"; + sha256 = "sha256-5U/xMJ0iPij3Y+6SKuKQHspSiktxJVrDQzHPoJCM4H8="; }; - doCheck = false; # Tries to test multiple interpreters with tox - checkInputs = [ pytest requests-mock tox ]; + propagatedBuildInputs = [ + aiohttp + dateparser + requests + six + ujson + websockets + ]; - propagatedBuildInputs = [ autobahn certifi chardet cryptography dateparser pyopenssl requests service-identity twisted ujson ]; + checkInputs = [ + pytest + requests-mock + ]; + + doCheck = false; # Tries to test multiple interpreters with tox meta = { description = "Binance Exchange API python implementation for automated trading"; From 2d2faf37554a15099356ed2a05a2bb60a564e289 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 15 May 2021 09:52:35 +0200 Subject: [PATCH 2/2] python3Packages.python-binance: enable tests --- .../python-modules/python-binance/default.nix | 37 +++++++++++++------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/python-binance/default.nix b/pkgs/development/python-modules/python-binance/default.nix index de881459043a..cd1e09557ecb 100644 --- a/pkgs/development/python-modules/python-binance/default.nix +++ b/pkgs/development/python-modules/python-binance/default.nix @@ -1,23 +1,30 @@ -{ lib, buildPythonPackage, fetchPypi -, pytest, requests-mock, tox +{ lib , aiohttp +, buildPythonPackage , dateparser +, fetchFromGitHub +, pytestCheckHook +, pythonOlder , requests +, requests-mock , six , ujson , websockets }: buildPythonPackage rec { - version = "1.0.10"; pname = "python-binance"; + version = "1.0.10"; + disabled = pythonOlder "3.6"; - src = fetchPypi { - inherit pname version; - sha256 = "sha256-5U/xMJ0iPij3Y+6SKuKQHspSiktxJVrDQzHPoJCM4H8="; + src = fetchFromGitHub { + owner = "sammchardy"; + repo = pname; + rev = "v${version}"; + sha256 = "09pq2blvky1ah4k8yc6zkp2g5nkn3awc52ad3lxvj6m33akfzxiv"; }; - propagatedBuildInputs = [ + propagatedBuildInputs = [ aiohttp dateparser requests @@ -27,16 +34,22 @@ buildPythonPackage rec { ]; checkInputs = [ - pytest + pytestCheckHook requests-mock ]; - doCheck = false; # Tries to test multiple interpreters with tox + disabledTestPaths = [ + # Tests require network access + "tests/test_api_request.py" + "tests/test_historical_klines.py" + ]; - meta = { + pythonImportsCheck = [ "binance" ]; + + meta = with lib; { description = "Binance Exchange API python implementation for automated trading"; homepage = "https://github.com/sammchardy/python-binance"; - license = lib.licenses.mit; - maintainers = [ lib.maintainers.bhipple ]; + license = licenses.mit; + maintainers = with maintainers; [ bhipple ]; }; }