pythonPackages.azure-common: fix namespace lookup

This commit is contained in:
Jonathan Ringer 2019-09-13 18:06:45 -07:00
parent fdd6245e53
commit 4a17217696

View File

@ -1,8 +1,9 @@
{ pkgs { lib
, buildPythonPackage , buildPythonPackage
, fetchPypi , fetchPypi
, azure-nspkg , azure-nspkg
, isPyPy , isPyPy
, setuptools
, python , python
, isPy3k , isPy3k
}: }:
@ -20,7 +21,7 @@ buildPythonPackage rec {
propagatedBuildInputs = [ propagatedBuildInputs = [
azure-nspkg azure-nspkg
]; ] ++ lib.optionals (!isPy3k) [ setuptools ]; # need for namespace lookup
postInstall = if isPy3k then "" else '' 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/__init__.py
@ -28,7 +29,7 @@ buildPythonPackage rec {
doCheck = false; doCheck = false;
meta = with pkgs.lib; { meta = with lib; {
description = "This is the Microsoft Azure common code"; description = "This is the Microsoft Azure common code";
homepage = https://github.com/Azure/azure-sdk-for-python/tree/master/azure-common; homepage = https://github.com/Azure/azure-sdk-for-python/tree/master/azure-common;
license = licenses.mit; license = licenses.mit;