Assume we have 4 stages:
- Stages
0 and 2 depend on the function foo
- Stages
1 and 3 depend on the function bar
In order to reduce code duplication we want to put the utilities foo and bar in one place; let them be in utils.py. So, utils.py becomes a dependency of all four stages.
Now... after some time we realize we have to update something in bar. So we edit utils.py. This, in turn, invalidate all stages. Obviously, a simple solution is to have utils_0_2.py which will be a dependency of 0 and 2 and similarly utils_1_3.py. But this solution conflicts with good practices of coding.
A possible solution could be to adopt some notation like the one used in pytest and specify the function inside utils.py. For example, something like:
deps:
- md5: 409a438ee6ac70fc1f911631412325ea
path: utils.py::foo
This is a continuation of this discussion.
Assume we have 4 stages:
0and2depend on the functionfoo1and3depend on the functionbarIn order to reduce code duplication we want to put the utilities
fooandbarin one place; let them be inutils.py. So,utils.pybecomes a dependency of all four stages.Now... after some time we realize we have to update something in
bar. So we editutils.py. This, in turn, invalidate all stages. Obviously, a simple solution is to haveutils_0_2.pywhich will be a dependency of0and2and similarlyutils_1_3.py. But this solution conflicts with good practices of coding.A possible solution could be to adopt some notation like the one used in
pytestand specify the function insideutils.py. For example, something like:This is a continuation of this discussion.