about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pyu2f/default.nix
blob: 16aa7b0ec31ba4841f9cdec87e7eef2948a7750d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ stdenv, lib, fetchFromGitHub, buildPythonPackage,
  six, mock, pyfakefs, unittest2, pytest
}:

buildPythonPackage rec {
  pname = "pyu2f";
  version = "0.1.4";

  src = fetchFromGitHub {
    owner = "google";
    repo = pname;
    rev = version;
    sha256 = "0waxdydvxn05a8ab9j235mz72x7p4pwa59pnxyk1zzbwxnpxb3p9";
  };

  # Platform detection for linux fails
  postPatch = lib.optionalString stdenv.isLinux ''
    rm pyu2f/tests/hid/macos_test.py
  '';

  propagatedBuildInputs = [ six ];

  checkInputs = [ pytest six mock pyfakefs unittest2 ];

  checkPhase = ''
    pytest pyu2f/tests
  '';

  meta = with lib; {
    description = "U2F host library for interacting with a U2F device over USB";
    homepage = https://github.com/google/pyu2f/;
    license = licenses.asl20;
    maintainers = with maintainers; [ prusnak ];
  };
}