Closed edrex closed 10 years ago
This is unsafe, since the threshold function can put a file in common
but not its dependency, resulting in runtime module not found exception.
@substack, should this feature be made safe from the above issue?
Yes.
To make it safe, we will have to short-circuit the common
threshold to true
if any of the file's dependents are in common
. Looking at how that might be done.
I took a shot at fixing the issue with dependees being below the common
threshold when their dependents are above in 6c9f84d3ce2987ff610c26e4ba5e6b01ef92ca72 (outside this PR). It works partially, but (see included test) fails when a dependee is also present lower in the tree and happens to come before the dependent.
To make this work self._buffered
would need to be topologically sorted.
Seems to be getting too complicated. Ideas? Maybe trust the threshold function to grab dependees?
I think making the output of module-deps topologically sorted would allow this to work.
@substack that doesn't seem to do topological sort, just sorts by id (path).
Seems like having module-deps output topo sorted by default might be a nice property.
I did the sort locally which makes the test pass so I guess this is ready for review.
Maybe the sort should be pulled out into a deps-toposort module.
Looks good. Merged in 0.0.2.
oh whoops that should have been a minor version bump but too late now
implements #6