PyTrilinos: Implement new infrastructure for nested sub-packages
Created by: wfspotz
All packages that have nested sub-packages should use the same infrastructure, and we need to avoid swig-generated base classes that include the
__init__ "module", because this is not valid python syntax. Also, there are import issues that are different for Python 2 and Python 3, and the resulting solution should work for both.
Import issues keep cropping up, and some "solutions" create base classes with
__init__ in the module path.
Use the relatively new
moduleimportoption for the
%moduleSWIG directive to better control importing required modules.
__init__.pymodules from swig-generated, which includes a compiled extension, to pure python. Use
__init__.py.infiles to generate these files in
Package.iand have it generate a python file
Package/Base.pywhich is imported by the
__init__.pyfile from the previous bullet. Use
globals().update(Base.__dict__)to create references from everything in
__init__.pyfile. Certain special variables, such as
__file__will need to be preserved.