From fa427d83c8e41a3a2bfd750ad9271188dc16ef99 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sun, 17 Sep 2017 18:00:12 +0530 Subject: [PATCH] Tidy. --- docs/shame.rst | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/shame.rst b/docs/shame.rst index 10d4d38e..ec0765c5 100644 --- a/docs/shame.rst +++ b/docs/shame.rst @@ -1,19 +1,22 @@ -Module Import Wall Of Shame ---------------------------- +Importer Wall Of Shame +---------------------- The following modules and packages run magic during ``__init.py__`` that makes life hard for Mitogen. Executing code during module import is always bad, and Mitogen is a concrete benchmark for why it's bad. +Bugs will probably be filed for these in time, but it does not address the huge +installed base of existing old software versions, so hacks are needed anyway. + ``pkg_resources`` ================= -Anything that imports ``pkg_resources`` will eventually cause -pkg_resources to try and import and scan ``__main__`` for its ``__requires__`` -attribute (``pkg_resources/__init__.py::_build_master()``). This breaks any app -that is not expecting its ``__main__`` to suddenly be sucked over a network and +Anything that imports ``pkg_resources`` will eventually cause ``pkg_resources`` +to try and import and scan ``__main__`` for its ``__requires__`` attribute +(``pkg_resources/__init__.py::_build_master()``). This breaks any app that is +not expecting its ``__main__`` to suddenly be sucked over a network and injected into a remote process, like py.test. A future version of Mitogen might have a more general hack that doesn't import @@ -25,7 +28,7 @@ issues like these. * Explicit is better than implicit: wait until the magical behaviour is explicitly requested (i.e. an API call). -* Use ``get("__main__")`` on :py:attr:`sys.modules` rather than ``import``, but +* Use ``get("__main__")`` on :py:data:`sys.modules` rather than ``import``, but this method isn't general enough, it only really helps tools like Mitogen.