Skip to content

Deduplication does not care with post constraint #298

@presidento

Description

@presidento

If a and b tasks has the same pre and post tasks and I run both of them, the post task runs usually in a wrong place. The expected/actual task orders are:

Command Expected Actual
invoke a b pre a b post pre a post b
invoke a b post pre a b post pre a post b
invoke pre a b post pre a b post pre a post b
invoke post a b post post pre a b post as expected 👍

With Invoke version: 0.11.1.

tasks.py

from invoke import task

@task
def pre(): print('pre')

@task
def post(): print('post')

@task(pre=[pre], post=[post])
def a(): print('a')

@task(pre=[pre], post=[post])
def b(): print('b')

Debug output

executor: Deduplicating tasks...
executor: <Task 'pre'>: ok
executor: <Call 'a', args: () kwargs: {}>: ok
executor: <Task 'post'>: ok <--------------------- ???
executor: <Task 'pre'>: skipping
executor: <Call 'b', args: () kwargs: {}>: ok
executor: <Task 'post'>: skipping <--------------- !!!
executor: Executing <Task 'pre'>
executor: Executing <Task 'a'> as a
executor: Executing <Task 'post'>
executor: Executing <Task 'b'> as b

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions