Opened 10 years ago

Closed 10 years ago

#21400 closed Bug (fixed)

The downloadable documentation displays the wrong version

Reported by: Baptiste Mispelon Owned by: nobody
Component: * 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


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.


Attachments (2)

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

Download all attachments as: .zip

Change History (12)

comment:1 Changed 10 years ago by anonymous

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 Changed 10 years ago by Claude Paroz

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/"

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/ file and eval its VERSION line.

Changed 10 years ago by Claude Paroz

Attachment: 21400.diff added

Getting VERSION from current tree

comment:3 Changed 10 years ago by Claude Paroz

Has patch: set

comment:4 Changed 10 years ago by Tim Graham

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:


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

comment:5 Changed 10 years ago by Ramiro Morales

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

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

Last edited 10 years ago by Ramiro Morales (previous) (diff)

comment:6 Changed 10 years ago by Tim Graham

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?

Changed 10 years ago by Tim Graham

Attachment: 21400.2.diff added

comment:7 Changed 10 years ago by Tim Graham

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 Changed 10 years ago by Ramiro Morales

Tim, What do you think about this one instead?

comment:9 Changed 10 years ago by Tim Graham

Triage Stage: AcceptedReady for checkin

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

comment:10 Changed 10 years ago by Tim Graham

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top