# Best practices for specifying dependencies

**URL:** <https://discuss.dvc.org/t/best-practices-for-specifying-dependencies/96>\
**Category:** Questions\
**Created:** [September 12, 2018, 1:37pm UTC](https://discuss.dvc.org/t/best-practices-for-specifying-dependencies/96 "2018-09-12T13:37:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmain](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@tmain](https://discuss.dvc.org/u/tmain)\
**Post date:** [September 12, 2018, 1:37pm UTC](https://discuss.dvc.org/t/best-practices-for-specifying-dependencies/96/1 "2018-09-12T13:37:04Z")

</div>

In a pipeline, if `folder1` is the output of `stage1` and used in `stage2`, then dvc will know about it if we run `dvc run -d folder1 -o folder2 python stage2.py`

Equivalently, since stage1 creates a dvc file, we could run: `dvc run -d stage1.dvc -o folder2 python stage2.py`

What is the recommended way ?

Thanks !

---

<div class="post-metadata">

**Author:** ![kupruser](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@kupruser](https://discuss.dvc.org/u/kupruser)\
**Post date:** [September 12, 2018, 2:08pm UTC](https://discuss.dvc.org/t/best-practices-for-specifying-dependencies/96/2 "2018-09-12T14:08:22Z")

</div>

Hi @tmain !

If you specify the `stage1.dvc` as a dependency for `stage2.dvc`, dvc will not be able to track dependencies of `stage1.dvc` when you call `dvc repro stage2.dvc` because the DAG is built using explicitly specified dependencies and outputs by tying them together, but `stage1.dvc` doesn’t consider `stage1.dvc` file as an output of the stage, but rather as a metafile describing the stage. So the recommended way would be to explicitly specify outputs of stage1 as dependency of the stage2.

Thanks,  
Ruslan

---

<div class="post-metadata">

**Author:** ![tmain](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@tmain](https://discuss.dvc.org/u/tmain)\
**Post date:** [September 12, 2018, 2:08pm UTC](https://discuss.dvc.org/t/best-practices-for-specifying-dependencies/96/3 "2018-09-12T14:08:59Z")

</div>

Thanks for the prompt clarification !
