Skip to content

Commit

Permalink
Make azure-mgmt-... work with requests 2.11.x. We should update the a…
Browse files Browse the repository at this point in the history
…zure python packages, however, that is a much bigger effort. This is needed to make sure nixops keeps working with Azure.

(cherry picked from commit 4eb92c5)
  • Loading branch information
rbvermaa committed Feb 12, 2017
1 parent c07f158 commit a74d159
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkgs/top-level/python-packages.nix
Expand Up @@ -1706,6 +1706,11 @@ in {
url = mirror://pypi/a/azure-mgmt-compute/azure-mgmt-compute-0.20.0.zip;
sha256 = "12hr5vxdg2sk2fzr608a37f4i8nbchca7dgdmly2w5fc7x88jx2v";
};
preConfigure = ''
# Patch to make this package work on requests >= 2.11.x
# CAN BE REMOVED ON NEXT PACKAGE UPDATE
sed -i 's|len(request_content)|str(len(request_content))|' azure/mgmt/compute/computemanagement.py
'';
postInstall = ''
echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/__init__.py
echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/mgmt/__init__.py
Expand All @@ -1726,6 +1731,11 @@ in {
url = mirror://pypi/a/azure-mgmt-network/azure-mgmt-network-0.20.1.zip;
sha256 = "10vj22h6nxpw0qpvib5x2g6qs5j8z31142icvh4qk8k40fcrs9hx";
};
preConfigure = ''
# Patch to make this package work on requests >= 2.11.x
# CAN BE REMOVED ON NEXT PACKAGE UPDATE
sed -i 's|len(request_content)|str(len(request_content))|' azure/mgmt/network/networkresourceprovider.py
'';
postInstall = ''
echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/__init__.py
echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/mgmt/__init__.py
Expand Down Expand Up @@ -1787,6 +1797,11 @@ in {
url = mirror://pypi/a/azure-mgmt-storage/azure-mgmt-storage-0.20.0.zip;
sha256 = "16iw7hqhq97vlzfwixarfnirc60l5mz951p57brpcwyylphl3yim";
};
preConfigure = ''
# Patch to make this package work on requests >= 2.11.x
# CAN BE REMOVED ON NEXT PACKAGE UPDATE
sed -i 's|len(request_content)|str(len(request_content))|' azure/mgmt/storage/storagemanagement.py
'';
postInstall = ''
echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/__init__.py
echo "__import__('pkg_resources').declare_namespace(__name__)" >> "$out/lib/${python.libPrefix}"/site-packages/azure/mgmt/__init__.py
Expand Down

0 comments on commit a74d159

Please sign in to comment.