# Workflow for local package testing

**URL:** <https://discourse.julialang.org/t/workflow-for-local-package-testing/50854>\
**Category:** New to Julia\
**Tags:** pkg\
**Created:** [November 27, 2020, 10:31am UTC](https://discourse.julialang.org/t/workflow-for-local-package-testing/50854 "2020-11-27T10:31:10Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [November 27, 2020, 10:31am UTC](https://discourse.julialang.org/t/workflow-for-local-package-testing/50854/1 "2020-11-27T10:31:11Z")

</div>

Hi,

I am currently developping a package, and in the same time making tests with it on a separate juno project (so I have two atom windows open : one for the package and hte other one the the projects where i test the functionality).

Currently, the testing project depends on the github verison of the package, so to test my changes to the package code, I commit them, push them to github, and then do a `] update` in the other juno window.

This is highly ineficcient, and I am sure there is a better way. How can i tell my testing project to instead use the local version of the package ? I have Revise.jl setted up so i guess that changing the package files will automatically result into changes in my testing REPL if i manage to setup the dependency to the local package correctly.

---

<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:** [November 27, 2020, 10:52am UTC](https://discourse.julialang.org/t/workflow-for-local-package-testing/50854/2 "2020-11-27T10:52:25Z")

</div>

Install the package with `Pkg.develop` (`pkg> develop`) instead of `Pkg.add`, see [3. Managing Packages · Pkg.jl](https://julialang.github.io/Pkg.jl/v1/managing-packages/#Adding-a-local-package).

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [November 27, 2020, 10:53am UTC](https://discourse.julialang.org/t/workflow-for-local-package-testing/50854/3 "2020-11-27T10:53:06Z")

</div>

So in the current stage of my project, i should remove the package and install it via Pkg.develop ?

---

<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:** [November 27, 2020, 10:55am UTC](https://discourse.julialang.org/t/workflow-for-local-package-testing/50854/4 "2020-11-27T10:55:53Z")

</div>

Yes, but you don’t have to remove it since `Pkg.develop` will overwrite it. For example in the test project:

```nohighlight
(test-project) pkg> develop /path/to/local/development/directory

```

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [November 27, 2020, 11:01am UTC](https://discourse.julialang.org/t/workflow-for-local-package-testing/50854/5 "2020-11-27T11:01:50Z")

</div>

Hum… It did not work. I guess that the problem is that the name of the local folder is not the name of the package.

---

<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:** [November 27, 2020, 11:03am UTC](https://discourse.julialang.org/t/workflow-for-local-package-testing/50854/6 "2020-11-27T11:03:13Z")

</div>

Define “not work”? It doesn’t matter what the folder is called.

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [November 27, 2020, 11:05am UTC](https://discourse.julialang.org/t/workflow-for-local-package-testing/50854/7 "2020-11-27T11:05:14Z")

</div>

Ok now, when running `] status`, it links to the local folder, wich is perfect. However, when changing things is the local repo, the REPl should be affected since i have Revise running. or am i fooling myself ?

Edit: On the doc you sent me, is said " The `dev` command fetches a full clone of the package to `~/.julia/dev/` (the path can be changed by setting the environment variable `JULIA_PKG_DEVDIR` ). When importing `Example` julia will now import it from `~/.julia/dev/Example` and whatever local changes have been made to the files in that path are consequently reflected in the code loaded. When we used `add` we said that we tracked the package repository, we here say that we track the path itself. Note the package manager will never touch any of the files at a tracked path. It is therefore up to you to pull updates, change branches etc. If we try to `dev` a package at some branch that already exists at `~/.julia/dev/` the package manager we will simply use the existing path. For example:"

Therefore, i should developp the package that is in ~/.julia/dev and not the repo i have (somewhere else) on my computer ? Should i work directly in this folder when making changes to a package / developping a package ?

---

<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:** [November 27, 2020, 11:08am UTC](https://discourse.julialang.org/t/workflow-for-local-package-testing/50854/8 "2020-11-27T11:08:06Z")

</div>

No that should work (and does for me).

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [November 27, 2020, 11:12am UTC](https://discourse.julialang.org/t/workflow-for-local-package-testing/50854/9 "2020-11-27T11:12:25Z")

</div>

Is your local repo stored in .julia/dev (i.e `JULIA_PKG_DEVDIR` folder ) or somewhere else ?

---

<div class="post-metadata">

**Author:** ![FedericoStra](https://avatars.discourse-cdn.com/v4/letter/f/76d3ee/32.png) [@FedericoStra](https://discourse.julialang.org/u/FedericoStra)\
**Post date:** [November 27, 2020, 11:16am UTC](https://discourse.julialang.org/t/workflow-for-local-package-testing/50854/10 "2020-11-27T11:16:02Z")

</div>

`dev` also works for already existing local paths, and no copy to `~/.julia/dev` will be made:

```nohighlight
(@v1.5) pkg> help dev
  [dev|develop] [--shared|--local] pkg[=uuid] ...

  Make a package available for development. If pkg is an existing local path,
  that path will be recorded in the manifest and used. [...]

```

In the testing project, however, you need to restart the session to let Revise pick up the change in dependency. Did you try restarting?

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [November 27, 2020, 11:18am UTC](https://discourse.julialang.org/t/workflow-for-local-package-testing/50854/11 "2020-11-27T11:18:52Z")

</div>

> [@FedericoStra](#):
>
> In the testing project, however, you need to restart the session to let Revise pick up the change in dependency. Did you try restarting?

Aaaaand now it works. Thanks a lot !!
