From 91920e7cb48cbf143ae281c9c073df14b2c2dddf Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 24 Oct 2016 14:56:58 +0200 Subject: Add __name__ == __main__ guards to setup.pys Signed-off-by: Christian Heimes Reviewed-By: Petr Spacek Reviewed-By: Martin Basti Reviewed-By: Lenka Doudova --- ipapython/setup.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'ipapython') diff --git a/ipapython/setup.py b/ipapython/setup.py index 81e032b23..47acdd6f2 100755 --- a/ipapython/setup.py +++ b/ipapython/setup.py @@ -20,22 +20,22 @@ FreeIPA is a server for identity, policy, and audit. """ -import os +from os.path import abspath, dirname import sys -# include ../ for ipasetup.py -sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +if __name__ == '__main__': + # include ../ for ipasetup.py + sys.path.append(dirname(dirname(abspath(__file__)))) + from ipasetup import ipasetup # noqa: E402 -from ipasetup import ipasetup # noqa: E402 - -ipasetup( - name="ipapython", - doc=__doc__, - package_dir={'ipapython': ''}, - packages=[ - "ipapython", - "ipapython.dnssec", - "ipapython.secrets", - "ipapython.install" - ], -) + ipasetup( + name="ipapython", + doc=__doc__, + package_dir={'ipapython': ''}, + packages=[ + "ipapython", + "ipapython.dnssec", + "ipapython.secrets", + "ipapython.install" + ], + ) -- cgit