# Pkg3 - how to add dependencies for development only

**URL:** <https://discourse.julialang.org/t/pkg3-how-to-add-dependencies-for-development-only/14508>\
**Category:** General Usage\
**Created:** [September 3, 2018, 11:29pm UTC](https://discourse.julialang.org/t/pkg3-how-to-add-dependencies-for-development-only/14508 "2018-09-03T23:29:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [September 3, 2018, 11:29pm UTC](https://discourse.julialang.org/t/pkg3-how-to-add-dependencies-for-development-only/14508/1 "2018-09-03T23:29:11Z")

</div>

I’d like to use Revise/Rebugger/BenchmarkTools/Plots/etc. when developing a package but if I just add them as usual they go to Project.toml and Manifest.toml. They are not real dependencies but rather convenience tools for dev only.

Is there any better way to do this i.e. make them available but not pollute the current project?

---

<div class="post-metadata">

**Author:** ![00vareladavid](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/00vareladavid/32/23521_2.png) [@00vareladavid](https://discourse.julialang.org/u/00vareladavid)\
**Post date:** [September 4, 2018, 12:10am UTC](https://discourse.julialang.org/t/pkg3-how-to-add-dependencies-for-development-only/14508/2 "2018-09-04T00:10:42Z")

</div>

According to the [docs](https://docs.julialang.org/en/latest/stdlib/Pkg/), `LOAD_PATH` should be able to handle this.

Also, note that `Base.LOAD_PATH` is reset across processes. You will need a `push!(Base.LOAD_PATH, /some/dir)` in your `startup.jl` in order to make your tools persistently available.

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [September 4, 2018, 5:50am UTC](https://discourse.julialang.org/t/pkg3-how-to-add-dependencies-for-development-only/14508/3 "2018-09-04T05:50:34Z")

</div>

You don’t necessarily have to `add` those tools to the package `Project.toml`. I use the global environment, `~/.julia/environments/v1/Project.toml` for e.g. `Revise` and `BenchmarkTools`.

---

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [September 4, 2018, 6:06am UTC](https://discourse.julialang.org/t/pkg3-how-to-add-dependencies-for-development-only/14508/4 "2018-09-04T06:06:05Z")

</div>

I do… but as soon as I activate the environment that is used to develop the package, I lose access to the global/root environment.

---

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [September 4, 2018, 6:14am UTC](https://discourse.julialang.org/t/pkg3-how-to-add-dependencies-for-development-only/14508/5 "2018-09-04T06:14:35Z")

</div>

This is indeed my workaround at the moment. Rather than using my package’s environment, I use the global/root environment as my primary and adjust LOAD\_PATH to locate my package. However, this defeats the purpose of having a separate environment for testing my package.

Come to think of it… perhaps I should just add all those goodies in the `[extras]` section? It still doesn’t seem to be a clean solution since anyone adding my package will get these goodies as well.

---

<div class="post-metadata">

**Author:** ![swt30](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/swt30/32/4667_2.png) [@swt30](https://discourse.julialang.org/u/swt30)\
**Post date:** [September 4, 2018, 10:35am UTC](https://discourse.julialang.org/t/pkg3-how-to-add-dependencies-for-development-only/14508/6 "2018-09-04T10:35:15Z")

</div>

That’s odd; I definitely don’t lose access to that environment (can still do ‘using Revise’ etc from the root environment when a project is activated). What does your LOAD\_PATH look like? Does it have a `"@v#.#"` somewhere in it?

---

<div class="post-metadata">

**Author:** ![tk3369](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tk3369/32/2824_2.png) [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Post date:** [September 4, 2018, 2:08pm UTC](https://discourse.julialang.org/t/pkg3-how-to-add-dependencies-for-development-only/14508/7 "2018-09-04T14:08:52Z")

</div>

You’re right. I must have messed round the environments too much and lost track. I can see how it works now. Call it a “user error” 🙂

Thanks
