swig/Examples/python/import_packages
William S Fulton 03323f5c8b The Python module import logic has changed to stop obfuscating real ImportError problems.
Only one import of the low-level C/C++ module from the pure Python module is
attempted now. Previously a second import of the low-level C/C++ module was attempted
after an ImportError occurred and was done to support 'split modules'. A 'split module' is
a configuration where the pure Python module is a module within a Python package and the
low-level C/C++ module is a global Python module. Now a 'split module' configuration is
no longer supported by default. This configuration can be supported with a simple
customization, such as:

  %module(package="mypackage", moduleimport="import $module") foo

or if using -builtin:

  %module(package="mypackage", moduleimport="from $module import *") foo

instead of

  %module(package="mypackage") foo

See the updated Python chapter titled "Location of modules" in the documentation.

Closes #848 #1343
2018-12-16 16:41:39 +00:00
..
from_init1 Skip Python subprocess calls in import_packages testcase on Windows 2018-12-06 06:50:57 +00:00
from_init2 Skip Python subprocess calls in import_packages testcase on Windows 2018-12-06 06:50:57 +00:00
from_init3 Skip Python subprocess calls in import_packages testcase on Windows 2018-12-06 06:50:57 +00:00
module_is_init Add example to test the Python module being renamed to __init__.py 2018-12-08 22:31:26 +00:00
namespace_pkg Skip Python subprocess calls in import_packages testcase on Windows 2018-12-06 06:50:57 +00:00
relativeimport1 Skip Python subprocess calls in import_packages testcase on Windows 2018-12-06 06:50:57 +00:00
relativeimport2 Skip Python subprocess calls in import_packages testcase on Windows 2018-12-06 06:50:57 +00:00
relativeimport3 Skip Python subprocess calls in import_packages testcase on Windows 2018-12-06 06:50:57 +00:00
same_modnames1 Skip Python subprocess calls in import_packages testcase on Windows 2018-12-06 06:50:57 +00:00
same_modnames2 Skip Python subprocess calls in import_packages testcase on Windows 2018-12-06 06:50:57 +00:00
split_modules The Python module import logic has changed to stop obfuscating real ImportError problems. 2018-12-16 16:41:39 +00:00
Makefile Add example to test the Python module being renamed to __init__.py 2018-12-08 22:31:26 +00:00
README Examples (and tests) for python namespace packages 2016-04-05 10:58:50 -06:00

These are actually regression tests for SF bug #1297 (GH issue #7).
The namespace_pkg is an example of python3's namespace packages.

See individual READMEs in subdirectories.