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

issues on handling multiple matches delayed target regex #60

Closed
2 tasks done
schettino72 opened this issue Jun 12, 2015 · 8 comments
Closed
2 tasks done

issues on handling multiple matches delayed target regex #60

schettino72 opened this issue Jun 12, 2015 · 8 comments
Labels
Milestone

Comments

@schettino72
Copy link
Member

Refers to tasks missing from PR #58

  • need docs
  • when --auto-delayed-regex is used, if a target that doesnt exist (or a typo) is passed in the command, it will be silently ignored. It should raise an error saying the target/task/command doesnt exist
@schettino72 schettino72 added this to the 0.29 milestone Jun 12, 2015
@felixfontein
Copy link
Contributor

Isn't the second also true when --auto-delayed-regex is not used?

@schettino72
Copy link
Member Author

Isn't the second also true when --auto-delayed-regex is not used?

Right, it happens as long as the typo matches a regex. With --auto-delayed-regex it always match a regex...

@felixfontein
Copy link
Contributor

I'm not sure if you are aware of this, but the current version still builds too much in some situations. Consider the dodo file (slight modification of doc/tutorial/delayed.py):

import glob

from doit import create_after

@create_after(executed='early', target_regex='.*\.out')
def task_build():
    for inf in glob.glob('*.in'):
        yield {
            'name': inf,
            'actions': ['cp %(dependencies)s %(targets)s'],
            'file_dep': [inf],
            'targets': [inf[:-3] + '.out'],
            'clean': True,
        }

@create_after(executed='build', target_regex='.*')
def task_final():
    return {
        'actions': ['cp a.out a.out.2'],
        'file_dep': ['a.out'],
        'targets': ['a.out.2'],
        'clean': True,
    }

def task_early():
    """a task that create some files..."""
    inter_files = ('a.in', 'b.in', 'c.in')
    return {
        'actions': ['touch %(targets)s'],
        'targets': inter_files,
        'clean': True,
    }

will build a.in, a.out, b.in, b.out, c.in and c.out when running doit run c.out.

schettino72 added a commit that referenced this issue Jun 16, 2015
@schettino72
Copy link
Member Author

@felixfontein I guess this finally completed. Please check again everything is working as expected.
Thanks for your patience and work on pushing for this feature.

@felixfontein
Copy link
Contributor

Cool! Thanks a lot for implementing most parts of this feature! :)
A quick test also showed that it seems to work as expected. Since there weren't big changes since the last branch I've been using extensively, I guess it should be good by now.

@felixfontein
Copy link
Contributor

Oh, one thing (completely unrelated!) which I just noticed: if I run nikola build bla and it cannot build bla, it complains with

ERROR: cmd `run` invalid parameter: "bla". Must be a task, or a target.
Type "doit list" to see available tasks

Obviously, running doit list won't help, and the command I used wasn't run but build. I know that why this is and how to correctly interpret this because I know how doit and Nikola interact, but I can guess that some Nikola users will be completely confused by this error message. What do you think about a possibility to "adjust" these messages in some way?

@schettino72
Copy link
Member Author

What do you think about a possibility to "adjust" these messages in some way?

Sure. go ahead :D

@schettino72
Copy link
Member Author

I created a new issue to track this #71

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants