Skip to content

Commit

Permalink
python312Packages.hid: disable tests, use pep517 builder
Browse files Browse the repository at this point in the history
mweinelt committed May 12, 2024
1 parent 7073698 commit 9175a5c
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions pkgs/development/python-modules/hid/default.nix
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
{ lib
, buildPythonPackage
, fetchPypi
, setuptools
, hidapi
, nose
}:

buildPythonPackage rec {
pname = "hid";
version = "1.0.6";
format = "setuptools";
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-SNdk166XRroSO5bb9FeJPKgCaLd5HEsdLgUTEO64OGA=";
};

propagatedBuildInputs = [ hidapi ];

nativeCheckInputs = [ nose ];

postPatch = ''
hidapi=${hidapi}/lib/
test -d $hidapi || { echo "ERROR: $hidapi doesn't exist, please update/fix this build expression."; exit 1; }
sed -i -e "s|libhidapi|$hidapi/libhidapi|" hid/__init__.py
hidapi=${hidapi}/lib/
test -d $hidapi || { echo "ERROR: $hidapi doesn't exist, please update/fix this build expression."; exit 1; }
sed -i -e "s|libhidapi|$hidapi/libhidapi|" hid/__init__.py
'';

build-system = [
setuptools
];

dependencies = [
hidapi
];

doCheck = false; # no tests

pythonImportsCheck = [
"hid"
];

meta = with lib; {
description = "hidapi bindings in ctypes";
homepage = "https://github.com/apmorton/pyhidapi";

0 comments on commit 9175a5c

Please sign in to comment.