Opened 8 years ago

Closed 7 years ago

Last modified 5 years ago

#10539 closed (fixed)

Sphinx error: Could not import extension djangodocs, when running Sphinx >= 0.6

Reported by: Wiliam Alves de Souza Owned by: Karpuscul
Component: Documentation Version: master
Severity: Keywords: sphinx 0.6
Cc: wiliamsouza83@…, aribao@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

See error below:

waa@waa:~/svn/django/branches/release/1.0.X/docs$ make html

mkdir -p _build/html _build/doctrees
sphinx-build -b html -d _build/doctrees . _build/html
Running Sphinx v0.6b1
/home/waa/svn/django/branches/release/1.0.X/docs/_ext/djangodocs.py:9: DeprecationWarning: The sphinx.builder module is deprecated; please import builders from the respective sphinx.builders submodules.

import sphinx.builder

Extension error:
Could not import extension djangodocs (exception: No module named htmlwriter)
make: * [html] Error 1

Attachments (2)

10539-sphinx06-compatibility.diff (4.9 KB) - added by Ramiro Morales 8 years ago.
sphinx.diff (4.2 KB) - added by Simon Blanchard 8 years ago.

Download all attachments as: .zip

Change History (24)

comment:1 Changed 8 years ago by Wiliam Alves de Souza

Sphinx v0.6b1 is a beta version, the sphinx developers have planned to release its as a final version soon.

http://groups.google.com/group/sphinx-dev/browse_thread/thread/e00a453922c90b9a

comment:2 Changed 8 years ago by Guilherme Gondim <semente@…>

I have the same problem with Sphinx 0.6b1 on Ubuntu 8.10.

comment:3 Changed 8 years ago by Jarek Zgoda

Keywords: 0.6 added; v0.6b1 removed

Same error with Sphinx 0.6 final.

comment:4 Changed 8 years ago by Ramiro Morales

There is no pressing need to use Sphinx 0.6, 0.5 is supported and can be downloaded and used instead (0.5.2 was released the same day as 0.6) especially considering that Django documentation isn't exposing any Sphinx bug and it doesn't take advantages of new 0.6 features.

I have patches for the code problems, remaining problems seem to be template-related ones (Sphinx 0.6 introduces usage of Jinja 2). If/when I get around these without breaking compatibility with previous Sphinx versions, will upload a patch.

Changed 8 years ago by Ramiro Morales

comment:5 Changed 8 years ago by Ramiro Morales

Has patch: set
Owner: changed from nobody to Ramiro Morales

Attached patch implements changes that make it possible to build the documentation with Sphinx 0.6.1 and maintaining compatibility with Sphinx back to 0.4 (tested using make html with 0.4, 0.4.3, 0.5.2 and 0.6).

comment:6 Changed 8 years ago by Wiliam Alves de Souza

Owner: changed from Ramiro Morales to Wiliam Alves de Souza
Status: newassigned
Triage Stage: UnreviewedAccepted

Ramiro,
I can't apply this patch for tests propose if it not in svn diff format! or you can point me some technique to do that without edit the patch manually.

From http://docs.djangoproject.com/en/dev/internals/contributing/?from=olddocs:

Submit patches in the format returned by the svn diff command. An exception is for code changes that are described more clearly in plain English than in code. Indentation is the most common example; it’s hard to read patches when the only difference in code is that it’s indented.

comment:7 Changed 8 years ago by Wiliam Alves de Souza

Owner: changed from Wiliam Alves de Souza to Ramiro Morales
Status: assignednew

Ops!

comment:8 in reply to:  6 ; Changed 8 years ago by Ramiro Morales

Replying to waa:

... or you can point me some technique to do that without edit the patch manually.

Sure, just apply it with patch -p1, it's in Git diff format, generated from Mercurial:

$ ls
AUTHORS  django  docs  examples  extras  INSTALL  LICENSE  MANIFEST.in  README  scripts  setup.cfg  setup.py  tests
$ cat /path/to/10539-sphinx06-compatibility.diff | patch -p1
patching file docs/_ext/djangodocs.py
patching file docs/_templates/layout.html

From http://docs.djangoproject.com/en/dev/internals/contributing/?from=olddocs:

Submit patches in the format returned by the svn diff command. An exception is for code changes that are described more clearly in plain English than in code. Indentation is the most common example; it’s hard to read patches when the only difference in code is that it’s indented.

You forgot to cite the paragraph inmediately next:

Patches in git diff format are also acceptable.

comment:9 in reply to:  8 Changed 8 years ago by Wiliam Alves de Souza

Replying to ramiro:
...

Thanks for your attention!!!
I'm really forgot that :(

Changed 8 years ago by Simon Blanchard

Attachment: sphinx.diff added

comment:10 Changed 8 years ago by Simon Blanchard

Added alternative patch for latest sphinx

comment:11 Changed 8 years ago by Malcolm Tredinnick

The latest patch makes a bunch of what appear to be fairly unconditional (non version-dependent) changes. Has it been tested to run with earlier versions of Sphinx? Forcing everybody to upgrade to the latest version isn't cool.

comment:12 Changed 8 years ago by Simon Blanchard

Patch will break earlier Sphinx versions. Making it tepid?

comment:13 Changed 8 years ago by Jannis Leidel

Unless I'm completely blind the first patch does what the latest patch does without breaking old versions.

comment:14 Changed 8 years ago by Ramiro Morales

See also #10707

comment:15 Changed 8 years ago by Karpuscul

Owner: changed from Ramiro Morales to Karpuscul
Status: newassigned
Triage Stage: AcceptedReady for checkin

Guys,

Just now downloaded sphinx v0.6.1 (the latest official version at this moment), applied ramiro's patch using SVN-diff (just added indexing information to the file to do that), and tested. It works perfectly!

When will it be checked in? It is really needed if you want that users can built Django's documents locally.

Oleg Sakharov.

comment:16 Changed 8 years ago by dgl

Thanks ramiro, works great on svn10755.

comment:17 Changed 8 years ago by Adrian Ribao

Cc: aribao@… added

comment:18 Changed 7 years ago by Ramiro Morales

Summary: Sphinx error: Could not import extension djangodocs, when running sphinx v0.6b1Sphinx error: Could not import extension djangodocs, when running Sphinx >= 0.6

comment:19 Changed 7 years ago by Ryan

As it stands, the documentation available at (http://docs.djangoproject.com/en/dev/internals/documentation/#internals-documentation) in regards to building the documentation locally is wrong. With the latest version of Sphinx available from easy_install (0.6.2 at the time of writing), running "make html" will cause it to exit with said error.

However after applying (10539-sphinx06-compatibility.diff), everything works perfectly (at least with Sphinx v0.6.2).

comment:20 Changed 7 years ago by Eric Holscher

milestone: 1.1

Just confirmed this, 1.1 shouldn't ship with broken docs.

comment:21 Changed 7 years ago by Russell Keith-Magee

Resolution: fixed
Status: assignedclosed

(In [11162]) Fixed #10539 -- Updated Sphinx configuration to accommodate 0.6 while retaining compatibility with 0.4 and 0.5. Thanks to Ramiro Morales for the patch.

comment:22 Changed 5 years ago by Jacob

milestone: 1.1

Milestone 1.1 deleted

Note: See TracTickets for help on using tickets.
Back to Top