Skip to content
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

Allow injecting tasks as dependents #188

Closed
arcivanov opened this issue Sep 12, 2015 · 4 comments · Fixed by #258 or #260
Closed

Allow injecting tasks as dependents #188

arcivanov opened this issue Sep 12, 2015 · 4 comments · Fixed by #258 or #260
Assignees
Milestone

Comments

@arcivanov
Copy link
Member

Currently when you add a @task you're limited in flexibility in where you can add it.

Unless the new task follows core plugin graph and extends a particular existing task or is invoked as a top-level task, there is no way to do this:

  • Given a graph of B->A and top-level B I want C to be dependent on A and become a dependency of B.

This would allow 3rd party plugins to augment the build graph (such as header check plugin) without the user having to add top-level tasks. I.e. pyb publish with an injection of a header check plugin will result in a header check plugin executing a task without having to specify pyb check_headers publish.

All circularity/resolution check enforcements should, naturally, stay in force.

A new construct such as @dependent("task_a", "task_b", optional("task_c", "task_d")) will be introduced.

@arcivanov arcivanov self-assigned this Sep 12, 2015
@arcivanov
Copy link
Member Author

@mriehl review please

@mriehl
Copy link
Member

mriehl commented Sep 12, 2015

Neat idea, bear with me for a few hours. I'll review today.

@mriehl
Copy link
Member

mriehl commented Sep 12, 2015

I'd change the name though, I think @needed_by('task_a') is more readable. Very much 👍 on the general idea, this would improve the dependency capabilities for sure.

@arcivanov
Copy link
Member Author

I was thinking of it as:

@task
@depends("task_a", optional("task_b"))
@dependent("task_c", optional("task_d"))
def new_plugin_task():
     pass

I.e. create depends / dependent cadence.

@arcivanov arcivanov modified the milestone: v0.11.2 Sep 23, 2015
@mriehl mriehl modified the milestones: v0.11.3, v0.11.2 Oct 21, 2015
arcivanov added a commit to arcivanov/pybuilder that referenced this issue Nov 20, 2015
@arcivanov arcivanov reopened this Nov 20, 2015
arcivanov added a commit to arcivanov/pybuilder that referenced this issue Nov 20, 2015
arcivanov added a commit to arcivanov/pybuilder that referenced this issue Nov 20, 2015
arcivanov added a commit to arcivanov/pybuilder that referenced this issue Nov 20, 2015
arcivanov added a commit to arcivanov/pybuilder that referenced this issue Nov 20, 2015
arcivanov added a commit to arcivanov/pybuilder that referenced this issue Nov 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants