How to derive import dependency structure

Skip Montanaro skip at pobox.com
Fri Sep 21 09:37:36 EDT 2001


    Harald> Let B.py be imported by A.py which generates --- in a very time
    Harald> consuming process --- some data structure A.dat.

    Harald>          import         generate
    Harald>    B.py --------> A.py ----------> A.data

    Harald> Currently A.dat is only generated if A.py is newer, but this is
    Harald> not enough since A.dat must also be generated, if B.py is
    Harald> changed.

Sounds like make dependencies to me:

    A.data : B.py A.py
        python B.py             # writes A.data by side effect 

If make isn't an option, perhaps distutils will do the trick.

-- 
Skip Montanaro (skip at pobox.com)
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list