pythonPackages.azure*: use pythonNamespaces

This commit is contained in:
Jonathan Ringer 2020-03-17 15:43:56 -07:00 committed by Jon
parent 9c8565f731
commit cf0f90b85e
25 changed files with 35 additions and 100 deletions

View File

@ -17,9 +17,7 @@ buildPythonPackage rec {
propagatedBuildInputs = [ six requests ]; propagatedBuildInputs = [ six requests ];
postInstall = '' pythonNamespaces = [ "azure" ];
rm $out/${python.sitePackages}/azure/__init__.py
'';
# requires an active Azure Cosmos service # requires an active Azure Cosmos service
doCheck = false; doCheck = false;

View File

@ -26,6 +26,8 @@ buildPythonPackage rec {
cryptography cryptography
]; ];
pythonNamespaces = [ "azure.keyvault" ];
# requires relative paths to utilities in the mono-repo # requires relative paths to utilities in the mono-repo
doCheck = false; doCheck = false;
checkInputs = [ aiohttp pytestCheckHook ]; checkInputs = [ aiohttp pytestCheckHook ];

View File

@ -21,6 +21,8 @@ buildPythonPackage rec {
msrest msrest
]; ];
pythonNamespaces = [ "azure.keyvault" ];
# requires checkout from mono-repo # requires checkout from mono-repo
doCheck = false; doCheck = false;

View File

@ -22,6 +22,8 @@ buildPythonPackage rec {
# this is just a meta package, which contains keys and secrets # this is just a meta package, which contains keys and secrets
doCheck = false; doCheck = false;
pythonNamespaces = [ "azure" ];
pythonImportsCheck = [ pythonImportsCheck = [
"azure.keyvault.keys" "azure.keyvault.keys"
"azure.keyvault.secrets" "azure.keyvault.secrets"

View File

@ -22,9 +22,7 @@ buildPythonPackage rec {
azure-common azure-common
]; ];
postInstall = lib.optionalString isPy3k '' pythonNamespaces = [ "azure" ];
rm -rf $out/${python.sitePackages}/azure/__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -27,9 +27,7 @@ buildPythonPackage rec {
azure-mgmt-nspkg azure-mgmt-nspkg
]; ];
postInstall = lib.optionalString isPy3k '' pythonNamespaces = [ "azure.mgmt" ];
rm -f $out/${python.sitePackages}/azure/{,mgmt/}__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -24,10 +24,7 @@ buildPythonPackage rec {
azure-mgmt-nspkg azure-mgmt-nspkg
]; ];
postInstall = lib.optionalString isPy3k '' pythonNamespaces = [ "azure.mgmt" ];
rm $out/${python.sitePackages}/azure/__init__.py
rm $out/${python.sitePackages}/azure/mgmt/__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -30,10 +30,7 @@ buildPythonPackage rec {
--replace "azure-namespace-package = azure-mgmt-nspkg" "" --replace "azure-namespace-package = azure-mgmt-nspkg" ""
''; '';
postInstall = lib.optionalString isPy3k '' pythonNamespaces = [ "azure.mgmt" ];
rm $out/${python.sitePackages}/azure/__init__.py
rm $out/${python.sitePackages}/azure/mgmt/__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -16,15 +16,12 @@ buildPythonPackage rec {
sha256 = "1s3bx6knxw5dxycp43yimvgrh0i19drzd09asglcwz2x5mr3bpyg"; sha256 = "1s3bx6knxw5dxycp43yimvgrh0i19drzd09asglcwz2x5mr3bpyg";
}; };
postInstall = if isPy3k then "" else ''
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 = [ propagatedBuildInputs = [
azure-mgmt-common azure-mgmt-common
]; ];
pythonNamespaces = [ "azure.mgmt" ];
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -24,11 +24,7 @@ buildPythonPackage rec {
azure-mgmt-nspkg azure-mgmt-nspkg
]; ];
# still needed when overriding to previous versions pythonNamespaces = [ "azure.mgmt" ];
# E.g. azure-cli
postInstall = lib.optionalString isPy3k ''
rm -f $out/${python.sitePackages}/azure/{,mgmt/}__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -24,11 +24,7 @@ buildPythonPackage rec {
azure-mgmt-datalake-nspkg azure-mgmt-datalake-nspkg
]; ];
postInstall = lib.optionalString isPy3k '' pythonNamespaces = [ "azure.mgmt.datalake" ];
rm $out/${python.sitePackages}/azure/__init__.py
rm $out/${python.sitePackages}/azure/mgmt/__init__.py
rm $out/${python.sitePackages}/azure/mgmt/datalake/__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -3,6 +3,7 @@
, fetchPypi , fetchPypi
, python , python
, isPy3k , isPy3k
, pythonNamespacesHook
, msrestazure , msrestazure
, azure-common , azure-common
, azure-mgmt-datalake-nspkg , azure-mgmt-datalake-nspkg
@ -24,11 +25,7 @@ buildPythonPackage rec {
azure-mgmt-datalake-nspkg azure-mgmt-datalake-nspkg
]; ];
postInstall = lib.optionalString isPy3k '' pythonNamespaces = [ "azure.mgmt.datalake" ];
rm $out/${python.sitePackages}/azure/__init__.py
rm $out/${python.sitePackages}/azure/mgmt/__init__.py
rm $out/${python.sitePackages}/azure/mgmt/datalake/__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -27,11 +27,7 @@ buildPythonPackage rec {
azure-mgmt-nspkg azure-mgmt-nspkg
]; ];
# still needed when overriding to previous versions pythonNamespaces = [ "azure.mgmt" ];
# E.g. azure-cli
postInstall = lib.optionalString isPy3k ''
rm -f $out/${python.sitePackages}/azure/{,mgmt/}__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -27,11 +27,7 @@ buildPythonPackage rec {
azure-mgmt-nspkg azure-mgmt-nspkg
]; ];
# still needed when overriding to previous versions pythonNamespaces = [ "azure.mgmt" ];
# E.g. azure-cli
postInstall = lib.optionalString isPy3k ''
rm -f $out/${python.sitePackages}/azure/{,mgmt/}__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -27,10 +27,7 @@ buildPythonPackage rec {
]; ];
# this is still needed for when the version is overrided # this is still needed for when the version is overrided
# to previous versions. E.g azure-cli pythonNamespaces = [ "azure.mgmt" ];
postInstall = lib.optionalString isPy3k ''
rm -f $out/${python.sitePackages}/azure/{,mgmt/}__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -26,10 +26,7 @@ buildPythonPackage rec {
azure-mgmt-nspkg azure-mgmt-nspkg
]; ];
postInstall = lib.optionalString isPy3k '' pythonNamespaces = [ "azure.mgmt" ];
rm $out/${python.sitePackages}/azure/__init__.py
rm $out/${python.sitePackages}/azure/mgmt/__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -26,11 +26,7 @@ buildPythonPackage rec {
azure-mgmt-nspkg azure-mgmt-nspkg
]; ];
# this is still need when overriding to prevoius versions pythonNamespaces = [ "azure.mgmt" ];
# E.g. azure-cli
postInstall = lib.optionalString isPy3k ''
rm -f $out/${python.sitePackages}/azure/{,mgmt/}__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -26,10 +26,7 @@ buildPythonPackage rec {
azure-mgmt-nspkg azure-mgmt-nspkg
]; ];
postInstall = lib.optionalString isPy3k '' pythonNamespaces = [ "azure.mgmt" ];
rm $out/${python.sitePackages}/azure/__init__.py
rm $out/${python.sitePackages}/azure/mgmt/__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -26,10 +26,7 @@ buildPythonPackage rec {
azure-mgmt-nspkg azure-mgmt-nspkg
]; ];
postInstall = lib.optionalString isPy3k '' pythonNamespaces = [ "azure.mgmt" ];
rm $out/${python.sitePackages}/azure/__init__.py
rm $out/${python.sitePackages}/azure/mgmt/__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -27,10 +27,7 @@ buildPythonPackage rec {
azure-mgmt-nspkg azure-mgmt-nspkg
]; ];
postInstall = lib.optionalString isPy3k '' pythonNamespaces = [ "azure.mgmt" ];
rm -rf $out/${python.sitePackages}/azure/__init__.py
rm -rf $out/${python.sitePackages}/azure/mgmt/__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -26,11 +26,7 @@ buildPythonPackage rec {
azure-mgmt-nspkg azure-mgmt-nspkg
]; ];
# still needed when overriding to previous versions pythonNamespaces = [ "azure.mgmt" ];
# E.g. azure-cli
postInstall = lib.optionalString isPy3k ''
rm -f $out/${python.sitePackages}/azure/{,mgmt/}__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -24,11 +24,7 @@ buildPythonPackage rec {
azure-mgmt-nspkg azure-mgmt-nspkg
]; ];
# still needed when overriding to previous versions pythonNamespaces = [ "azure.mgmt" ];
# E.g. azure-cli
postInstall = lib.optionalString isPy3k ''
rm -f $out/${python.sitePackages}/azure/{,mgmt/}__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -26,11 +26,7 @@ buildPythonPackage rec {
azure-mgmt-nspkg azure-mgmt-nspkg
]; ];
# this is still needed for overriding to previous versions pythonNamespaces = [ "azure.mgmt" ];
# E.g azure-cli
postInstall = lib.optionalString isPy3k ''
rm -f $out/${python.sitePackages}/azure/{,mgmt/}__init__.py
'';
# has no tests # has no tests
doCheck = false; doCheck = false;

