Flatten requirements eagerly in get_dependencies
#4430
+231
−284
Merged