summary refs log tree commit diff
path: root/pkgs/development/python-modules/aws-adfs/default.nix
blob: 461ce9d90d9d67391c4ae307af907771f6f5b672 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{ lib
, botocore
, buildPythonPackage
, click
, configparser
, fetchPypi
, fido2
, glibcLocales
, isPy27
, lxml
, mock
, pyopenssl
, pytestCheckHook
, requests
, requests-kerberos
}:

buildPythonPackage rec {
  pname = "aws-adfs";
  version = "1.24.5";
  disabled = isPy27;

  src = fetchPypi {
    inherit pname version;
    sha256 = "6a78bd31477ea9988166215ae86abcbfe1413bee20373ecdf0dd170b7290db55";
  };

  propagatedBuildInputs = [
    botocore
    click
    configparser
    fido2
    lxml
    pyopenssl
    requests
    requests-kerberos
  ];

  checkInputs = [
    glibcLocales
    mock
    pytestCheckHook
  ];

  # Relax version constraint
  postPatch = ''
    substituteInPlace setup.py \
      --replace 'coverage < 4' 'coverage' \
      --replace 'fido2>=0.8.1,<0.9.0' 'fido2>=0.8.1,<1.0.0'
  '';

  # Test suite writes files to $HOME/.aws/, or /homeless-shelter if unset
  HOME = ".";

  # Required for python3 tests, along with glibcLocales
  LC_ALL = "en_US.UTF-8";

  pythonImportsCheck = [ "aws_adfs" ];

  meta = with lib; {
    description = "Command line tool to ease aws cli authentication against ADFS";
    homepage = "https://github.com/venth/aws-adfs";
    license = licenses.psfl;
    maintainers = [ maintainers.bhipple ];
  };
}