Opened 12 years ago
Last modified 6 years ago
#3685 needs_work defect
make damned sure that "import sage.all" doesn't import ipython
Reported by: | was | Owned by: | cwitty |
---|---|---|---|
Priority: | major | Milestone: | sage-6.4 |
Component: | misc | Keywords: | startup time and imports |
Cc: | Merged in: | ||
Authors: | Mike Hansen | Reviewers: | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
Make sure that doing this does not import ipython:
teragon-2:~ was$ sage -python Python 2.5.2 (r252:60911, Jul 10 2008, 00:31:06) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sage.all
Apply:
Attachments (3)
Change History (20)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
- Milestone changed from sage-3.0.6 to sage-3.1
- Summary changed from make damned sure that "import sage.all" doesn't import ipython to [with patch; needs review] make damned sure that "import sage.all" doesn't import ipython
I think this shouldn't go into 3.0.6 since it could introduce bugs, as it touches several files. That said, it's a smallish patch I made in 30 minutes. So it's not crazy complicated. It's just dangerous.
Changed 12 years ago by
comment:3 Changed 12 years ago by
- Summary changed from [with patch; needs review] make damned sure that "import sage.all" doesn't import ipython to [with patch; needs work] make damned sure that "import sage.all" doesn't import ipython
This patch causes some problems on my machine.
1) Sage segfaults at exit.
2) When doing sage -t, I get the following problem for every file:
sage -t devel/sage-combinat/sage/combinat/root_system/all.pyTraceback (most recent call last): File "/opt/sage/tmp/.doctest_all.py", line 2, in <module> from sage.all_cmdline import *; File "/opt/sage/local/lib/python2.5/site-packages/sage/all_cmdline.py", line 14, in <module> from sage.all import * File "/opt/sage/local/lib/python2.5/site-packages/sage/all.py", line 72, in <module> from sage.rings.all import * File "/opt/sage/local/lib/python2.5/site-packages/sage/rings/all.py", line 94, in <module> from qqbar import (AlgebraicRealField, is_AlgebraicRealField, AA, File "/opt/sage/local/lib/python2.5/site-packages/sage/rings/qqbar.py", line 1163, in <module> QQxy = QQ['x', 'y'] File "ring.pyx", line 146, in sage.rings.ring.Ring.__getitem__ (sage/rings/ring.c:1851) File "/opt/sage/local/lib/python2.5/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 303, in PolynomialRing R = _multi_variate(base_ring, names, n, sparse, order) File "/opt/sage/local/lib/python2.5/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 409, in _multi_variate from sage.rings.polynomial.multi_polynomial_libsingular import MPolynomialRing_libsingular
comment:4 Changed 12 years ago by
Mike said:
1) Sage segfaults at exit. 2) When doing sage -t, I get the following problem for every file:
Mike, (1) what is your system? (2) Can you do "sage -ba" and try again?
-- William
comment:5 Changed 11 years ago by
I just tried it out and got none of the problems described above.
'import sage.all' doesn't import IPython as desired. I'm not putting up a positive review because of the problems described above, but I would be nice to have feedback on this
I'm on OS X 10.5 with this patch applied against 3.1.4.
comment:6 Changed 11 years ago by
- Priority changed from blocker to major
If we've released for months and months (8 months!) without fixing this, it doesn't make sense to keep it as a blocker.
Changed 7 years ago by
comment:7 Changed 7 years ago by
- Report Upstream set to N/A
- Status changed from needs_work to needs_review
This is much easier now with the new IPython.
Apply trac_3685.patch
comment:8 Changed 7 years ago by
- Summary changed from [with patch; needs work] make damned sure that "import sage.all" doesn't import ipython to make damned sure that "import sage.all" doesn't import ipython
comment:9 Changed 7 years ago by
- Milestone changed from sage-5.11 to sage-5.12
comment:10 Changed 7 years ago by
- Status changed from needs_review to needs_work
it seems that the doctest fails on 5.12.beta2, so the patch needs work
comment:11 Changed 7 years ago by
- Description modified (diff)
Changed 7 years ago by
comment:12 Changed 7 years ago by
- Keywords startup time and imports added
- Status changed from needs_work to needs_review
I have found the problem, it seems ! Here is the patch solving the issue.
Needs review !
comment:13 Changed 7 years ago by
- Status changed from needs_review to needs_work
arggg, that breaks everything... Back to need work.. :(
comment:14 Changed 7 years ago by
I am not able to sort things out.
It seems that the import of IPython occurs because of the line
from IPython.core.formatters import PlainTextFormatter
in "sage.misc.displayhook"
Is there a way to avoid this IPython import ?
comment:15 Changed 6 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:16 Changed 6 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:17 Changed 6 years ago by
- Milestone changed from sage-6.3 to sage-6.4
Here is how Ondrej Certik verifies that sage.all was importing ipython in sage-3.0.5: