# Manging Local Package & Workflow

**URL:** <https://discourse.julialang.org/t/manging-local-package-workflow/77488>\
**Category:** Tooling\
**Tags:** package-dev\
**Created:** [March 7, 2022, 3:49am UTC](https://discourse.julialang.org/t/manging-local-package-workflow/77488 "2022-03-07T03:49:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TI36XPro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ti36xpro/32/33658_2.png) [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Post date:** [March 7, 2022, 3:49am UTC](https://discourse.julialang.org/t/manging-local-package-workflow/77488/1 "2022-03-07T03:49:53Z")

</div>

Hello,

I have a package I am developing locally. I created the package using `] generate` and have added it to a local registry so that I may share it easily with collaborators. Both the package and the local registry have their own git repos.

Separately, I have a development environment that I use (created via `] activate MyEnvironment`). I added my local registry to the environment and then added my package via `] add MyPackage`.

Now I want to be able to run code like this in a script file (starting in my specific environment is already taken care of via `julia.environmentPath` in VsCode)

```julia
using MyPackage, Revise

testing = MyType(...)
testresult = MyFunction(testing)

```

while at the same time making changes to my package, so I can see the impact in real time (via `Revise`). But it does not appear to be working. For example I defined a new function in `MyPackage` and added it to the export list and I get an error that the new function is not defined. But if I do instead

```julia
include("Path/To/MyPackage.jl")
using .MyPackage, Revise

testing = MyType(...)
testresult = MyFunction(testing)
testresult2 = MyNewFunction(testing) # newly exported function

```

Well now each time I restart the script the change is reflected but Revise does not appear to track changes anymore.

Am I going about this the wrong way? I’m sure there is a better way and would appreciate any advice.

---

<div class="post-metadata">

**Author:** ![albheim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albheim/32/34660_2.png) [@albheim](https://discourse.julialang.org/u/albheim)\
**Post date:** [March 7, 2022, 6:25am UTC](https://discourse.julialang.org/t/manging-local-package-workflow/77488/2 "2022-03-07T06:25:30Z")

</div>

You probably want to develop your packade instead of adding it, so `dev local/path/MyPackage` instead of `add MyPackage`. This makes i look at this path instead of a specific git commit.  
And i think you also need to run `using Revise` before any other using for it to work with the other package, though maybe vscode is doing something in the background here.

---

<div class="post-metadata">

**Author:** ![lawless-m](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lawless-m/32/30869_2.png) [@lawless-m](https://discourse.julialang.org/u/lawless-m)\
**Post date:** [March 7, 2022, 11:17am UTC](https://discourse.julialang.org/t/manging-local-package-workflow/77488/3 "2022-03-07T11:17:16Z")

</div>

perhaps replacing

```julia
include("Path/To/MyPackage.jl")

```

with the Revise version

```julia
includet("Path/To/MyPackage.jl")

```

will cure your problem

---

<div class="post-metadata">

**Author:** ![tim.holy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tim.holy/32/52_2.png) [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Post date:** [March 7, 2022, 1:08pm UTC](https://discourse.julialang.org/t/manging-local-package-workflow/77488/4 "2022-03-07T13:08:37Z")

</div>

You’re loading Revise after you load the package. [That won’t work.](https://timholy.github.io/Revise.jl/stable/#Usage-example-1) (see “importantly…”)

If there’s a place this info would have been easier to find, I’m open to suggestions.

---

<div class="post-metadata">

**Author:** ![TI36XPro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ti36xpro/32/33658_2.png) [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Post date:** [March 7, 2022, 2:43pm UTC](https://discourse.julialang.org/t/manging-local-package-workflow/77488/5 "2022-03-07T14:43:39Z")

</div>

Thank you both for the quick responses. No - I think that is well placed (the link) I was just being oblivious. I ended up fixing it by activating my environment, using `Pkg remove MyPackage` and then re-adding locally (instead of via the registry) by doing `julia> Pkg.develop(path="PATH/TO/MYPACKAGE/")`. Also realized the `using Revise` is unnecessary in my script example above because I have it setup to load automatically with the environment (via `startup.jl`).
