# Is there concept of dev dependencies in Pkg?

**URL:** <https://discourse.julialang.org/t/is-there-concept-of-dev-dependencies-in-pkg/46908>\
**Category:** General Usage\
**Created:** [September 19, 2020, 11:44am UTC](https://discourse.julialang.org/t/is-there-concept-of-dev-dependencies-in-pkg/46908 "2020-09-19T11:44:11Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![andre1sk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andre1sk/32/17907_2.png) [@andre1sk](https://discourse.julialang.org/u/andre1sk)\
**Post date:** [September 19, 2020, 11:44am UTC](https://discourse.julialang.org/t/is-there-concept-of-dev-dependencies-in-pkg/46908/1 "2020-09-19T11:44:11Z")

</div>

Is there a good write up that explains things in decent detail you could recommend?

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [September 19, 2020, 12:02pm UTC](https://discourse.julialang.org/t/is-there-concept-of-dev-dependencies-in-pkg/46908/2 "2020-09-19T12:02:12Z")

</div>

How about the original source?  
[https://julialang.github.io/Pkg.jl/v1/](https://julialang.github.io/Pkg.jl/v1/)

---

<div class="post-metadata">

**Author:** ![andre1sk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andre1sk/32/17907_2.png) [@andre1sk](https://discourse.julialang.org/u/andre1sk)\
**Post date:** [September 19, 2020, 12:26pm UTC](https://discourse.julialang.org/t/is-there-concept-of-dev-dependencies-in-pkg/46908/3 "2020-09-19T12:26:10Z")

</div>

It doesn’t really outline workflow to use  
would this still be recommended workflow [Add package to `project.toml` when needed only for testing?](https://discourse.julialang.org/t/add-package-to-project-toml-when-needed-only-for-testing/20552)

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [September 19, 2020, 12:30pm UTC](https://discourse.julialang.org/t/is-there-concept-of-dev-dependencies-in-pkg/46908/4 "2020-09-19T12:30:45Z")

</div>

For developing a (new) package it does outline a workflow and recommends PkgTemplates.jl:  
[https://julialang.github.io/Pkg.jl/v1/creating-packages/](https://julialang.github.io/Pkg.jl/v1/creating-packages/)

> **[GitHub - JuliaCI/PkgTemplates.jl: Create new Julia packages, the easy way](https://github.com/JuliaCI/PkgTemplates.jl)**
>
> Create new Julia packages, the easy way. Contribute to JuliaCI/PkgTemplates.jl development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [September 19, 2020, 12:34pm UTC](https://discourse.julialang.org/t/is-there-concept-of-dev-dependencies-in-pkg/46908/5 "2020-09-19T12:34:23Z")

</div>

This one also looks quite good:  
[https://tlienart.github.io/pub/julia/dev-pkg.html](https://tlienart.github.io/pub/julia/dev-pkg.html)

And if you like videos, @ChrisRackauckas explains it in quite some detail and length 😉

[![](https://global.discourse-cdn.com/julialang/original/3X/a/9/a9eed041bdd2be4339d3e6dd3961b86bdc1511f3.jpeg "Developing Julia Packages") ](https://www.youtube.com/watch?v=QVmU29rCjaA)

---

<div class="post-metadata">

**Author:** ![andre1sk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andre1sk/32/17907_2.png) [@andre1sk](https://discourse.julialang.org/u/andre1sk)\
**Post date:** [September 19, 2020, 1:16pm UTC](https://discourse.julialang.org/t/is-there-concept-of-dev-dependencies-in-pkg/46908/6 "2020-09-19T13:16:39Z")

</div>

Thank you @oheil for great pointers! diving in 🙂

---

<div class="post-metadata">

**Author:** ![timueh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/timueh/32/12379_2.png) [@timueh](https://discourse.julialang.org/u/timueh)\
**Post date:** [September 22, 2020, 7:02am UTC](https://discourse.julialang.org/t/is-there-concept-of-dev-dependencies-in-pkg/46908/7 "2020-09-22T07:02:09Z")

</div>

Not sure whether this is still relevant, but beware of the differences between Packages for Julia {1.0, 1.1} and Julia {1.3 and above}:

[https://julialang.github.io/Pkg.jl/v1/creating-packages/#Test-specific-dependencies-in-Julia-1.2-and-above-1](https://julialang.github.io/Pkg.jl/v1/creating-packages/#Test-specific-dependencies-in-Julia-1.2-and-above-1)

Enjoy! 🙂

---

<div class="post-metadata">

**Author:** ![andre1sk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andre1sk/32/17907_2.png) [@andre1sk](https://discourse.julialang.org/u/andre1sk)\
**Post date:** [September 30, 2020, 7:58am UTC](https://discourse.julialang.org/t/is-there-concept-of-dev-dependencies-in-pkg/46908/8 "2020-09-30T07:58:36Z")

</div>

One surprising thing from the Developing Julia Packages video is advice to not include the  
**Manifest.toml** to the git repo 🤔 Repeatable builds tends to be a pretty important issue and in pretty much every other ecosystem the advice is pretty much the opposite…

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 30, 2020, 8:56am UTC](https://discourse.julialang.org/t/is-there-concept-of-dev-dependencies-in-pkg/46908/9 "2020-09-30T08:56:48Z")

</div>

That is recommended for _packages_, so that they are tested with versions offered by the resolver in CI. For _projects_, of course include a manifest.

---

<div class="post-metadata">

**Author:** ![andre1sk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andre1sk/32/17907_2.png) [@andre1sk](https://discourse.julialang.org/u/andre1sk)\
**Post date:** [September 30, 2020, 9:04am UTC](https://discourse.julialang.org/t/is-there-concept-of-dev-dependencies-in-pkg/46908/10 "2020-09-30T09:04:08Z")

</div>

Cool thank you for clarification makes sense

---

<div class="post-metadata">

**Author:** ![ChunXi\_Zhang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chunxi_zhang/32/22556_2.png) [@ChunXi\_Zhang](https://discourse.julialang.org/u/ChunXi_Zhang)\
**Post date:** [June 21, 2021, 2:29am UTC](https://discourse.julialang.org/t/is-there-concept-of-dev-dependencies-in-pkg/46908/11 "2021-06-21T02:29:44Z")

</div>

According to Pkg.jl documentations, there seems to be a new version of doing dev dependencies for julia above 1.2:  
[Test-specific-dependencies-in-Julia-1.2-and-above](https://pkgdocs.julialang.org/v1/creating-packages/#Test-specific-dependencies-in-Julia-1.2-and-above)  
This seems only work for `] test` command.  
But by doing so, how can I have a dev environment which I can use interactively? I wish I can have a dev environment which has access to MyPackage and all test dependencies, that’s where you do the developing all the time right?

If I activate the `MyPackage` environment, I have no access to these test dependencies, but if I activate `./test` environment, I don’t have access to `MyPackage`.  
And it seems that adding test dependencies in [extras] and [targets] is ignored right now, if I do any Pkg operations, things in extras will be removed from `MyPackages`’s Manifest.toml. So I lost access to all of these test dependencies in MyPackage environment.

So what’s the right way of setting environment for developing with proper test dependencies?

I just found I have access to packages installed in global environment, should this be isolated by design?  
Do people just install packages to global environment as dev dependencies when developing their package?

---

<div class="post-metadata">

**Author:** ![jlchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlchan/32/10958_2.png) [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Post date:** [June 21, 2021, 7:27am UTC](https://discourse.julialang.org/t/is-there-concept-of-dev-dependencies-in-pkg/46908/12 "2021-06-21T07:27:20Z")

</div>

You can create a test Project.toml, you just need to remove Test from [targets]. See also [Using test/Project.toml - #4 by peterlane](https://discourse.julialang.org/t/using-test-project-toml/31406/4)
