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
Make sure preparser for .sage files respects module docstrings #17019
Comments
Commit: |
comment:2
Since the patch is on a python file outside the usual Sage tree, I am not aware of doc-test rules etc. I wouldn't even know how to make a doctest for this (and there are no other doctests in sage-preparse). New commits:
|
comment:3
Replying to @johanrosenkilde:
There are doctest (even for |
comment:4
Also, you don't need an additional
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:6
Ok, I've added a doctest for this. |
comment:7
The Build-bot's doctests failing is in some numerical stability tests, and seem to have nothing to do with this patch. |
comment:8
Sorry to bother again, but you should rebase this over #16955. |
comment:9
...and instead of adding a completely new doctest, why not simply change the old test for |
comment:10
You removed support for |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:12
I tried to do the rebase, but the instructions in the documentation were not clear to me on this use-case. Did I do it right? I don't know what you mean with "removed support for I added a new doctest instead of making the old one bigger because I didn't want the old one to be too large and confusing (as it is, it is hard to read). In the new doc-test is an |
comment:13
Replying to @johanrosenkilde:
I guess so, at least I don't see anything obviously bad.
grep |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Changed branch from u/jsrn/ticket/17019 to u/jdemeyer/ticket/17019 |
comment:22
Replying to @johanrosenkilde:
I didn't say the changes were bad, in fact I do think they make sense. I only said that I could not check whether they solved the problem mentioned in this ticket. |
comment:23
Replying to @johanrosenkilde:
Then please push your branch... Also: can you update the ticket description please, since the problem is no longer applicable. |
Changed branch from u/jdemeyer/ticket/17019 to u/jsrn/ticket/17019 |
This comment has been minimized.
This comment has been minimized.
comment:25
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
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:
|
comment:26
Ok, now I'm really confused: with 6 minutes delay the commit came through??? Did I do it right or was I just lucky and abusive towards the system? |
comment:28
I'm reviving this: Sage has displayed the doc-mangling behaviour after preprocessing in more or less all releases since this ticket was last discussed, possibly except the one Jeroen tested on a year ago. I don't know why that was. At least, I've just tested that the doctest in this ticket fails if it's tested on the current beta, and that this patch fixes it. |
This comment has been minimized.
This comment has been minimized.
Changed reviewer from Jeroen Demeyer to Jeroen Demeyer, Volker Braun |
comment:30
Necro-review -- thanks! :-) |
Changed branch from u/jsrn/ticket/17019 to |
Changed commit from |
Changed author from Johan S. R. Nielsen to Johan Sebastian Rosenkilde Nielsen |
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 waysage-preparse
is currently written is quite fragile with respect to changes in called code (insage.misc.preparser
).Component: misc
Keywords: preparse
Author: Johan Sebastian Rosenkilde Nielsen
Branch:
f21f386
Reviewer: Jeroen Demeyer, Volker Braun
Issue created by migration from https://trac.sagemath.org/ticket/17019
The text was updated successfully, but these errors were encountered: