1{ stdenv
2, lib
3, buildPythonPackage
4, fetchPypi
5, isPy3k
6, python
7, applicationinsights
8, portalocker
9}:
10
11buildPythonPackage rec {
12 pname = "azure-cli-telemetry";
13 version = "1.0.3";
14
15 src = fetchPypi {
16 inherit pname version;
17 sha256 = "0sf27pcz653h0cnxsg47nndilhqlw9fl019aqbnji2vn967r9rnl";
18 };
19
20 propagatedBuildInputs = [
21 applicationinsights
22 portalocker
23 ];
24
25 # tests are not published to pypi
26 doCheck = false;
27
28 # Remove overly restrictive version contraints and obsolete namespace setup
29 prePatch = ''
30 substituteInPlace setup.py \
31 --replace "applicationinsights>=0.11.1,<0.11.8" "applicationinsights" \
32 --replace "portalocker==1.2.1" "portalocker"
33 substituteInPlace setup.cfg \
34 --replace "azure-namespace-package = azure-cli-nspkg" ""
35 '';
36
37 # Prevent these __init__'s from violating PEP420, only needed for python2
38 postInstall = lib.optionalString isPy3k ''
39 rm $out/${python.sitePackages}/azure/__init__.py \
40 $out/${python.sitePackages}/azure/cli/__init__.py
41 '';
42
43 meta = with lib; {
44 homepage = https://github.com/Azure/azure-cli;
45 description = "Next generation multi-platform command line experience for Azure";
46 platforms = platforms.all;
47 license = licenses.mit;
48 maintainers = with maintainers; [ jonringer ];
49 };
50}