# Link Project.toml files (or make /test/Prokect.toml depend on main package one)

**URL:** <https://discourse.julialang.org/t/link-project-toml-files-or-make-test-prokect-toml-depend-on-main-package-one/93223>\
**Category:** General Usage\
**Tags:** pkg, toml, project\
**Created:** [January 19, 2023, 5:13pm UTC](https://discourse.julialang.org/t/link-project-toml-files-or-make-test-prokect-toml-depend-on-main-package-one/93223 "2023-01-19T17:13:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [January 19, 2023, 5:13pm UTC](https://discourse.julialang.org/t/link-project-toml-files-or-make-test-prokect-toml-depend-on-main-package-one/93223/1 "2023-01-19T17:13:05Z")

</div>

I have a julia project that has a Project.toml file setting its dependencies. It also have a set of tests, for which I have a Project.toml file setting some additional dependencies that are needed for the tests only (like `SafeTestsets.jl`).

When I update my main Project.toml dependencies, I typically want the same update in the test one. Is there a way to “link” these, so that the /test/Project.toml automatically uses the package dependencies from the main Project.toml?

This would save me having to update both whenever package dependencies are updated. More importantly, it will prevent troubles when I inevitably forget to update the /test/ one.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [January 19, 2023, 5:55pm UTC](https://discourse.julialang.org/t/link-project-toml-files-or-make-test-prokect-toml-depend-on-main-package-one/93223/2 "2023-01-19T17:55:59Z")

</div>

See [https://github.com/JuliaLang/Pkg.jl/issues/1233](https://github.com/JuliaLang/Pkg.jl/issues/1233).

I would say we have a pretty good idea of how to implement this so I am quite confident it will come in 1.10.

---

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [January 19, 2023, 6:03pm UTC](https://discourse.julialang.org/t/link-project-toml-files-or-make-test-prokect-toml-depend-on-main-package-one/93223/3 "2023-01-19T18:03:51Z")

</div>

Exciting, looking forward to it 🙂

---

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [January 19, 2023, 6:35pm UTC](https://discourse.julialang.org/t/link-project-toml-files-or-make-test-prokect-toml-depend-on-main-package-one/93223/4 "2023-01-19T18:35:03Z")

</div>

This is one of the main reasons I still recommend using the single Project.toml with the `[extras]` section.

---

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [January 19, 2023, 7:11pm UTC](https://discourse.julialang.org/t/link-project-toml-files-or-make-test-prokect-toml-depend-on-main-package-one/93223/5 "2023-01-19T19:11:13Z")

</div>

So that’s what I had. But then I sometimes wanted to run a script using my test environment, but I could only Pkg.activate the main toml, which didn’t give me the `[extras]` part. I figured by changing to 2 Project.toml’s I could activate either environment as I wanted.

(but this is maybe possible in some way anyway?)

---

<div class="post-metadata">

**Author:** ![jondeuce](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jondeuce/32/16378_2.png) [@jondeuce](https://discourse.julialang.org/u/jondeuce)\
**Post date:** [January 20, 2023, 7:50am UTC](https://discourse.julialang.org/t/link-project-toml-files-or-make-test-prokect-toml-depend-on-main-package-one/93223/6 "2023-01-20T07:50:29Z")

</div>

[`TestEnv.jl`](https://github.com/JuliaTesting/TestEnv.jl) is helpful for this.

---

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [January 21, 2023, 12:00am UTC](https://discourse.julialang.org/t/link-project-toml-files-or-make-test-prokect-toml-depend-on-main-package-one/93223/7 "2023-01-21T00:00:33Z")

</div>

That looks perfect, thanks 🙂
