Opened 13 years ago

Closed 12 years ago

#4224 closed (wontfix)

First attempt at inter-app dependency tracking

Reported by: Tim Chase <django.ticket@…> Owned by: nobody
Component: Metasystem Version: master
Severity: Keywords: dependency, INSTALLED_APPS,
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I used a multi-map scheme to track inter-app dependencies. A single function (dependency_track) walks through a list of desired app names (SPECIFIED_APPS) and looks up the dependencies in the multi-map (DEPENDENCIES). Each app and its dependencies (and their sub-dependencies, and their sub-sub-dependencies, ad infinitum) are added to a set() object which is finally returned as a tuple() that can be appended to the INSTALLED_APPS setting to add all the desired modules. My original post to Django Users:

where Simon G. suggested that I post it as a ticket. He mentioned that inter-module dependency-tracking had been discussed on the Django Developers list previously:

I don't know if this addresses any/all of the issues in that thread. The proposed solution there was some tuple of dict()s where each dict had the same pair of name/module which sounds a lot to me like a multi-map would do the job.

This currently requires that module dependency be tracked in a single file (I use rather than having each app track its own dependencies. However, it wouldn't be too hard to extend this scheme to walk through each of the apps listed in the SPECIFIED_APPS and check for a pre-defined property (the dependency multi-map) and then build a master DEPENDENCIES multi-map from that source. I haven't thought hard about which way would be better to do it (tracking in a single file, or sniffing each of the modules for a pre-defined property and building up dependencies that way).

It also doesn't try to import them to verify that the proj.appname is a valid module. But Django will holler if they're not availble when it needs them.

Feel free to use it or ignore it. I'm not sure if "Metasystem" is quite the right component, but it seemed the most fitting.

Attachments (1) (1.0 KB) - added by Tim Chase <django.ticket@…> 13 years ago.
A sample that includes the dependency tracking code

Download all attachments as: .zip

Change History (3)

Changed 13 years ago by Tim Chase <django.ticket@…>

Attachment: added

A sample that includes the dependency tracking code

comment:1 Changed 13 years ago by Simon G. <dev@…>

Has patch: set
Triage Stage: UnreviewedDesign decision needed

Thanks Tim.

comment:2 Changed 12 years ago by Malcolm Tredinnick

Resolution: wontfix
Status: newclosed

I don't think this is solving any particular problem we have at the moment, so I'll wontfix for now.

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