-
-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix doctests that want write access to $SAGE_ROOT #5155
Comments
Author: Mike Hansen |
comment:2
Before applying the patch, I get two doctest failures (with a non-writeable Sage install). Applying the patch "trac_5155.patch" fixes both. So positive review for that. The scripts patch wasn't necessary to get those tests to pass, and it also doesn't apply cleanly to 4.3.1:
The changes there look fine in principle, though. So once it's rebased, positive review there, too. |
comment:3
Some of the doctest are ok nowadays but there are other new fails. See for example #9965 I can confirm that, with sage 4.5.3 I get the following doctest failures:
All except quecad are trying to be solved in #9965 |
comment:4
qepcad failures
|
comment:5
Another issue, if you compile sage but the very first access of sage is made by a user without write permissions, you get the following error: | Sage Version 4.5.3, Release Date: 2010-09-04 | Traceback (most recent call last): |
comment:6
With Sage 4.7.2.alpha2, I see problems with qepcad and sympow. I think the qepcad problem should be easy to solve, basically as mhansen did before: diff --git a/sage/interfaces/qepcad.py b/sage/interfaces/qepcad.py
--- a/sage/interfaces/qepcad.py
+++ b/sage/interfaces/qepcad.py
@@ -636,14 +636,14 @@ def _rewrite_qepcadrc():
EXAMPLES:
sage: from sage.interfaces.qepcad import _rewrite_qepcadrc
sage: _rewrite_qepcadrc()
- sage: from sage.misc.misc import SAGE_LOCAL
- sage: open('%s/default.qepcadrc'%SAGE_LOCAL).readlines()[-1]
+ sage: from sage.misc.misc import DOT_SAGE
+ sage: open('%s/default.qepcadrc'%DOT_SAGE).readlines()[-1]
'SINGULAR .../local//bin'
"""
global _rewrote_qepcadrc
if _rewrote_qepcadrc: return
- SL = sage.misc.misc.SAGE_LOCAL
+ SL = sage.misc.misc.DOT_SAGE
fn = '%s/default.qepcadrc'%SL
text = \
"""# THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT Sympow will be harder to deal with, because of how the spkg is written: it tries to write files to SAGE_LOCAL/lib/sympow. See [#9703 comment:9] for a possible fix. I'm attaching a patch to try to deal with the situation when you run Sage for the very first time as a user without write permissions. Finally, there may be other issues if you compile Sage but don't run it, and then run doctests as a user without write permissions (the first time doctests get run, they might write some files which don't need to be written later). These issues should be fixed, too. |
comment:7
I'm not sure this patch is a good idea or needed, considering #11926. If the Sage install was moved, it is probably good to bail out with an error if there is no write access. |
Dependencies: #11926 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:14
A few quick comments:
For the scripts patch:
|
Attachment: 5155_root.patch.gz Attachment: 5155_sage_location.patch.gz |
comment:39
The Fortran patch needed to be rebased because of #13579. Apart from that, things look fine. |
comment:40
Some doctest failures... |
This comment has been minimized.
This comment has been minimized.
comment:41
Attachment: 5155_sagelib.patch.gz |
This comment has been minimized.
This comment has been minimized.
comment:43
SAGE_LOCAL is a strange location for default.qepcadrc I suppose it really needs to be changed in the spkg first but SAGE_LOCAL/etc is a better location for this kind of file. |
Reviewer: François Bissey |
comment:44
My only objection is the location of default.qepcadrc but since it is for an experimental spkg and would require another ticket to change it I am giving this a positive review. Moving the default.qepcadrc location should be the object of a follow up ticket. |
comment:45
Replying to @kiwifb:
Also, you shouldn't blame this ticket for that, it has always been like that. Thanks for the review! |
Merged: sage-5.7.beta0 |
comment:47
I made a patch for the analogous problem for |
All doctests in Sage should pass when they are run as a user that does not have write access to the Sage install. To do that, run the doctests on a Sage install that isn't owned by the user:
On sage-5.4.beta1, this causes:
Apply:
SAGE_ROOT
repository.Depends on #13157
Depends on #13397
Depends on #13452
Depends on #13407
Depends on #13459
Depends on #13457
Depends on #13123
Depends on #13887
CC: @lftabera @nexttime
Component: scripts
Author: Mike Hansen, Jeroen Demeyer, John Palmieri
Reviewer: François Bissey
Merged: sage-5.7.beta0
Issue created by migration from https://trac.sagemath.org/ticket/5155
The text was updated successfully, but these errors were encountered: