Python-action: detect which dependencies changed and which targets are missing
See original GitHub issueEssentially need to get the same information in a python-action as provided by doit info
on the console.
I need this to process only those dependencies of the task which have changed.
What I’ve tried:
def my_action(task):
print(task.dep_changed)
However this will print all the dependencies, no matter what. I guess it is related to this comment in the code:
# dep_changed is set on get_status()
# Some commands (like `clean` also uses expand_args but do not
# uses get_status, so `changed` is not available.
And need the missing targets as well, those seem to be separate from dep_changed in doit info
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
pydoit task dependency system support
Note that since a target represents an output of the task, a missing target is enough to determine that a task is not...
Read more >Make dependency with existing target and missing dependency
Is there any way ? I found the solution of using an empty rule. D : at the end, so that missing D...
Read more >native_client/src/third_party/scons-2.0.1 - Git at Google
+ + - Add sources for files whose targets don't exist in $CHANGED_SOURCES. + + - Detect implicit dependencies on commands even when...
Read more >SCons 4.4.0
What Dependencies Does SCons Know About? the --tree Option; 28.4. ... which will then run SCons for each target created by a Python...
Read more >Dependency Checking: make vs. Shell Scripts
Because make does a complete dependency scan, changes to a source file are ... it begins the dependency check with the first target...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@smarie Thank you! This helper is exactly what I needed.
Also concerning the other topic in this ticket: I had the issue today to try to debug “why did a task run again ??? It should not”.
Being able to print to stdout the reason why tasks are run (dependency change or file dep change or target change) using a simple commandline flag (for example a maven-style flag
doit -X
or a pytest-styledoit -v
) would really be a killer feature - if it is not already there (in which case it should probably be highlighted in the doc in a better way). Should we open a ticket for this in particular ?EDIT: for what’s worth, my current workaround for this is to use the following
why_am_i_running
python action explicitly at the beginning of all my task actions lists:EDIT2: There might be a case missing in this draft: the case where
result_dep
is the reason for re-running.