View File

@ -7,22 +7,19 @@
}: }:
buildPythonPackage rec { buildPythonPackage rec {
version = "7.2.0"; version = "8.0.0";
pname = "azure-mgmt-storage"; pname = "azure-mgmt-storage";
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit pname version;
extension = "zip"; extension = "zip";
sha256 = "01ck1ankgr9ikvfghhdcs777yrl2j2p8cw9q8nfdrjp22lpchabl"; sha256 = "0cxcdyy974ya1yi7s14sw54rwpc8qjngxr0jqb8vxki3528phrv3";
}; };
postInstall = if isPy3k then "" else ''
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 ]; propagatedBuildInputs = [ azure-mgmt-common ];
pythonNamespaces = [ "azure.mgmt" ];
# has no tests # has no tests
doCheck = false; doCheck = false;
@ -30,6 +27,6 @@ buildPythonPackage rec {
description = "This is the Microsoft Azure Storage Management Client Library"; description = "This is the Microsoft Azure Storage Management Client Library";
homepage = "https://github.com/Azure/azure-sdk-for-python"; homepage = "https://github.com/Azure/azure-sdk-for-python";
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ olcai mwilsoninsight ]; maintainers = with maintainers; [ jonringer olcai mwilsoninsight ];
}; };
} }

View File

@ -16,11 +16,8 @@ buildPythonPackage rec {
propagatedBuildInputs = [ azure-common msrest msrestazure ]; propagatedBuildInputs = [ azure-common msrest msrestazure ];
# fix namespace issues # fix namespace
postInstall = '' pythonNamespaces = [ "azure.multiapi" ];
rm $out/${python.sitePackages}/azure/__init__.py
rm $out/${python.sitePackages}/azure/multiapi/__init__.py
'';
# no tests included # no tests included
doCheck = false; doCheck = false;