Django

Code

Ticket #10539 (closed: fixed)

Opened 1 year ago

Last modified 9 months ago

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

Reported by: waa Assigned to: Karpuscul
Milestone: 1.1 Component: Documentation
Version: SVN Keywords: sphinx 0.6
Cc: wiliamsouza83@gmail.com, aribao@gmail.com Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

10539-sphinx06-compatibility.diff (4.9 kB) - added by ramiro on 03/29/09 18:07:54.
sphinx.diff (4.2 kB) - added by simonb on 04/10/09 01:21:41.

Change History

03/18/09 15:25:08 changed by waa

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

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

03/20/09 17:50:05 changed by Guilherme Gondim <semente@taurinus.org>

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

03/24/09 18:12:51 changed by zgoda

  • keywords changed from sphinx v0.6b1 to sphinx 0.6.

Same error with Sphinx 0.6 final.

03/25/09 06:43:47 changed 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.

03/29/09 18:07:54 changed by ramiro

  • attachment 10539-sphinx06-compatibility.diff added.

03/29/09 18:22:09 changed by ramiro

  • owner changed from nobody to ramiro.
  • has_patch set to 1.

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).

(follow-up: ↓ 8 ) 03/30/09 06:51:40 changed by waa

  • owner changed from ramiro to waa.
  • status changed from new to assigned.
  • 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.

03/30/09 06:52:47 changed by waa

  • owner changed from waa to ramiro.
  • status changed from assigned to new.

Ops!

(in reply to: ↑ 6 ; follow-up: ↓ 9 ) 03/30/09 07:32:58 changed 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.

(in reply to: ↑ 8 ) 03/30/09 10:49:04 changed by waa

Replying to ramiro: ...

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

04/10/09 01:21:41 changed by simonb

  • attachment sphinx.diff added.

04/10/09 01:22:43 changed by simonb

Added alternative patch for latest sphinx

04/10/09 01:26:42 changed 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.

04/10/09 01:30:57 changed by simonb

Patch will break earlier Sphinx versions. Making it tepid?

04/10/09 06:38:57 changed by jezdez

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

05/02/09 14:51:50 changed by ramiro

See also #10707

05/03/09 05:00:03 changed by Karpuscul

  • owner changed from ramiro to Karpuscul.
  • status changed from new to assigned.
  • 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.

05/13/09 08:27:55 changed by dgl

Thanks ramiro, works great on svn10755.

05/19/09 14:08:39 changed by tolano

  • cc changed from wiliamsouza83@gmail.com to wiliamsouza83@gmail.com, aribao@gmail.com.

06/20/09 11:21:20 changed 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.

06/20/09 20:01:44 changed 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).

06/30/09 17:14:04 changed by ericholscher

  • milestone set to 1.1.

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

07/03/09 00:40:47 changed by russellm

  • status changed from assigned to closed.
  • resolution set to fixed.

(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.


Add/Change #10539 (Sphinx error: Could not import extension djangodocs, when running Sphinx >= 0.6)




Change Properties
Action