Add __name__ == __main__ guards to setup.pys
Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Petr Spacek <pspacek@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
This commit is contained in:
1 parent
9b0b970733
commit
91920e7cb4
7 files changed
+127
-121
No files matched your search
+20
-20
@@ -20,26 +20,26 @@
|
||||
|
||||
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="ipaclient",
|
||||
doc=__doc__,
|
||||
scripts=['../ipa'],
|
||||
package_dir={'ipaclient': ''},
|
||||
packages=[
|
||||
"ipaclient",
|
||||
"ipaclient.plugins",
|
||||
"ipaclient.remote_plugins",
|
||||
"ipaclient.remote_plugins.2_49",
|
||||
"ipaclient.remote_plugins.2_114",
|
||||
"ipaclient.remote_plugins.2_156",
|
||||
"ipaclient.remote_plugins.2_164",
|
||||
],
|
||||
)
|
||||
ipasetup(
|
||||
name="ipaclient",
|
||||
doc=__doc__,
|
||||
scripts=['../ipa'],
|
||||
package_dir={'ipaclient': ''},
|
||||
packages=[
|
||||
"ipaclient",
|
||||
"ipaclient.plugins",
|
||||
"ipaclient.remote_plugins",
|
||||
"ipaclient.remote_plugins.2_49",
|
||||
"ipaclient.remote_plugins.2_114",
|
||||
"ipaclient.remote_plugins.2_156",
|
||||
"ipaclient.remote_plugins.2_164",
|
||||
],
|
||||
)
|
||||
+13
-13
@@ -20,19 +20,19 @@
|
||||
|
||||
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="ipalib",
|
||||
doc=__doc__,
|
||||
package_dir={'ipalib': ''},
|
||||
packages=[
|
||||
"ipalib",
|
||||
],
|
||||
)
|
||||
ipasetup(
|
||||
name="ipalib",
|
||||
doc=__doc__,
|
||||
package_dir={'ipalib': ''},
|
||||
packages=[
|
||||
"ipalib",
|
||||
],
|
||||
)
|
||||
+17
-17
@@ -20,23 +20,23 @@
|
||||
|
||||
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="ipaplatform",
|
||||
doc=__doc__,
|
||||
package_dir={'ipaplatform': ''},
|
||||
packages=[
|
||||
"ipaplatform",
|
||||
"ipaplatform.base",
|
||||
"ipaplatform.fedora",
|
||||
"ipaplatform.redhat",
|
||||
"ipaplatform.rhel"
|
||||
],
|
||||
)
|
||||
ipasetup(
|
||||
name="ipaplatform",
|
||||
doc=__doc__,
|
||||
package_dir={'ipaplatform': ''},
|
||||
packages=[
|
||||
"ipaplatform",
|
||||
"ipaplatform.base",
|
||||
"ipaplatform.fedora",
|
||||
"ipaplatform.redhat",
|
||||
"ipaplatform.rhel"
|
||||
],
|
||||
)
|
||||
+16
-16
@@ -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"
|
||||
],
|
||||
)
|
||||
+19
-20
@@ -22,26 +22,25 @@
|
||||
"""
|
||||
Python-level packaging using setuptools
|
||||
"""
|
||||
import os
|
||||
from os.path import abspath, dirname
|
||||
import sys
|
||||
|
||||
# include ../ for ipasetup.py and ipalib
|
||||
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='freeipa',
|
||||
doc=__doc__,
|
||||
package_dir={'ipaserver': ''},
|
||||
packages=[
|
||||
'ipaserver',
|
||||
'ipaserver.advise',
|
||||
'ipaserver.advise.plugins',
|
||||
'ipaserver.plugins',
|
||||
'ipaserver.install',
|
||||
'ipaserver.install.plugins',
|
||||
'ipaserver.install.server',
|
||||
],
|
||||
)
|
||||
ipasetup(
|
||||
name='freeipa',
|
||||
doc=__doc__,
|
||||
package_dir={'ipaserver': ''},
|
||||
packages=[
|
||||
'ipaserver',
|
||||
'ipaserver.advise',
|
||||
'ipaserver.advise.plugins',
|
||||
'ipaserver.plugins',
|
||||
'ipaserver.install',
|
||||
'ipaserver.install.plugins',
|
||||
'ipaserver.install.server',
|
||||
],
|
||||
)
|
||||
@@ -15,7 +15,14 @@ addopts = --doctest-modules
|
||||
-p ipatests.pytest_plugins.additional_config
|
||||
# Ignore files for doc tests.
|
||||
# TODO: ideally, these should all use __name__=='__main__' guards
|
||||
--ignore=ipasetup.py
|
||||
--ignore=setup.py
|
||||
--ignore=ipaclient/setup.py
|
||||
--ignore=ipalib/setup.py
|
||||
--ignore=ipaplatform/setup.py
|
||||
--ignore=ipapython/setup.py
|
||||
--ignore=ipaserver/setup.py
|
||||
--ignore=ipatests/setup.py
|
||||
--ignore=checks/check-ra.py
|
||||
--ignore=daemons/ipa-otpd/test.py
|
||||
--ignore=doc/examples/python-api.py
|
||||
|
||||
+35
-35
@@ -20,41 +20,41 @@
|
||||
|
||||
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="ipatests",
|
||||
doc=__doc__,
|
||||
package_dir={'ipatests': ''},
|
||||
packages=[
|
||||
"ipatests",
|
||||
"ipatests.pytest_plugins",
|
||||
"ipatests.test_cmdline",
|
||||
"ipatests.test_install",
|
||||
"ipatests.test_integration",
|
||||
"ipatests.test_ipalib",
|
||||
"ipatests.test_ipapython",
|
||||
"ipatests.test_ipaserver",
|
||||
"ipatests.test_ipaserver.test_install",
|
||||
"ipatests.test_pkcs10",
|
||||
"ipatests.test_webui",
|
||||
"ipatests.test_xmlrpc",
|
||||
"ipatests.test_xmlrpc.tracker"
|
||||
],
|
||||
scripts=['ipa-run-tests', 'ipa-test-config', 'ipa-test-task'],
|
||||
package_data={
|
||||
'ipatests': ['pytest.ini'],
|
||||
'ipatests.test_install': ['*.update'],
|
||||
'ipatests.test_integration': ['scripts/*'],
|
||||
'ipatests.test_ipalib': ['data/*'],
|
||||
'ipatests.test_pkcs10': ['*.csr'],
|
||||
"ipatests.test_ipaserver": ['data/*'],
|
||||
'ipatests.test_xmlrpc': ['data/*'],
|
||||
}
|
||||
)
|
||||
ipasetup(
|
||||
name="ipatests",
|
||||
doc=__doc__,
|
||||
package_dir={'ipatests': ''},
|
||||
packages=[
|
||||
"ipatests",
|
||||
"ipatests.pytest_plugins",
|
||||
"ipatests.test_cmdline",
|
||||
"ipatests.test_install",
|
||||
"ipatests.test_integration",
|
||||
"ipatests.test_ipalib",
|
||||
"ipatests.test_ipapython",
|
||||
"ipatests.test_ipaserver",
|
||||
"ipatests.test_ipaserver.test_install",
|
||||
"ipatests.test_pkcs10",
|
||||
"ipatests.test_webui",
|
||||
"ipatests.test_xmlrpc",
|
||||
"ipatests.test_xmlrpc.tracker"
|
||||
],
|
||||
scripts=['ipa-run-tests', 'ipa-test-config', 'ipa-test-task'],
|
||||
package_data={
|
||||
'ipatests': ['pytest.ini'],
|
||||
'ipatests.test_install': ['*.update'],
|
||||
'ipatests.test_integration': ['scripts/*'],
|
||||
'ipatests.test_ipalib': ['data/*'],
|
||||
'ipatests.test_pkcs10': ['*.csr'],
|
||||
"ipatests.test_ipaserver": ['data/*'],
|
||||
'ipatests.test_xmlrpc': ['data/*'],
|
||||
}
|
||||
)
|
||||
Reference in new issue
Block a user