Code

Opened 5 years ago

Closed 5 years ago

Last modified 3 years ago

#10539 closed (fixed)

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

Reported by: waa 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 5 years ago.
sphinx.diff (4.2 KB) - added by simonb 5 years ago.

Download all attachments as: .zip

Change History (24)

comment:1 Changed 5 years ago by waa

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 5 years ago by Guilherme Gondim <semente@…>

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

comment:3 Changed 5 years ago by zgoda

  • Keywords 0.6 added; v0.6b1 removed

Same error with Sphinx 0.6 final.

comment:4 Changed 5 years ago by ramiro

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 5 years ago by ramiro

comment:5 Changed 5 years ago by ramiro

  • Has patch set
  • Owner changed from nobody to ramiro

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 follow-up: Changed 5 years ago by waa

  • Owner changed from ramiro to waa
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Accepted

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 5 years ago by waa

  • Owner changed from waa to ramiro
  • Status changed from assigned to new

Ops!

comment:8 in reply to: ↑ 6 ; follow-up: Changed 5 years ago by ramiro

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 5 years ago by waa

Replying to ramiro:
...

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

Changed 5 years ago by simonb

comment:10 Changed 5 years ago by simonb

Added alternative patch for latest sphinx

comment:11 Changed 5 years ago by mtredinnick

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 5 years ago by simonb

Patch will break earlier Sphinx versions. Making it tepid?

comment:13 Changed 5 years ago by jezdez

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

comment:14 Changed 5 years ago by ramiro

See also #10707

comment:15 Changed 5 years ago by Karpuscul

  • Owner changed from ramiro to Karpuscul
  • Status changed from new to assigned
  • Triage Stage changed from Accepted to Ready 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 5 years ago by dgl

Thanks ramiro, works great on svn10755.

comment:17 Changed 5 years ago by tolano

  • Cc aribao@… added

comment:18 Changed 5 years ago by ramiro

  • Summary changed from Sphinx error: Could not import extension djangodocs, when running sphinx v0.6b1 to Sphinx error: Could not import extension djangodocs, when running Sphinx >= 0.6

comment:19 Changed 5 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 5 years ago by ericholscher

  • milestone set to 1.1

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

comment:21 Changed 5 years ago by russellm

  • Resolution set to fixed
  • Status changed from assigned to closed

(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 3 years ago by jacob

  • milestone 1.1 deleted

Milestone 1.1 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.