Django

Code

Ticket #13616 (closed: fixed)

Opened 3 months ago

Last modified 1 month ago

Sphinx error when building docs using Sphinx 1.0b1

Reported by: hvdklauw Assigned to: jezdez
Milestone: Component: Documentation
Version: SVN Keywords:
Cc: prigun@gmail.com Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description (Last modified by Alex)

When using the development version of Sphinx the docs no longer build.

$ make html
sphinx-build -b djangohtml -d _build/doctrees   . _build/html
Running Sphinx v1.0b1
loading pickled environment... not yet created
building [djangohtml]: targets for 187 source files that are out of date
updating environment: 187 added, 0 changed, 0 removed
/Users/hvdklauw/.virtualenvs/djangodev/src/django/docs/_ext/djangodocs.py:91: DeprecationWarning: xfileref_role is deprecated, use XRefRole
  xrefs = sphinx.roles.xfileref_role('ref', linktext, linktext, lineno, state)

Exception occurred:
  File "/Users/hvdklauw/.virtualenvs/djangodev/src/django/docs/_ext/djangodocs.py", line 103, in parse_version_directive
    env.note_versionchange(node['type'], node['version'], node, lineno)
AttributeError: BuildEnvironment instance has no attribute 'note_versionchange'
The full traceback has been saved in /var/folders/+f/+fg+tkaAEP4s9WIWJaIwc++++TI/-Tmp-/sphinx-err-EcMj2N.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
Either send bugs to the mailing list at <http://groups.google.com/group/sphinx-dev/>,
or report them in the tracker at <http://bitbucket.org/birkenfeld/sphinx/issues/>. Thanks!
make: *** [html] Error 1

Attachments

13616_1.diff (1.1 kB) - added by andrewsk on 05/26/10 17:04:25.
Allows to build docs with new Sphinx. It is better to use Sphinx==dev, because Sphinx==1.0b1 throws unicode exception at the end
13616_2.diff (1.6 kB) - added by andrewsk on 05/26/10 17:33:41.
Fixes DeprecationWarning? about xfileref_role
13616_3.diff (5.2 kB) - added by ramiro on 07/20/10 07:19:22.
Path fixing all Sphinx 1.0 compatibility quirks
13616_4.diff (5.7 kB) - added by ramiro on 07/23/10 12:19:11.

Change History

05/26/10 08:06:52 changed by Alex

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • description changed.
  • needs_tests changed.
  • needs_docs changed.

Cleaned up the formatting, please use preview in the future.

05/26/10 17:04:25 changed by andrewsk

  • attachment 13616_1.diff added.

Allows to build docs with new Sphinx. It is better to use Sphinx==dev, because Sphinx==1.0b1 throws unicode exception at the end

05/26/10 17:20:35 changed by andrewsk

  • cc set to prigun@gmail.com.
  • has_patch set to 1.

05/26/10 17:33:41 changed by andrewsk

  • attachment 13616_2.diff added.

Fixes DeprecationWarning? about xfileref_role

(follow-up: ↓ 4 ) 07/20/10 05:50:45 changed by lamby

Patch is not sufficient for me using sphinx 1.0~b1 due to the removal of BuildEnvionment?.reftargets:

dumping search index... done
dumping object inventory... done
writing templatebuiltins.js...

Exception occurred:
  File "/tmp/bp-build/Django-1.2.1/docs.debian/_ext/djangodocs.py", line 285, in finish
    xrefs = self.env.reftargets.keys()
AttributeError: BuildEnvironment instance has no attribute 'reftargets'
The full traceback has been saved in /tmp/sphinx-err-03UAZX.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
Either send bugs to the mailing list at <http://groups.google.com/group/sphinx-dev/>,
or report them in the tracker at <http://bitbucket.org/birkenfeld/sphinx/issues/>. Thanks!

(in reply to: ↑ 3 ; follow-up: ↓ 5 ) 07/20/10 07:17:50 changed by ramiro

Replying to lamby:

Patch is not sufficient for me using sphinx 1.0~b1 due to the removal of BuildEnvionment?.reftargets:

Please test 13616_3.diff that fixes issues with in-development Sphinx 1.0 and mainatns compatibility with older versions (tested with Sphing 0.5.2).

07/20/10 07:19:22 changed by ramiro

  • attachment 13616_3.diff added.

Path fixing all Sphinx 1.0 compatibility quirks

(in reply to: ↑ 4 ; follow-up: ↓ 7 ) 07/23/10 06:13:18 changed by richardb

Replying to ramiro:

Please test 13616_3.diff that fixes issues with in-development Sphinx 1.0 and mainatns compatibility with older versions (tested with Sphing 0.5.2).

Patch does not work for me? Getting same error as lamby:

writing templatebuiltins.js...

Exception occurred:
  File "/Users/richard/workspace/DjangoSVN/trunk/docs/_ext/djangodocs.py", line 295, in finish
    xrefs = self.env.reftargets.keys()
AttributeError: BuildEnvironment instance has no attribute 'reftargets'
etc...

This is with Sphinx v1.0b2.
I notice that patch 13616_3.diff does not include any reference to attribute 'reftargets' which no longer exists in Sphinx according to lamby - is this the correct patch?

07/23/10 09:51:18 changed by jezdez

FYI, After talking to Georg at the EuroPython? sprint, he gladly reintroduced the note_versionchange method and released it as part of 1.0.

07/23/10 12:19:11 changed by ramiro

  • attachment 13616_4.diff added.

(in reply to: ↑ 5 ) 07/23/10 12:21:44 changed by ramiro

Replying to richardb:

Patch does not work for me? Getting same error as lamby:

Sorry, you are right. That part of the build process wasn't being run for me because I hadn't simplejson installed on my virtualenv. Please test the _4 patch.

07/23/10 15:17:28 changed by andrewsk

There are couple problems with the patch

  1. Links "Please, see the release notes" became not clickable in docs generated with Sphinx 1.0
  2. Reftargets attribute in previous version of Sphinx contained various refs, so 'ttag' and 'tfilter' were extracted, and placed into "templatebuiltins.js" (see r13135). Citations dict on the other hand is empty, so generated "templatebuiltins.js" contains empty lists.

07/24/10 03:39:32 changed by jezdez

  • owner changed from nobody to jezdez.

07/24/10 05:19:40 changed by jezdez

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

(In [13445]) [1.2.X] Fixed #13616 - Updated the documentation to be compatible with Sphinx 1.0.

07/24/10 05:21:22 changed by jezdez

(In [13446]) Fixed #13616 - Updated the documentation to be compatible with Sphinx 1.0.


Add/Change #13616 (Sphinx error when building docs using Sphinx 1.0b1)




Change Properties
Action