#5155: Fix doctests and methods that want write access to $SAGE_LOCAL
------------------------+---------------------------------------------------
   Reporter:  mabshoff  |          Owner:  jdemeyer              
       Type:  defect    |         Status:  needs_work            
   Priority:  critical  |      Milestone:  sage-4.7.3            
  Component:  scripts   |       Keywords:                        
Work_issues:            |       Upstream:  N/A                   
   Reviewer:            |         Author:  Mike Hansen           
     Merged:            |   Dependencies:  #11920, #11926, #11933
------------------------+---------------------------------------------------

Old description:

> 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, set SAGE_TESTDIR
> to some place writable, for example
> {{{
> export SAGE_TESTDIR=$HOME/tmp
> }}}
> and run the doctests on a Sage install that isn't owned by the user:
> {{{
> $ ./sage -tp 4 -long devel/sage/doc/common devel/sage/doc/de
> devel/sage/doc/en devel/sage/doc/fr devel/sage/doc/ru devel/sage/sage
> }}}
>
> Here, we assume that the owner of the Sage install has run Sage at least
> once (or has applied #11926).
>
> On sage-4.7.2.alpha4, this causes:
> {{{
> The following tests failed:
>
>         sage -t -long devel/sage/sage/modular/hecke/submodule.py # 1
> doctests failed
>         sage -t -long devel/sage/sage/modular/abvar/abvar.py # 1 doctests
> failed
>         sage -t -long devel/sage/sage/lfunctions/sympow.py # 13 doctests
> failed
>         sage -t -long devel/sage/sage/interfaces/qepcad.py # 3 doctests
> failed
>         sage -t -long
> devel/sage/sage/schemes/elliptic_curves/ell_rational_field.py # 17
> doctests failed
>
> }}}
>
> This seems to be because of:
>  1. Installing an rc file for the '''experimental package''' qepcad (in a
> very odd location `$SAGE_ROOT/local/default.qepcadrc`)
>  2. Sympow which needs to create datafiles.  This should probably be done
> in sympow's `spkg-install` instead.  See #11920.
>
> '''Apply''':
>  1. [attachment:5155_scripts.patch] to the scripts repository.
>  1. [attachment:5155_qepcad.patch] to the Sage library.

New description:

 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, set SAGE_TESTDIR to
 some place writable, for example
 {{{
 export SAGE_TESTDIR=$HOME/tmp
 }}}
 and run the doctests on a Sage install that isn't owned by the user:
 {{{
 $ ./sage -tp 4 -long devel/sage/doc/common devel/sage/doc/de
 devel/sage/doc/en devel/sage/doc/fr devel/sage/doc/ru devel/sage/sage
 }}}

 Here, we assume that the owner of the Sage install has run Sage at least
 once (or has applied #11926).

 On sage-4.7.2.alpha4, this causes:
 {{{
 The following tests failed:

         sage -t -long devel/sage/sage/modular/hecke/submodule.py # 1
 doctests failed
         sage -t -long devel/sage/sage/modular/abvar/abvar.py # 1 doctests
 failed
         sage -t -long devel/sage/sage/lfunctions/sympow.py # 13 doctests
 failed
         sage -t -long devel/sage/sage/interfaces/qepcad.py # 3 doctests
 failed
         sage -t -long
 devel/sage/sage/schemes/elliptic_curves/ell_rational_field.py # 17
 doctests failed

 }}}

 This seems to be because of:
  1. Installing an rc file for the '''experimental package''' qepcad (in a
 very odd location `$SAGE_ROOT/local/default.qepcadrc`)
  2. Sympow which needs to create datafiles.  This should probably be done
 in sympow's `spkg-install` instead.  See #11920.

 '''Apply''':
  1. [attachment:5155_scripts.patch],
 [attachment:trac_5155-permissions.patch] to the scripts repository.
  1. [attachment:5155_qepcad.patch] to the Sage library.

--

Comment(by jhpalmieri):

 For the scripts patch: should there be any error checking when writing to
 files?  If a sysadmin installs Sage, runs it once (to generate the
 appropriate files) and then moves it but doesn't run it again, it would be
 nice if other users got helpful error messages.  One issue is the code
 {{{
     check_processor_flags()
     # Note: install_moved() may also run e.g.
 initialize_pkgconfig_files().
     if install_moved():
         print "The Sage installation tree may have moved"
         print "(from %s to %s)." % (OLD_SAGE_ROOT, SAGE_ROOT)
 }}}
 The problem is that `check_processor_flags` and `install_moved` already
 try to write to files, so if permissions are bad, the message about the
 installation tree may not get printed.  I'm attaching a patch to apply on
 top of yours (basically wraps everything in a try...except block).

 Also, as discussed at #11760, the alternate implementation (commented out)
 of searching for SAGE_ROOT using regular expressions was slower than the
 one currently used, so I just deleted the comments altogether.

 I'll keep looking at your patch.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5155#comment:19>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to