summaryrefslogtreecommitdiffstats
path: root/pkgs/development/python-modules/azure-mgmt-common/default.nix
blob: 7fa9fbf4249abffc399475dee8845cb373da144c (plain)
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
{
  lib,
  buildPythonPackage,
  fetchPypi,
  python,
  azure-common,
  azure-mgmt-nspkg,
  requests,
  msrestazure,
  setuptools,
  isPy3k,
}:

buildPythonPackage (finalAttrs: {
  version = "0.20.0";
  pyproject = true;

  __structuredAttrs = true;
  pname = "azure-mgmt-common";

  src = fetchPypi {
    inherit (finalAttrs) pname version;
    extension = "zip";
    hash = "sha256-xjgSwT2fNmFcB/h0vGArczu1FvHtYqtzGJuPcca/v+Y=";
  };

  build-system = [ setuptools ];

  dependencies = [
    azure-common
    azure-mgmt-nspkg
    requests
    msrestazure
  ];

  postInstall = lib.optionalString (!isPy3k) ''
    echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/${python.sitePackages}"/azure/mgmt/__init__.py
    echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/${python.sitePackages}"/azure/__init__.py
  '';

  doCheck = false;

  pythonImportsCheck = [ "azure.mgmt.common" ];

  meta = {
    description = "This is the Microsoft Azure Resource Management common code";
    homepage = "https://github.com/Azure/azure-sdk-for-python";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [
      olcai
      maxwilson
    ];
  };
})