Move non-trivial code from namespace __init__.py
-
Move non-trivial code from
slapos/recipe/__init__.py
toslapos/recipe/utils.py
.
This is needed for buildout 3 because buildout now uses pip and pip drops __init__.py
in namespace packages.
New-style namespace packages are packages that do not contain an __init__.py
. The native Python import mechanism now handles
such packages as namespaces.
Legacy namespace packages predate this feature and achieve the same behavior with an __init__.py
that uses a legacy namespace mechanism such as:
__import__('pkg_resources').declare_namespace(__name__)
Pip just drops such legacy __init__.py
in packages declared as namespace packages. To work around this buildout 3 creates a new __init__.py
using the above legacy namespace implementation.
- slapos.recipe.cmmi and rubygemsrecipe will need to adapt to the changed path.