cschwan / sage-on-gentoo

(Unofficial) Gentoo Overlay for Sage- and Sage-related ebuilds
84 stars 26 forks source link

doctests 8.3.beta6 Prefix #508

Closed strogdon closed 6 years ago

strogdon commented 6 years ago

I have several failing doctests in Prefix that do not fail on Gentoo. Most are either a precision difference or seem to be parallel testing related - they do not fail when tested individually. However I have the following two doctests that I can't resolve:

sage -t --long usr/lib64/python2.7/site-packages/sage/misc/misc.py
**********************************************************************
File "usr/lib64/python2.7/site-packages/sage/misc/misc.py", line 77, in sage.misc.misc.sage_makedirs
Failed example:
    sage_makedirs(sage_executable)
Expected:
    Traceback (most recent call last):
    ...
    OSError: ...
Got:
    <BLANKLINE>
**********************************************************************
1 item had failures:
   1 of   5 in sage.misc.misc.sage_makedirs
    [260 tests, 1 failure, 2.93 s]

and

sage -t --long usr/lib64/python2.7/site-packages/sage/repl/ipython_kernel/kernel.py
**********************************************************************
File "usr/lib64/python2.7/site-packages/sage/repl/ipython_kernel/kernel.py", line 206, in sage.repl.ipython_kernel.kernel.have_prerequisites
Failed example:
    have_prerequisites(debug=False) in [True, False]
Exception raised:
    Traceback (most recent call last):
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 573, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 983, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.repl.ipython_kernel.kernel.have_prerequisites[1]>", line 1, in <module>
        have_prerequisites(debug=False) in [True, False]
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/repl/ipython_kernel/kernel.py", line 210, in have_prerequisites
        from notebook.notebookapp import NotebookApp
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/notebook/notebookapp.py", line 43, in <module>
        ioloop.install()
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/zmq/eventloop/ioloop.py", line 210, in install
        assert (not ioloop.IOLoop.initialized()) or \
    AttributeError: type object 'IOLoop' has no attribute 'initialized'
**********************************************************************
1 item had failures:
   1 of   3 in sage.repl.ipython_kernel.kernel.have_prerequisites
    [14 tests, 1 failure, 0.95 s]

I have

[I] dev-python/pyzmq
     Available versions:  16.0.2 {doc test PYTHON_TARGETS="python2_7 python3_4 python3_5 python3_6"}
     Installed versions:  16.0.2(10:05:44 PM 02/18/2018)(-doc -test PYTHON_TARGETS="python2_7 -python3_4 -python3_5 -python3_6")
     Homepage:            http://www.zeromq.org/bindings:python https://pypi.org/project/pyzmq/
     Description:         Lightweight and super-fast messaging library built on top of the ZeroMQ library

[I] dev-python/notebook
     Available versions:  4.0.6[1] 5.0.0 5.2.1 **9999[1] {doc test PYTHON_TARGETS="python2_7 python3_4 python3_5 python3_6"}
     Installed versions:  5.2.1(04:36:25 PM 06/11/2018)(-doc -test PYTHON_TARGETS="python2_7 -python3_4 -python3_5 -python3_6")
     Homepage:            http://jupyter.org
     Description:         Jupyter Interactive Notebook

[1] "science" /storage/strogdon/gentoo-rap/var/lib/layman/science
kiwifb commented 6 years ago

I will investigate the first one but the second is something I have seen in bugzilla about incompatibilities between tornado and some versions of pyzmq https://bugs.gentoo.org/648088 I think.

strogdon commented 6 years ago

Yes, tornado is the culprit for the second test. I had 5.0.2 installed. Downgrading to 4.5.3 fixed the failing doctest.

kiwifb commented 6 years ago

Ha, yes the doctest in misc.py should be failing on prefix for quite a while. sage_executable is SAGE_ROOT/sage which is the top level sage command on a vanilla install.

So in vanilla it fails because there is already a file. In a standard gentoo install SAGE_ROOT is /usr/share/sage a location belonging to root so we have another expected failure. On a prefix however, unless usr/share/sage/sage already exists the call will succeed and no failure will be reported.

That falls in the bucket of SAGE_ROOT really shouldn't be used. What to replace it with... Any suggestions?

strogdon commented 6 years ago

Any fallout with using $SAGE_LOCAL/bin/sage? So this doctest may be the reason why $SAGE_ROOT/sage exists in Prefix. It's created by the doctest and is never removed.

kiwifb commented 6 years ago

Nice idea. And yes that would be the reason why you have that file. And it is not removed because it doesn't belong to any packages.

kiwifb commented 6 years ago

Fix in overlay now.