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