#17019: Make sure preparser for .sage files respects module docstrings
-------------------------------------+-------------------------------------
       Reporter:  jsrn               |        Owner:
           Type:  enhancement        |       Status:  needs_work
       Priority:  minor              |    Milestone:  sage-6.4
      Component:  misc               |   Resolution:
       Keywords:  docstring,         |    Merged in:
  preparse                           |    Reviewers:  Jeroen Demeyer
        Authors:  Johan S. R.        |  Work issues:
  Nielsen                            |       Commit:
Report Upstream:  N/A                |  6d8a3303e88859a78a3809d7dc12bcff4306440f
         Branch:                     |     Stopgaps:
  u/jsrn/ticket/17019                |
   Dependencies:                     |
-------------------------------------+-------------------------------------
Changes (by jsrn):

 * status:  needs_info => needs_work
 * commit:  86350b34b6c40240becb3a4adfc9025fbaba4386 =>
     6d8a3303e88859a78a3809d7dc12bcff4306440f
 * type:  defect => enhancement


Old description:

> Running ./sage --preparse on a .sage produces a .py file such that this
> is a proper Python file. If the .sage file contains a module docstring,
> then this should be present as the module docstring of the resulting .py
> file. This means that no code-lines (non-comment, non-blank) may be added
> before this module docstring.
>
> There are some lines to handle this in sage-preparse. However, it is not
> handled properly, as a call to sage.misc.preparse.preparse_file earlier
> on might already then add some lines before the original docstring.

New description:

 Running ./sage --preparse on a .sage produces a .py file such that this is
 a proper Python file. If the .sage file contains a module docstring, then
 this should be present as the module docstring of the resulting .py file.
 This means that no code-lines (non-comment, non-blank) may be added before
 this module docstring.

 There are no doc-tests for this (and incidentally, also no doc-tests that
 sage --preparse respects the encoding line), and the way sage-preparse is
 currently written is quite fragile with respect to changes in called code
 (in sage.misc.preparser).

--

Comment:

 I'm sorry but I'm completely lost in these branches. I'm working on branch
 t/17019/ticket/17019 but if I try to push with '''git push trac
 t/17019/ticket/17019''', I get the following error

 {{{
 Total 0 (delta 0), reused 0 (delta 0)
 remote: FATAL: W refs/heads/t/17019/ticket/17019 sage jsrn DENIED by
 fallthru
 remote: error: hook declined to update refs/heads/t/17019/ticket/17019
 To [email protected]:sage.git
  ! [remote rejected] t/17019/ticket/17019 -> t/17019/ticket/17019 (hook
 declined)
 error: failed to push some refs to '[email protected]:sage.git'
 }}}

 If I try to push with '''git trac push''', it works fine but pushes to
 '''u/jsrn/ticket/17019''', which doesn't seem to put my code into this
 ticket (but it does add the message "Branch changed from bla-bla-bla"
 which appears twice above).

 What do I do?
 ----
 New commits:
 
||[http://git.sagemath.org/sage.git/commit/?id=6d8a3303e88859a78a3809d7dc12bcff4306440f
 6d8a330]||{{{Put a constant in the test}}}||

--
Ticket URL: <http://trac.sagemath.org/ticket/17019#comment:25>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to