biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / development / python-modules / pyu2f / default.nix
blobfd63b2bf10ed08b131b090be3da8da96bb880ff4
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   six,
6   mock,
7   pyfakefs,
8   pytest-forked,
9   pytestCheckHook,
12 buildPythonPackage rec {
13   pname = "pyu2f";
14   version = "0.1.5a";
15   format = "setuptools";
17   src = fetchFromGitHub {
18     owner = "google";
19     repo = pname;
20     rev = "refs/tags/${version}";
21     sha256 = "0mx7bn1p3n0fxyxa82wg3c719hby7vqkxv57fhf7zvhlg2zfnr0v";
22   };
24   propagatedBuildInputs = [ six ];
26   postPatch = ''
27     for path in \
28       customauthenticator_test.py \
29       hardware_test.py \
30       hidtransport_test.py \
31       localauthenticator_test.py \
32       model_test.py \
33       u2f_test.py \
34       util_test.py \
35       hid/macos_test.py; \
36     do
37       # https://docs.python.org/3/whatsnew/3.12.html#id3
38       substituteInPlace pyu2f/tests/$path \
39         --replace "assertEquals" "assertEqual" \
40         --replace "assertRaisesRegexp" "assertRaisesRegex"
41     done
42   '';
44   nativeCheckInputs = [
45     mock
46     pyfakefs
47     pytest-forked
48     pytestCheckHook
49   ];
51   disabledTestPaths = [
52     # API breakage with pyfakefs>=5.0
53     "pyu2f/tests/hid/linux_test.py"
54   ];
56   meta = with lib; {
57     description = "U2F host library for interacting with a U2F device over USB";
58     homepage = "https://github.com/google/pyu2f";
59     license = licenses.asl20;
60     maintainers = with maintainers; [ prusnak ];
61   };