1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 oath,
6 pycryptodome,
7 requests,
8 pytestCheckHook,
9}:
10
11buildPythonPackage rec {
12 pname = "python-vipaccess";
13 version = "0.14.2";
14 format = "setuptools";
15
16 src = fetchPypi {
17 inherit pname version;
18 hash = "sha256-TFSX8iL6ChaL3Fj+0VCHzafF/314Y/i0aTI809Qk5hU=";
19 };
20
21 propagatedBuildInputs = [
22 oath
23 pycryptodome
24 requests
25 ];
26
27 # unittest based tests using yield, imcompatible with pytest
28 # test_check_token_detects_valid_hotp_token,
29 # test_check_token_detects_valid_totp_token and
30 postPatch = ''
31 substituteInPlace tests/test_utils.py \
32 --replace-fail "test_check_TOTP_token_models" "check_TOTP_token_models" \
33 --replace-fail "test_check_HOTP_token_models" "check_HOTP_token_models"
34 '';
35
36 nativeCheckInputs = [ pytestCheckHook ];
37
38 preCheck = ''
39 rm -rf vipaccess
40 '';
41
42 disabledTests = [
43 # cannot read vipaccess/version.py since we moved it away
44 "test_check_token_detects_invalid_token"
45 ];
46
47 meta = {
48 description = "Free software implementation of Symantec's VIP Access application and protocol";
49 mainProgram = "vipaccess";
50 homepage = "https://github.com/dlenski/python-vipaccess";
51 license = lib.licenses.asl20;
52 maintainers = with lib.maintainers; [ aw ];
53 };
54}