Opened 5 years ago

Last modified 9 days ago

#29942 assigned Bug

viewsource links to contrib.auth.forms not appearing

Reported by: Yemar Nevets Owned by: David Smith
Component: Documentation Version: dev
Severity: Normal Keywords:
Cc: Zach Borboa Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

Change History (20)

comment:1 by Tim Graham, 5 years ago

Component: UncategorizedDocumentation
Summary: URL is brokenviewsource links to contrib.auth.forms not appearing
Triage Stage: UnreviewedAccepted

It looks like the issue started in Django 1.9. I wonder if the imports changes in fe914341c83b37fd6aa8fd85620cf49dd2328ab0 may be at fault. I haven't looked into how sphinx.ext.viewcode works.

comment:2 by Prabakaran Kumaresshan, 5 years ago

Owner: changed from nobody to Prabakaran Kumaresshan
Status: newassigned

comment:3 by Hasan Ramezani, 4 years ago

Has patch: set
Owner: changed from Prabakaran Kumaresshan to Hasan Ramezani

It is not only contrib.auth.forms. here are the missing source code files list.

django/db/models/fields/related_descriptors.html
django/contrib/contenttypes/fields.html
django/contrib/contenttypes/admin.html
django/contrib/contenttypes/forms.html
django/contrib/contenttypes/models.html
django/contrib/admin/models.html
django/contrib/admin/apps.html
django/contrib/sessions/base_session.html
django/contrib/auth/validators.html
django/contrib/auth/views.html
django/contrib/auth/mixins.html
django/contrib/auth/middleware.html
django/contrib/auth/backends.html
django/contrib/auth/forms.html
django/contrib/auth/models.html
django/contrib/auth/base_user.html

from Sphinx viewcode extensions: Basically, viewcode extension will import the modules being linked to.

when Sphinx tries to do for example import django.contrib.auth.forms, it will get

django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

So, I created a PR to load the apps in https://github.com/django/django/blob/master/docs/conf.py. But the docs test failed. But in my local machine, it works and missed source files generated successfully.

I don't know this is a good solution or not. just a PR to start the discussion.

comment:4 by Mariusz Felisiak, 4 years ago

Patch needs improvement: set

comment:5 by Felix Hein, 19 months ago

Owner: changed from Hasan Ramezani to Felix Hein

comment:6 by Felix Hein, 19 months ago

I spent some time trying to understand this issue and the longer I think about it, the less clear it becomes to me which parts of the source code should be linked to and which shouldn't.
The list of linked modules at https://docs.djangoproject.com/en/dev/_modules/ is missing a lot of modules, which could well be intentional. (That list is the list of files generated by the viewcode extension, so it contains all the source code files that are linked to somewhere in the documentation, like here: https://docs.djangoproject.com/en/dev/ref/applications/#django.apps.AppConfig.)

The modules mentioned in this ticket have not been linked to for a long time (and thus their source code has not been included in the /_modules/.. section of the documentation for that same time). So is this maybe something that we do not actually want to link to?

Last edited 19 months ago by Felix Hein (previous) (diff)

comment:7 by Zach Borboa, 18 months ago

Cc: Zach Borboa added

comment:8 by Sarah Boyce, 12 months ago

Owner: changed from Felix Hein to Sarah Boyce
Patch needs improvement: unset

comment:9 by Natalia Bidart, 11 months ago

Triage Stage: AcceptedReady for checkin
Version: 2.1dev

comment:10 by Sarah Boyce, 11 months ago

Triage Stage: Ready for checkinAccepted

Updating the status to "Accepted" as edits have been pushed recently and need a review :)

comment:12 by Sarah Boyce, 11 months ago

Owner: changed from Sarah Boyce to Joachim Jablon

comment:13 by Mariusz Felisiak, 9 months ago

Patch needs improvement: set

comment:14 by Mariusz Felisiak, 6 months ago

Owner: Joachim Jablon removed
Status: assignednew

comment:15 by David Smith, 3 months ago

Owner: set to David Smith
Patch needs improvement: unset
Status: newassigned

comment:16 by Natalia Bidart, 2 months ago

Patch needs improvement: set

comment:17 by David Smith, 5 weeks ago

Patch needs improvement: unset

comment:18 by Natalia Bidart, 4 weeks ago

Needs tests: set
Patch needs improvement: set

Setting as patch needs improvements following review from yesterday.

comment:19 by David Smith, 2 weeks ago

Needs tests: unset
Patch needs improvement: unset

comment:20 by Natalia Bidart, 9 days ago

Patch needs improvement: set

Branch is pretty much ready for merge though there is a tiny pending detail about better error reporting when calling importlib.util.resolve_name(name=imported_path, package=module). Setting the needs improvement flag to track that item.

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