Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mitogen
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
mitogen
Commits
fa427d83
Commit
fa427d83
authored
Sep 17, 2017
by
David Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tidy.
parent
3cf75c9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
docs/shame.rst
docs/shame.rst
+10
-7
No files found.
docs/shame.rst
View file @
fa427d83
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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment