sort the given list of items by dependency. 'tuples' is a list of tuples representing a partial ordering. deterministic_order is no longer used, the order is now always deterministic given the order of "allitems". the flag is there for backwards compatibility with Alembic.
(
tuples: Collection[Tuple[_T, _T]],
allitems: Collection[_T],
deterministic_order: bool = True,
)
| 56 | |
| 57 | |
| 58 | def sort( |
| 59 | tuples: Collection[Tuple[_T, _T]], |
| 60 | allitems: Collection[_T], |
| 61 | deterministic_order: bool = True, |
| 62 | ) -> Iterator[_T]: |
| 63 | """sort the given list of items by dependency. |
| 64 | |
| 65 | 'tuples' is a list of tuples representing a partial ordering. |
| 66 | |
| 67 | deterministic_order is no longer used, the order is now always |
| 68 | deterministic given the order of "allitems". the flag is there |
| 69 | for backwards compatibility with Alembic. |
| 70 | |
| 71 | """ |
| 72 | |
| 73 | for set_ in sort_as_subsets(tuples, allitems): |
| 74 | yield from set_ |
| 75 | |
| 76 | |
| 77 | def find_cycles( |
nothing calls this directly
no test coverage detected