Skip to content

Commit 0c4d750

Browse files
committed
azure-mgmt-*: re-init older versions for use with nixops
add pinned versions package-private azure-mgmt-compute 0.20.1 azure-mgmt-network 0.20.1 azure-mgmt-nspkg 1.0.0 azure-mgmt-resource 0.20.1 azure-mgmt-storage 0.20.0 #52550 NixOS/nixops#1065
1 parent fdfcc4c commit 0c4d750

6 files changed

Lines changed: 190 additions & 1 deletion

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{ pkgs
2+
, buildPythonPackage
3+
, fetchPypi
4+
, python
5+
, azure-mgmt-common
6+
}:
7+
8+
buildPythonPackage rec {
9+
version = "0.20.1";
10+
pname = "azure-mgmt-compute";
11+
12+
src = fetchPypi {
13+
inherit pname version;
14+
extension = "zip";
15+
sha256 = "97298fc7f133f1d50a974ed6299151eda494a574b0f7fdf8192a388015c2215a";
16+
};
17+
18+
preConfigure = ''
19+
# Patch to make this package work on requests >= 2.11.x
20+
# CAN BE REMOVED ON NEXT PACKAGE UPDATE
21+
sed -i 's|len(request_content)|str(len(request_content))|' azure/mgmt/compute/computemanagement.py
22+
'';
23+
24+
postInstall = ''
25+
echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/__init__.py
26+
echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/mgmt/__init__.py
27+
'';
28+
29+
propagatedBuildInputs = [ azure-mgmt-common ];
30+
31+
meta = with pkgs.lib; {
32+
description = "Microsoft Azure SDK for Python";
33+
homepage = "https://azure.microsoft.com/en-us/develop/python/";
34+
license = licenses.asl20;
35+
maintainers = with maintainers; [ olcai ];
36+
};
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{ pkgs
2+
, buildPythonPackage
3+
, fetchPypi
4+
, azure-mgmt-common
5+
, python
6+
}:
7+
8+
buildPythonPackage rec {
9+
version = "0.20.1";
10+
pname = "azure-mgmt-network";
11+
12+
src = fetchPypi {
13+
inherit pname version;
14+
extension = "zip";
15+
sha256 = "10vj22h6nxpw0qpvib5x2g6qs5j8z31142icvh4qk8k40fcrs9hx";
16+
};
17+
18+
preConfigure = ''
19+
# Patch to make this package work on requests >= 2.11.x
20+
# CAN BE REMOVED ON NEXT PACKAGE UPDATE
21+
sed -i 's|len(request_content)|str(len(request_content))|' azure/mgmt/network/networkresourceprovider.py
22+
'';
23+
24+
postInstall = ''
25+
echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/__init__.py
26+
echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/mgmt/__init__.py
27+
'';
28+
29+
propagatedBuildInputs = [ azure-mgmt-common ];
30+
31+
meta = with pkgs.lib; {
32+
description = "Microsoft Azure SDK for Python";
33+
homepage = "https://azure.microsoft.com/en-us/develop/python/";
34+
license = licenses.asl20;
35+
maintainers = with maintainers; [ olcai ];
36+
};
37+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{ pkgs
2+
, buildPythonPackage
3+
, fetchPypi
4+
, azure-nspkg
5+
}:
6+
7+
buildPythonPackage rec {
8+
version = "1.0.0";
9+
pname = "azure-mgmt-nspkg";
10+
11+
src = fetchPypi {
12+
inherit pname version;
13+
extension = "zip";
14+
sha256 = "1rq92fj3kvnqkk18596dybw0kvhgscvc6cd8hp1dhy3wrkqnhwmq";
15+
};
16+
17+
propagatedBuildInputs = [ azure-nspkg ];
18+
19+
meta = with pkgs.lib; {
20+
description = "Microsoft Azure SDK for Python";
21+
homepage = "https://azure.microsoft.com/en-us/develop/python/";
22+
license = licenses.asl20;
23+
maintainers = with maintainers; [ olcai ];
24+
};
25+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{ pkgs
2+
, buildPythonPackage
3+
, fetchPypi
4+
, python
5+
, azure-mgmt-common
6+
}:
7+
8+
9+
buildPythonPackage rec {
10+
version = "0.20.1";
11+
pname = "azure-mgmt-resource";
12+
13+
src = fetchPypi {
14+
inherit pname version;
15+
extension = "zip";
16+
sha256 = "0slh9qfm5nfacrdm3lid0sr8kwqzgxvrwf27laf9v38kylkfqvml";
17+
};
18+
19+
preConfigure = ''
20+
# Patch to make this package work on requests >= 2.11.x
21+
# CAN BE REMOVED ON NEXT PACKAGE UPDATE
22+
sed -i 's|len(request_content)|str(len(request_content))|' azure/mgmt/resource/resourcemanagement.py
23+
'';
24+
25+
postInstall = ''
26+
echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/__init__.py
27+
echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/mgmt/__init__.py
28+
'';
29+
30+
propagatedBuildInputs = [ azure-mgmt-common ];
31+
32+
meta = with pkgs.lib; {
33+
description = "Microsoft Azure SDK for Python";
34+
homepage = "https://azure.microsoft.com/en-us/develop/python/";
35+
license = licenses.asl20;
36+
maintainers = with maintainers; [ olcai ];
37+
};
38+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{ pkgs
2+
, buildPythonPackage
3+
, fetchPypi
4+
, python
5+
, azure-mgmt-common
6+
}:
7+
8+
buildPythonPackage rec {
9+
version = "0.20.0";
10+
pname = "azure-mgmt-storage";
11+
12+
src = fetchPypi {
13+
inherit pname version;
14+
extension = "zip";
15+
sha256 = "16iw7hqhq97vlzfwixarfnirc60l5mz951p57brpcwyylphl3yim";
16+
};
17+
18+
preConfigure = ''
19+
# Patch to make this package work on requests >= 2.11.x
20+
# CAN BE REMOVED ON NEXT PACKAGE UPDATE
21+
sed -i 's|len(request_content)|str(len(request_content))|' azure/mgmt/storage/storagemanagement.py
22+
'';
23+
24+
postInstall = ''
25+
echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/__init__.py
26+
echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/mgmt/__init__.py
27+
'';
28+
29+
propagatedBuildInputs = [ azure-mgmt-common ];
30+
31+
meta = with pkgs.lib; {
32+
description = "Microsoft Azure SDK for Python";
33+
homepage = "https://azure.microsoft.com/en-us/develop/python/";
34+
license = licenses.asl20;
35+
maintainers = with maintainers; [ olcai ];
36+
};
37+
}
Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
1-
{ callPackage, fetchurl }:
1+
{ callPackage, newScope, pkgs, fetchurl }:
22

33
callPackage ./generic.nix (rec {
44
version = "1.6.1";
55
src = fetchurl {
66
url = "http://nixos.org/releases/nixops/nixops-${version}/nixops-${version}.tar.bz2";
77
sha256 = "0lfx5fhyg3z6725ydsk0ibg5qqzp5s0x9nbdww02k8s307axiah3";
88
};
9+
# nixops is incompatible with the most recent versions of listed
10+
# azure-mgmt-* packages, therefore we are pinning them to
11+
# package-private versions, so that they don't get trampled by
12+
# updates.
13+
# see
14+
# https://github.com/NixOS/nixops/issues/1065
15+
python2Packages = pkgs.python2Packages.override {
16+
overrides = (self: super: let callPackage = newScope self; in {
17+
azure-mgmt-compute = callPackage ./azure-mgmt-compute { };
18+
azure-mgmt-network = callPackage ./azure-mgmt-network { };
19+
azure-mgmt-nspkg = callPackage ./azure-mgmt-nspkg { };
20+
azure-mgmt-resource = callPackage ./azure-mgmt-resource { };
21+
azure-mgmt-storage = callPackage ./azure-mgmt-storage { };
22+
});
23+
};
924
})

0 commit comments

Comments
 (0)