Opened 11 years ago

Closed 11 years ago

#21400 closed Bug (fixed)

The downloadable documentation displays the wrong version

Reported by: Baptiste Mispelon Owned by: nobody
Component: *.djangoproject.com Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If you download the HTML documentation for the dev version [1], you'll see that the title (both <title> and <h1>) say "Django 1.5.4 documentation" instead of the correct version.
The same thing happens on the 1.6 version but not on the 1.4 one (unsurprisingly, the 1.5 version has the correct title too).

It seems that the content of the documentation corresponds to the right version and only the title is wrong.

This might be related to #20469.

[1] https://docs.djangoproject.com/m/docs/django-docs-dev-en.zip

Attachments (2)

21400.diff (1.1 KB ) - added by Claude Paroz 11 years ago.
Getting VERSION from current tree
21400.2.diff (411 bytes ) - added by Tim Graham 11 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 by anonymous, 11 years ago

Off the cuff guess... the build environment is incorrect. Ie, the sphinx build was fed 1.6 source code, but was told the documentation version is 1.5.4.

comment:2 by Claude Paroz, 11 years ago

Repeating my comment on the duplicate #21394:
"As I can see, this is not a problem with the documentation version itself, but simply with the version number in the title. It might be caused by the way the release variable is defined in docs/conf.py."

I guess the release variable depends on the current Python path, because of from django import VERSION (assuming there are several versions of Django on the build server). To prevent this, we might have to open the relative ../django/__init__.py file and eval its VERSION line.

by Claude Paroz, 11 years ago

Attachment: 21400.diff added

Getting VERSION from current tree

comment:3 by Claude Paroz, 11 years ago

Has patch: set

comment:4 by Tim Graham, 11 years ago

Patch needs improvement: set

The patch doesn't work properly. For example, on the 1.6 branch, the VERSION is currently (1, 6, 2, 'alpha', 0) which cause the branch which returns pep386ver + '.dev' which is the version of Django we have on the server + '.dev'. We could continue to try to make this work, although it might be simpler just to revert this trick and the associated sys.path hack as I'm not sure it buys as a whole lot besides one less final to bump on each release:

373df56d36891b9ab1f88519bf9e8f3c0b3bb108
0b98ef632147a26f2430a3ede48d9e58983cc3ae

I'm going to leave a comment on Ramiro's original commit to get his input.

comment:5 by Ramiro Morales, 11 years ago

AFAICS the change (plus later fixups) is working (i.e doesn't show the wrong title) on:

For every Django doc version since 1.5 up to master.

I'd say the problem isn't with the code but rather with the docs build environment on our own servers (the ones in charge of creating the HTML tarball that shows the issue).

Is strange that even the code works correctly on extenal servers that use deployment/building/publishing techniques we don't have control over like the RTD ones.

Version 2, edited 11 years ago by Ramiro Morales (previous) (next) (diff)

comment:6 by Tim Graham, 11 years ago

Patch needs improvement: unset

The documentation builds on our server use the update_docs management command so the first version of Django that's imported is whatever we have the site deployed with (currently 1.5.4 it seems). I believe we need to reload the Django module after modifying sys.path earlier in the file in order to avoid getting that cached version of Django. It seems to work locally for me. What do you think?

by Tim Graham, 11 years ago

Attachment: 21400.2.diff added

comment:7 by Tim Graham, 11 years ago

Alternatively, we could revisit our approach of building all versions of the docs as part of one management command/Python process. See #20469 for another issue of state leaking between doc builds.

comment:8 by Ramiro Morales, 11 years ago

Tim, What do you think about this one instead? https://github.com/django/djangoproject.com/pull/70

comment:9 by Tim Graham, 11 years ago

Triage Stage: AcceptedReady for checkin

Works for me locally, let's give it a try.

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