New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prelude and epilogue to dep. graph walks #6784

merged 1 commit into from Nov 19, 2018


None yet
2 participants

blorente commented Nov 16, 2018


It would be nice to execute code before and after children are visited in graph traversals. The context of this change is the implementation of Dependency Banning (#6541), and the propagation of constraints through the dependency graph.


Add optional prelude and epilogue function parameters to the dep. graph walk functions, that get executed right before visiting children. This should not incur any API or performance changes for existing code.


Calls like these are now possible:

a = self.make_target('a')
b = self.make_target('b', dependencies=[a])
names = []
    work=lambda x: names.append(,
    prelude=lambda x: names.append( + "-pre"),
     epilogue=lambda x: names.append( + "-epi"),
assertEqual(names, ['b', 'b-pre', 'a', 'a-pre', 'a-epi', 'b-epi'])

Blocks: #6541

@blorente blorente referenced this pull request Nov 16, 2018


[WIP] Implement dependency banning #6541

4 of 5 tasks complete

This comment has been minimized.


blorente commented Nov 17, 2018

I'm going to go ahead and ping @dotordogh and @illicitonion on this one, since it's green, ready for review and it's blocking another thing.


Looks great :) Thanks!

@illicitonion illicitonion merged commit 0176dc2 into pantsbuild:master Nov 19, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment