pythonPackages.azure-mgmt-resource: refactor move to python-modules

This commit is contained in:
Chris Ostrouchov 2018-10-10 12:30:56 -04:00 committed by Frederik Rietdijk
parent 071053bcb0
commit 110afaae5c
2 changed files with 40 additions and 50 deletions

View File

@ -0,0 +1,38 @@
{ pkgs
, buildPythonPackage
, fetchPypi
, python
, azure-mgmt-common
}:
buildPythonPackage rec {
version = "0.20.1";
pname = "azure-mgmt-resource";
src = fetchPypi {
inherit pname version;
extension = "zip";
sha256 = "0slh9qfm5nfacrdm3lid0sr8kwqzgxvrwf27laf9v38kylkfqvml";
};
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/resource/resourcemanagement.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
'';
propagatedBuildInputs = [ azure-mgmt-common ];
meta = with pkgs.lib; {
description = "Microsoft Azure SDK for Python";
homepage = "https://azure.microsoft.com/en-us/develop/python/";
license = licenses.asl20;
maintainers = with maintainers; [ olcai ];
};
}

View File

@ -230,6 +230,8 @@ in {
azure-mgmt-nspkg = callPackage ../development/python-modules/azure-mgmt-nspkg { };
azure-mgmt-resource = callPackage ../development/python-modules/azure-mgmt-resource { };
azure-mgmt-storage = callPackage ../development/python-modules/azure-mgmt-storage { };
backports_csv = callPackage ../development/python-modules/backports_csv {};
@ -783,56 +785,6 @@ in {
noise = callPackage ../development/python-modules/noise {};
azure-mgmt-resource = buildPythonPackage rec {
version = "0.20.1";
name = "azure-mgmt-resource-${version}";
src = pkgs.fetchurl {
url = mirror://pypi/a/azure-mgmt-resource/azure-mgmt-resource-0.20.1.zip;
sha256 = "0slh9qfm5nfacrdm3lid0sr8kwqzgxvrwf27laf9v38kylkfqvml";
};
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/resource/resourcemanagement.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
'';
propagatedBuildInputs = with self; [ azure-mgmt-common ];
meta = {
description = "Microsoft Azure SDK for Python";
homepage = "https://azure.microsoft.com/en-us/develop/python/";
license = licenses.asl20;
maintainers = with maintainers; [ olcai ];
};
};
azure-mgmt-storage = buildPythonPackage rec {
version = "0.20.0";
name = "azure-mgmt-storage-${version}";
src = pkgs.fetchurl {
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
'';
propagatedBuildInputs = with self; [ azure-mgmt-common ];
meta = {
description = "Microsoft Azure SDK for Python";
homepage = "https://azure.microsoft.com/en-us/develop/python/";
license = licenses.asl20;
maintainers = with maintainers; [ olcai ];
};
};
azure-storage = buildPythonPackage rec {
version = "0.20.3";
name = "azure-storage-${version}";