coverage.py cannot be imported in Jython2.7 due to missing multiprocessing library
When running Jython 2.7.1b3 and using multiprocessing by way of pytest-cov:
File "/lib/jython2.7/site-packages/pytest_cov/plugin.py", line 5, in <module> from coverage.misc import CoverageException File "/lib/jython2.7/site-packages/coverage-4.3.1-py2.7.egg/coverage/__init__.py", line 13, in <module> from coverage.control import Coverage, process_startup File "/lib/jython2.7/site-packages/coverage-4.3.1-py2.7.egg/coverage/control.py", line 27, in <module> from coverage.multiproc import patch_multiprocessing File "/lib/jython2.7/site-packages/coverage-4.3.1-py2.7.egg/coverage/multiproc.py", line 6, in <module> import multiprocessing ImportError: No module named multiprocessing
According to a Jython issue this is a known gap.
There seems to be no way to prevent the attempt to import multiprocessing, as it happens in unconditional imports in __init__.py
-> control.py
-> multiproc.py
Comments (8)
-
-
I've pushed some changes to deal with a missing multiprocessing module. The test suite mostly still doesn't run, so let me know what you find trying to use coverage.py on Jython.
-
- changed status to open
-
Also, other tips for Jython would be appreciated. For example, I can't run "coverage --version" under Jython because shebang line in the launcher refers to the jython executable, which is really a Python 2.7 script, or something?
-
I have to admit, the thing I most want is for importing it not to blow up on Jython :) If it works, so much the better -- and I'll probably be motivated to look at that in the near-ish future. But for now, "not exploding" is a good start.
Will you release a 4.3.2 to include that?
-
- changed status to resolved
Fixed as of 4d9c54230ba7
-
Ned, is there anything I could do to nudge a 4.3.2 release? I'd love to pull this in and start using it.
-
Thanks!
- Log in to comment
@Chris it's been a long time since I've been able to support Jython. The Jython people aren't making this easy... I tried running my tox tests against 2.7.0, and couldn't even install the requirements:
I went to jython.org to get the 2.7.1b1 you mentioned, and I see nothing there. Googling around, the releases are mentioned on Frank's blog and nowhere else? I'm trying to install it now, but one way to get better Jython support would be to encourage Jython to be less unique in their release choreography.