Opened 17 years ago

Closed 16 years ago

#4224 closed (wontfix)

First attempt at inter-app dependency tracking

Reported by: Tim Chase <django.ticket@…> Owned by: nobody
Component: Metasystem Version: dev
Severity: Keywords: dependency, INSTALLED_APPS, settings.py
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

Description

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:

http://groups.google.com/group/django-users/browse_thread/thread/c6ee8c5563bd1090/

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:

http://groups.google.com/group/django-developers/msg/be076ab6855b9b9f

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

django_deps.py (1.0 KB ) - added by Tim Chase <django.ticket@…> 17 years ago.
A sample settings.py that includes the dependency tracking code

Download all attachments as: .zip

Change History (3)

by Tim Chase <django.ticket@…>, 17 years ago

Attachment: django_deps.py added

A sample settings.py that includes the dependency tracking code

comment:1 by Simon G. <dev@…>, 17 years ago

Has patch: set
Triage Stage: UnreviewedDesign decision needed

Thanks Tim.

comment:2 by Malcolm Tredinnick, 16 years ago

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