mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Use namespace-aware meta importer for ipaplatform
Instead of symlinks and build-time configuration the ipaplatform module is now able to auto-detect platforms on import time. The meta importer uses the platform 'ID' from /etc/os-releases. It falls back to 'ID_LIKE' on platforms like CentOS, which has ID=centos and ID_LIKE="rhel fedora". The meta importer is able to handle namespace packages and the ipaplatform package has been turned into a namespace package in order to support external platform specifications. https://fedorahosted.org/freeipa/ticket/6474 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
@@ -7,7 +7,6 @@ NULL =
|
||||
SUBDIRS = \
|
||||
freeipa \
|
||||
ipa \
|
||||
ipaplatform \
|
||||
ipaserver \
|
||||
ipatests \
|
||||
$(NULL)
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
include $(top_srcdir)/Makefile.python.am
|
||||
|
||||
pkginstall = false
|
||||
@@ -1,2 +0,0 @@
|
||||
This is a dummy package for FreeIPA's ipaplatform.
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2017 FreeIPA Contributors see COPYING for license
|
||||
#
|
||||
|
||||
raise ImportError("ipaplatform is not yet supported as PyPI package.")
|
||||
@@ -1,6 +0,0 @@
|
||||
[bdist_wheel]
|
||||
universal = 1
|
||||
|
||||
[aliases]
|
||||
packages = clean --all egg_info bdist_wheel
|
||||
release = packages register upload
|
||||
@@ -1,26 +0,0 @@
|
||||
#
|
||||
# Copyright (C) 2017 FreeIPA Contributors see COPYING for license
|
||||
#
|
||||
"""Dummy package for FreeIPA
|
||||
|
||||
ipaplatform is not yet available as PyPI package.
|
||||
"""
|
||||
|
||||
from os.path import abspath, dirname
|
||||
import sys
|
||||
|
||||
if __name__ == '__main__':
|
||||
# include ../../ for ipasetup.py
|
||||
sys.path.append(dirname(dirname(dirname(abspath(__file__)))))
|
||||
from ipasetup import ipasetup # noqa: E402
|
||||
|
||||
ipasetup(
|
||||
name='ipaplatform',
|
||||
doc = __doc__,
|
||||
packages=[
|
||||
"ipaplatform",
|
||||
],
|
||||
install_requires=[
|
||||
"ipaclient",
|
||||
]
|
||||
)
|
||||
@@ -9,13 +9,14 @@ import pytest
|
||||
|
||||
@pytest.mark.parametrize("modname", [
|
||||
# placeholder packages raise ImportError
|
||||
'ipaplatform',
|
||||
'ipaserver',
|
||||
'ipatests',
|
||||
# PyPI packages do not have install subpackage
|
||||
'ipaclient.install',
|
||||
'ipalib.install',
|
||||
'ipapython.install',
|
||||
# override module should not be shipped in wheels
|
||||
'ipaplatform.override',
|
||||
])
|
||||
def test_fail_import(modname):
|
||||
try:
|
||||
@@ -29,6 +30,7 @@ def test_fail_import(modname):
|
||||
@pytest.mark.parametrize("modname", [
|
||||
'ipaclient',
|
||||
'ipalib',
|
||||
'ipaplatform',
|
||||
'ipapython',
|
||||
])
|
||||
def test_import(modname):
|
||||
|
||||
Reference in New Issue
Block a user