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

sage -docbuild DOC FORMAT should do better error checking on DOC #6605

Closed
jhpalmieri opened this issue Jul 23, 2009 · 11 comments
Closed

sage -docbuild DOC FORMAT should do better error checking on DOC #6605

jhpalmieri opened this issue Jul 23, 2009 · 11 comments

Comments

@jhpalmieri
Copy link
Member

If I run sage -docbuild hello html, then a directory "hello" is created in SAGE_ROOT/devel/sage/doc/en. Then if I run sage -docbuild -help, "hello" is listed as one of the options.

Error-checking should be done on the "document" argument of sage -docbuild to make sure this doesn't happen.

Component: documentation

Author: John Palmieri

Reviewer: Mitesh Patel

Merged: sage-4.2.alpha0

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

@jhpalmieri
Copy link
Member Author

Author: John Palmieri

@jhpalmieri
Copy link
Member Author

comment:1

As written, this depends on #6187 (although it would be easy enough to modify it to avoid this). The new OMIT variable is for situations such as the one introduced by #5653, where there is a subdirectory "introspect" of SAGE_ROOT/doc/en/, which is not a document to be processed by "sage -docbuild", and so should be omitted from the list of all such documents. (This patch doesn't depend on #5653, but it will be compatible with it, should #5653 be merged.)

@qed777
Copy link
Mannequin

qed777 mannequin commented Jul 24, 2009

comment:2

The patch works for me. I think a non-zero exit value is the UNIX convention for an error. I can make an updated patch. Or I can wait for more feedback on #6187.

Notes for other potential tickets:

  • We could also print a similar message in the less severe case of an invalid format.
  • Instead of using sys.exit(), we could raise (and catch) some exception, so that the builder can loop over documents, formats, and commands, printing warnings as necessary. At the moment, though, this feature is not implemented.

@jhpalmieri
Copy link
Member Author

comment:3

Attachment: trac_6605-docbuild-check.patch.gz

This patch is identical, except it uses sys.exit(1) instead of sys.exit(0).

@qed777
Copy link
Mannequin

qed777 mannequin commented Jul 24, 2009

Reviewer: Mitesh Patel

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jul 24, 2009

Merged: Sage 4.1.1.alpha1

@sagetrac-mvngu sagetrac-mvngu mannequin closed this as completed Jul 24, 2009
@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jul 26, 2009

comment:6

The patch applies but with fuzz:

[mvngu@sage sage-main]$ hg qimport https://github.com/sagemath/sage-prod/files/10645654/trac_6605-docbuild-check.patch.gz && hg qpush
adding trac_6605-docbuild-check.patch to series file
applying trac_6605-docbuild-check.patch
patching file doc/common/builder.py
Hunk #3 succeeded at 614 with fuzz 1 (offset -44 lines).
Now at: trac_6605-docbuild-check.patch

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jul 27, 2009

comment:7

The patch trac_6605-docbuild-check.patch is buggy when it comes to (re)building the documentation of a new release. Assume you have applied this patch to Sage 4.1.1.alpha0, then build a source release with

sage -sdist <version>

or a binary release with

sage -bdist <version>

After that, upgrade a previous release to this new release and rebuild the documentation. You then get this error message:

[mvngu@sage sage-4.1.1.alpha1-test-x86_64-Linux]$ ./sage -docbuild tutorial htmlTraceback (most recent call last):
  File "/scratch/mvngu/sage-4.1.1.alpha1-test-x86_64-Linux/devel/sage/doc/common/builder.py", line 673, in <module>
    getattr(get_builder(name), type)()
  File "/scratch/mvngu/sage-4.1.1.alpha1-test-x86_64-Linux/devel/sage/doc/common/builder.py", line 616, in get_builder
    elif name in get_documents() or name in AllBuilder().get_all_documents():
NameError: global name 'get_documents' is not defined

The same error is raised if you rebuild the documentation of the binary version of the new release. I'm reopening this ticket and marking it as needs work.

@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jul 27, 2009

Changed merged from Sage 4.1.1.alpha1 to none

@sagetrac-mvngu sagetrac-mvngu mannequin added the s: needs work label Jul 27, 2009
@sagetrac-mvngu sagetrac-mvngu mannequin reopened this Jul 27, 2009
@sagetrac-mvngu sagetrac-mvngu mannequin removed the s: needs work label Jul 27, 2009
@jhpalmieri
Copy link
Member Author

comment:8

It doesn't need work. As I mentioned in the first comment, it depends on #6187. That's where "get_documents" is defined.

Please wait for #6187 to merge.

@mwhansen
Copy link
Contributor

Merged: sage-4.2.alpha0

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

2 participants