# How to actively develop a package I am working on?

**URL:** https://discourse.julialang.org/t/how-to-actively-develop-a-package-i-am-working-on/109331
**Category:** General Usage
**Created:** [January 27, 2024, 8:51am UTC](https://discourse.julialang.org/t/how-to-actively-develop-a-package-i-am-working-on/109331 "2024-01-27T08:51:36Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)
#### Post date: [January 27, 2024, 8:51am UTC](https://discourse.julialang.org/t/how-to-actively-develop-a-package-i-am-working-on/109331/1 "2024-01-27T08:51:37Z")

</div>

Hello!

I have a package I am working on and currently my workflow is a bit of a hassle. I want to develop my package a bit more interactively, but currently my workflow is:

1. Do changes
2. Commit changes to Github and push
3. Remove previous install of package
4. Reinstall package
5. Run and test code

Which is quite of a hassle and does not feel to interactive. I am sure I have missed something basic, would anyone kindly give me a step in the right direction?

Kind regards, Ahmed

---

<div class="post-metadata">

### Author: ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)
#### Post date: [January 27, 2024, 10:55am UTC](https://discourse.julialang.org/t/how-to-actively-develop-a-package-i-am-working-on/109331/2 "2024-01-27T10:55:16Z")

</div>

Okay, I think I figured it out!

What worked for me:

1. Install packages for general use in global namespace, such as Revise, BenchmarkTools etc.
2. In your run script (NOT module!) put `using Revise`
3. Restart Julia
4. Now, if you are in the project folder and have activated environment, by `] activate .` or similar, then when you do changes in a submodule of your `using MyPackage`, these are propagated through the `using Revise` and you do not have to restart Julia terminal.

You need to make sure the project name matches `using MyPackage` I think, not sure.

Now I don’t have to do that really annoying workflow above 🙂

Kind regards

---

<div class="post-metadata">

### Author: ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)
#### Post date: [January 27, 2024, 10:57am UTC](https://discourse.julialang.org/t/how-to-actively-develop-a-package-i-am-working-on/109331/3 "2024-01-27T10:57:42Z")

</div>

Note that there is a `Revise.includet` that allows you to reload a file when it changes. The final `t` is not a typo. This is usually useful when you are trying to develop code outside of the context of a package. Otherwise, it seems like you mostly figured it out.

---

<div class="post-metadata">

### Author: ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)
#### Post date: [January 27, 2024, 11:00am UTC](https://discourse.julialang.org/t/how-to-actively-develop-a-package-i-am-working-on/109331/4 "2024-01-27T11:00:15Z")

</div>

Yes, thanks for including that 🙂

It is because I am working on my package and in the test script I do; `using MyPackage` - then now because I have `using Revise` at the top of the test script, when I do changes inside of `MyPackage` in the local code it propagates correctly and I do not need to restart Julia.

Wish I had understood earlier that Revise also works with packages, hopefully it helps someone in the future 😅

Kind regards

---

<div class="post-metadata">

### Author: ![GHTaarn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ghtaarn/32/216007_2.png) [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)
#### Post date: [January 27, 2024, 6:26pm UTC](https://discourse.julialang.org/t/how-to-actively-develop-a-package-i-am-working-on/109331/5 "2024-01-27T18:26:41Z")

</div>

> [@Ahmed\_Salih](#):
>
> 1. Install packages for general use in global namespace, such as Revise, BenchmarkTools etc.
> 2. In your run script (NOT module!) put `using Revise`
> 3. Restart Julia
> 4. Now, if you are in the project folder and have activated environment, by `] activate .` or similar, then when you do changes in a submodule of your `using MyPackage`, these are propagated through the `using Revise` and you do not have to restart Julia terminal.

This will work, but personally I don’t like the idea of putting `using Revise` in your run script (ideally your run script should only be using packages that are in its `Project.toml`). I would recommend doing one of the following:

1. Simply write `using Revise` in the REPL before the first time that you `include` your run script in every new Julia session
2. Add the line `using Revise` to your ~/.julia/config/startup.jl file
3. Do like me, add the following line to your ~/.bashrc or similar:

```bash
alias j='julia -i -e "using Revise"'

```

which will start Julia with `Revise` preloaded when you use the command `j` on the command line. If you use Windows, then I think that you would need to write a .bat script to achieve something like this.

Finally, I just want to make sure that you are aware of Julias built in [Unit test framework](https://docs.julialang.org/en/v1/stdlib/Test/) which would normally be a good supplement or replacement for your run script.

---

<div class="post-metadata">

### Author: ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)
#### Post date: [January 28, 2024, 8:45am UTC](https://discourse.julialang.org/t/how-to-actively-develop-a-package-i-am-working-on/109331/6 "2024-01-28T08:45:55Z")

</div>

Thanks!

I might have to look into this, since my workflow seems to have broken again…

The unit test framework looks great for testing out smaller components of functionality, thanks! Currently I am just developing and it is nice to do so through a script for me.

Kind regards, thanks for the help

---

<div class="post-metadata">

### Author: ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)
#### Post date: [January 28, 2024, 8:55am UTC](https://discourse.julialang.org/t/how-to-actively-develop-a-package-i-am-working-on/109331/7 "2024-01-28T08:55:18Z")

</div>

For more workflow tips, you can check out this (still incomplete) series of blog posts

[https://modernjuliaworkflows.github.io/](https://modernjuliaworkflows.github.io/)
