From 495afbe66dedc96b3857ee163087d4d08fa7a568 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 3 Mar 2023 19:37:04 +0100 Subject: [PATCH] python310Packages.btchip-python: Fix extra_requires version specifier And reformat, expose optional-dependencies, set explicit format. --- .../python-modules/btchip-python/default.nix | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/btchip-python/default.nix b/pkgs/development/python-modules/btchip-python/default.nix index e34b58907ea8..901a3b2cc954 100644 --- a/pkgs/development/python-modules/btchip-python/default.nix +++ b/pkgs/development/python-modules/btchip-python/default.nix @@ -1,20 +1,42 @@ -{ lib, buildPythonPackage, fetchPypi, hidapi, pyscard, ecdsa }: +{ lib +, buildPythonPackage +, fetchPypi +, hidapi +, pyscard +, ecdsa + }: buildPythonPackage rec { pname = "btchip-python"; version = "0.1.32"; + format = "setuptools"; src = fetchPypi { inherit pname version; - sha256 = "34f5e0c161c08f65dc0d070ba2ff4c315ed21c4b7e0faa32a46862d0dc1b8f55"; + hash = "sha256-NPXgwWHAj2XcDQcLov9MMV7SHEt+D6oypGhi0Nwbj1U="; }; - propagatedBuildInputs = [ hidapi pyscard ecdsa ]; + postPatch = '' + # fix extra_requires validation + substituteInPlace setup.py \ + --replace "python-pyscard>=1.6.12-4build1" "python-pyscard>=1.6.12" + ''; + + propagatedBuildInputs = [ + hidapi + ecdsa + ]; + + passthru.optional-dependencies.smartcard = [ + pyscard + ]; # tests requires hardware doCheck = false; - pythonImportsCheck = [ "btchip.btchip" ]; + pythonImportsCheck = [ + "btchip.btchip" + ]; meta = with lib; { description = "Python communication library for Ledger Hardware Wallet products";