From 549ad67ac5f85586121d77d52ede742c608385cc Mon Sep 17 00:00:00 2001 From: Kirill Elagin Date: Fri, 20 Feb 2026 20:03:28 +0100 Subject: [PATCH] python3Packages.ibind: init at 0.1.22 --- .../python-modules/ibind/default.nix | 81 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 83 insertions(+) create mode 100644 pkgs/development/python-modules/ibind/default.nix diff --git a/pkgs/development/python-modules/ibind/default.nix b/pkgs/development/python-modules/ibind/default.nix new file mode 100644 index 000000000000..2917be3958ff --- /dev/null +++ b/pkgs/development/python-modules/ibind/default.nix @@ -0,0 +1,81 @@ +{ + lib, + stdenv, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies + pycryptodome, + requests, + urllib3, + websocket-client, + + # tests + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "ibind"; + version = "0.1.22"; + pyproject = true; + + strictDeps = true; + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "Voyz"; + repo = "ibind"; + tag = "v${finalAttrs.version}"; + hash = "sha256-hFjxkAEbhbcwseI7XwrEBtq5kzGj6XRBw3mqcxar9r0="; + }; + + # Otherwise, fails with: + # __main__.py: error: unrecognized arguments: unpacked/ibind-0.0.2 + postUnpack = '' + rm -r "$sourceRoot/dist" + ''; + + # ModuleNotFoundError: No module named 'test_utils' + # TODO: The fix is already merged upstream: remove when updating to the next release + postPatch = '' + substituteInPlace "pytest.ini" \ + --replace-fail '[tool:pytest]' '[pytest]' + ''; + + build-system = [ + setuptools + ]; + + pythonRelaxDeps = [ + "requests" + "websocket-client" + ]; + dependencies = [ + pycryptodome + requests + urllib3 + websocket-client + ]; + + pythonImportsCheck = [ "ibind" ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [ + # AssertionError: 0.2564859390258789 != 0.1 within 0.02 delta (0.1564859390258789 difference) + "test_wait_until_timeout" + ]; + + meta = { + description = "REST and WebSocket client library for Interactive Brokers Client Portal Web API"; + homepage = "https://github.com/Voyz/ibind"; + changelog = "https://github.com/Voyz/ibind/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 05a2e2645ad0..b5873e2d0343 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7350,6 +7350,8 @@ self: super: with self; { ibeacon-ble = callPackage ../development/python-modules/ibeacon-ble { }; + ibind = callPackage ../development/python-modules/ibind { }; + ibis = callPackage ../development/python-modules/ibis { }; ibis-framework = callPackage ../development/python-modules/ibis-framework { };