From 9c8565f7314d3f5db52594ae001f9562a6ed0872 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Tue, 17 Mar 2020 14:30:12 -0700 Subject: [PATCH] azure-cli: use pythonNamespaces --- pkgs/tools/admin/azure-cli/python-packages.nix | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/pkgs/tools/admin/azure-cli/python-packages.nix b/pkgs/tools/admin/azure-cli/python-packages.nix index 2ac74a16edd..b44d650e3ea 100644 --- a/pkgs/tools/admin/azure-cli/python-packages.nix +++ b/pkgs/tools/admin/azure-cli/python-packages.nix @@ -11,10 +11,7 @@ let ''; # Prevent these __init__'s from violating PEP420, only needed for python2 - postInstall = (attrs.postInstall or "") + '' - rm $out/${python.sitePackages}/azure/{,__pycache__/}__init__.* \ - $out/${python.sitePackages}/azure/cli/{,__pycache__/}__init__.* - ''; + pythonNamespaces = [ "azure.cli" ]; checkInputs = [ mock pytest ] ++ (attrs.checkInputs or []); checkPhase = attrs.checkPhase or '' @@ -39,9 +36,7 @@ let ''; # force PEP420 - postInstall = '' - rm -f $out/${py.sitePackages}/azure/{,mgmt/}__init__.py - ''; + pythonNamespaces = [ "azure.mgmt" ]; }); py = python.override { @@ -271,9 +266,7 @@ let propagatedBuildInputs = with self; [ azure-common azure-nspkg msrest msrestazure cryptography ]; - postInstall = '' - rm -f $out/${self.python.sitePackages}/azure/__init__.py - ''; + pythonNamespaces = [ "azure" ]; pythonImportsCheck = [ ]; });