-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gathering references for the best way to customize python imports #1
Comments
Interestingly six also has some module proxy to enable lazy loading : |
One thing to consider also is http://setuptools.readthedocs.io/en/latest/pkg_resources.html |
For future reference, the standard python way to dynamically import a module or package is to use https://docs.python.org/2.7/library/importlib.html |
We should dig more into http://setuptools.readthedocs.io/en/latest/pkg_resources.html#supporting-custom-importers We are already using pkg_resources, as the standard way to setup path and customize import behavior like in https://github.com/asmodehn/pyros-setup/blob/master/pyros_setup/__init__.py#L20, and also for namespace packages... Maybe setting up ROS environment can be done as soon as any python code is trying to import a ros package (using pkg_resources and a custom importer for ROS...) |
I guess all of this now belongs there : |
http://blog.dowski.com/2008/07/31/customizing-the-python-import-system/
http://stackoverflow.com/questions/3799545/dynamically-importing-python-module/3799609#3799609
The text was updated successfully, but these errors were encountered: