Skip to content
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 introspection with ? when doc source is not available #25786

Closed
saraedum opened this issue Jul 6, 2018 · 79 comments
Closed

Fix introspection with ? when doc source is not available #25786

saraedum opened this issue Jul 6, 2018 · 79 comments

Comments

@saraedum
Copy link
Member

saraedum commented Jul 6, 2018

Currently, introspection does not work in conda and Arch Linux (if the sagemath-doc package is not installed):

sage: ZZ?
…
/usr/lib/python2.7/site-packages/sage/misc/sagedoc.pyc in process_extlinks(s, embedded)
    497     oldpath = sys.path
    498     sys.path = [os.path.join(SAGE_DOC_SRC, 'common')] + oldpath
--> 499     from conf import extlinks
    500     sys.path = oldpath
    501     for key in extlinks:

ImportError: cannot import name extlinks

The problem is that src/doc/common/conf.py is not in the place that Sage expects.

I don't think that we should require the documentation configuration to be installed for Sage to work.

A docker image to play with this is being built here: https://gitlab.com/sagemath/dev/sage/pipelines/25262253

Depends on #25843

CC: @antonio-rojas @jdemeyer @slel

Component: documentation

Keywords: conda, Arch Linux, introspection

Work Issues: is the patchbot happy?

Author: Julian Rüth, Isuru Fernando

Branch/Commit: a401a17

Reviewer: Julian Rüth, Isuru Fernando, François Bissey

Issue created by migration from https://trac.sagemath.org/ticket/25786

@saraedum saraedum added this to the sage-8.3 milestone Jul 6, 2018
@saraedum
Copy link
Member Author

saraedum commented Jul 6, 2018

Branch: u/saraedum/25786

@jdemeyer
Copy link
Contributor

jdemeyer commented Jul 6, 2018

comment:2

Is this needs review?


New commits:

13958dbMove extlinks into the main Sage code

@jdemeyer
Copy link
Contributor

jdemeyer commented Jul 6, 2018

Commit: 13958db

@saraedum
Copy link
Member Author

saraedum commented Jul 6, 2018

comment:3

I had a comment in #24655 that src/doc/en/introspect is required as well…let's see if that's still the case.

@saraedum
Copy link
Member Author

saraedum commented Jul 6, 2018

comment:4

jdemeyer: No, I have not tested this yet. But feel free to give feedback if you know something about this :)

@saraedum
Copy link
Member Author

saraedum commented Jul 6, 2018

comment:5

See #25787 for a followup regarding the docker images.

@jdemeyer
Copy link
Contributor

jdemeyer commented Jul 6, 2018

comment:6

In any case, I agree with the idea behind the patch.

@jdemeyer
Copy link
Contributor

jdemeyer commented Jul 6, 2018

Author: Julian Rüth

@jdemeyer
Copy link
Contributor

jdemeyer commented Jul 6, 2018

Reviewer: Jeroen Demeyer

@saraedum
Copy link
Member Author

saraedum commented Jul 6, 2018

Work Issues: is the patchbot happy?

@saraedum
Copy link
Member Author

saraedum commented Jul 6, 2018

comment:9

So, if the patchbot and my tests are Ok, then this is a positive review?

@saraedum

This comment has been minimized.

@jdemeyer
Copy link
Contributor

jdemeyer commented Jul 6, 2018

comment:11

Replying to @saraedum:

So, if the patchbot and my tests are Ok, then this is a positive review?

Yes

@saraedum

This comment has been minimized.

@antonio-rojas
Copy link
Contributor

comment:13

This still doesn't allow introspection on Arch without having the doc sources installed, due to

    # Sphinx constructor: Sphinx(srcdir, confdir, outdir, doctreedir,
    # buildername, confoverrides, status, warning, freshenv).
    confdir = os.path.join(SAGE_DOC_SRC, 'en', 'introspect')

    open(os.path.join(srcdir, 'docutils.conf'), 'w').write(r"""
[parsers]
smart_quotes = no
""")
    doctreedir = os.path.join(srcdir, 'doctrees')
    confoverrides = {'html_context': {}, 'master_doc': 'docstring'}

    import sys
    old_sys_path = list(sys.path)  # Sphinx modifies sys.path
    sphinx_app = Sphinx(srcdir, confdir, srcdir, doctreedir, format,
                        confoverrides, None, None, True)
    sphinx_app.build(None, [rst_name])
    sys.path = old_sys_path

in misc/sphinxify.py

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 7, 2018

Branch pushed to git repo; I updated commit sha1. New commits:

0e5b29aFix sphinxify for introspection

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 7, 2018

Changed commit from 13958db to 0e5b29a

@saraedum
Copy link
Member Author

saraedum commented Jul 7, 2018

comment:15

arojas: Right, now it works for me. But probably the from common.conf import * is there for a reason and I should not simply delete it.

@jdemeyer
Copy link
Contributor

jdemeyer commented Jul 8, 2018

comment:16

I really prefer one ticket, one issue.

@jdemeyer
Copy link
Contributor

jdemeyer commented Jul 8, 2018

Changed work issues from is the patchbot happy? to split ticket

@saraedum
Copy link
Member Author

saraedum commented Jul 9, 2018

Changed work issues from split ticket to is the patchbot happy?

@saraedum
Copy link
Member Author

saraedum commented Jul 9, 2018

comment:18

Replying to @jdemeyer:

I really prefer one ticket, one issue.

I believe that this is one issue: "Fix introspection with ? in conda and ArchLinux". And even the solution can be seen as one thing: "Make Sage runtime not depend on documentation configuration."

@saraedum
Copy link
Member Author

saraedum commented Jul 9, 2018

comment:19

The patchbots report weird errors that seem unrelated to the changes here…let me try this out locally.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 16, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

5c63a80Fix mention of common/conf.py

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 16, 2019

Changed commit from 863d433 to 5c63a80

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 16, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

edd3ab4Replace conf.conf with conf

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 16, 2019

Changed commit from 5c63a80 to edd3ab4

@saraedum
Copy link
Member Author

Reviewer: Julian Rüth, Isuru Fernando

@saraedum
Copy link
Member Author

comment:49

@isuruf: Could you have a look at my latest changes? (That I did not test yet, because I have not built recent Sage…)

@saraedum
Copy link
Member Author

Changed author from Julian Rüth to Julian Rüth, Isuru Fernando

@saraedum
Copy link
Member Author

Changed work issues from failing doctests to is the patchbot happy?

@isuruf
Copy link
Member

isuruf commented Jul 16, 2019

comment:50

Looks good to me. Thanks

@kiwifb
Copy link
Member

kiwifb commented Jul 16, 2019

comment:51

There is strange stuff about lcalc in the branch. May be some rebasing is needed?

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 16, 2019

Changed commit from edd3ab4 to 2f528be

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 16, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

2f528beRevert lcalc changes

@saraedum
Copy link
Member Author

comment:53

Thanks fbissey. That should not have been here.

@isuruf
Copy link
Member

isuruf commented Jul 16, 2019

New commits:

5eec95aFix some pyflakes issues

@isuruf
Copy link
Member

isuruf commented Jul 16, 2019

Changed branch from u/saraedum/25786 to u/isuruf/25786

@isuruf
Copy link
Member

isuruf commented Jul 16, 2019

Changed commit from 2f528be to 5eec95a

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 16, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

a401a17More pyflakes fixes

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jul 16, 2019

Changed commit from 5eec95a to a401a17

@kiwifb
Copy link
Member

kiwifb commented Jul 16, 2019

comment:56

I think the patchbot is happy with it (the last run had a failure that should be unrelated). Anything to add or is it completely ready for review?

@isuruf
Copy link
Member

isuruf commented Jul 16, 2019

comment:57

Anything to add or is it completely ready for review?

Nothing to add. Ready for review

@kiwifb
Copy link
Member

kiwifb commented Jul 16, 2019

Changed reviewer from Julian Rüth, Isuru Fernando to Julian Rüth, Isuru Fernando, François Bissey

@kiwifb
Copy link
Member

kiwifb commented Jul 16, 2019

comment:58

Looks good to me :)

@vbraun
Copy link
Member

vbraun commented Jul 23, 2019

Changed branch from u/isuruf/25786 to a401a17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants