summary refs log tree commit diff
path: root/pkgs/development/python-modules/azure-cli-core/default.nix
blob: a4d05b4c11eea1b518aa858068284177cbc9f01d (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
{ stdenv
, lib
, python
, buildPythonPackage
, fetchPypi
, adal
, antlr4-python3-runtime
, argcomplete
, azure-cli-telemetry
, colorama
, jmespath
, humanfriendly
, knack
, msrest
, msrestazure
, paramiko
, pygments
, pyjwt
, pyopenssl
, pyyaml
, requests
, six
, tabulate
, azure-mgmt-resource
, pyperclip
, psutil
, enum34
, futures
, antlr4-python2-runtime
, ndg-httpsclient
, isPy3k
}:

buildPythonPackage rec {
  pname = "azure-cli-core";
  version = "2.0.75";

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

  propagatedBuildInputs = [
    adal
    argcomplete
    azure-cli-telemetry
    colorama
    jmespath
    humanfriendly
    knack
    msrest
    msrestazure
    paramiko
    pygments
    pyjwt
    pyopenssl
    pyyaml
    requests
    six
    tabulate
    azure-mgmt-resource
    pyperclip
    psutil
  ]
  ++ lib.optionals isPy3k [ antlr4-python3-runtime ]
  ++ lib.optionals (!isPy3k) [ enum34 futures antlr4-python2-runtime ndg-httpsclient ];

  # Remove overly restrictive version contraints and obsolete namespace setup
  prePatch = ''
    substituteInPlace setup.py \
      --replace "wheel==0.30.0" "wheel" \
      --replace "azure-mgmt-resource==2.1.0" "azure-mgmt-resource"
    substituteInPlace setup.cfg \
      --replace "azure-namespace-package = azure-cli-nspkg" ""
  '';

  # Prevent these __init__'s from violating PEP420, only needed for python2
  postInstall = lib.optionalString isPy3k ''
    rm $out/${python.sitePackages}/azure/__init__.py \
       $out/${python.sitePackages}/azure/cli/__init__.py
  '';

  # Tests are not included in sdist package
  doCheck = false;

  meta = with lib; {
    homepage = https://github.com/Azure/azure-cli;
    description = "Next generation multi-platform command line experience for Azure";
    platforms = platforms.all;
    license = licenses.mit;
    maintainers = with maintainers; [ jonringer ];
  };
}