nixpkgs/pkgs/development/python-modules/pyu2f/default.nix
Ihar Hrachyshka 567e8dfd8e
treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

62 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
six,
mock,
pyfakefs,
pytest-forked,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "pyu2f";
version = "0.1.5a";
format = "setuptools";
src = fetchFromGitHub {
owner = "google";
repo = "pyu2f";
tag = version;
sha256 = "0mx7bn1p3n0fxyxa82wg3c719hby7vqkxv57fhf7zvhlg2zfnr0v";
};
propagatedBuildInputs = [ six ];
postPatch = ''
for path in \
customauthenticator_test.py \
hardware_test.py \
hidtransport_test.py \
localauthenticator_test.py \
model_test.py \
u2f_test.py \
util_test.py \
hid/macos_test.py; \
do
# https://docs.python.org/3/whatsnew/3.12.html#id3
substituteInPlace pyu2f/tests/$path \
--replace "assertEquals" "assertEqual" \
--replace "assertRaisesRegexp" "assertRaisesRegex"
done
'';
nativeCheckInputs = [
mock
pyfakefs
pytest-forked
pytestCheckHook
];
disabledTestPaths = [
# API breakage with pyfakefs>=5.0
"pyu2f/tests/hid/linux_test.py"
];
meta = {
description = "U2F host library for interacting with a U2F device over USB";
homepage = "https://github.com/google/pyu2f";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ prusnak ];
};
}