# Experimenting and developing unregistered packages

**URL:** <https://discourse.julialang.org/t/experimenting-and-developing-unregistered-packages/16563>\
**Category:** General Usage\
**Tags:** question, pkg\
**Created:** [October 20, 2018, 11:49am UTC](https://discourse.julialang.org/t/experimenting-and-developing-unregistered-packages/16563 "2018-10-20T11:49:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![lostella](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lostella/32/356_2.png) [@lostella](https://discourse.julialang.org/u/lostella)\
**Post date:** [October 20, 2018, 11:49am UTC](https://discourse.julialang.org/t/experimenting-and-developing-unregistered-packages/16563/1 "2018-10-20T11:49:20Z")

</div>

Hi all, I’m trying to use the following workflow to collaboratively experiment with and develop a package.

The setup is as follows: I have a `project` directory with `Project.toml` and a script `script.jl` that runs an experiment. In `Manifest.toml` all required package versions are specified, so as to be able to instantiate the environment and run the same experiment, e.g. on a different machine. Among the required packages is `PkgA`, my own unregistered package, living in whatever git repository, that my friend Alice and I are interested in improving.

So `Manifest.toml` will have something like

```julia
[[PkgA]]
deps = ["PkgB", "PkgC", "PkgD"]
git-tree-sha1 = "abc"
repo-rev = "master"
repo-url = "https://github.com/bob/PkgA.jl"
uuid = "xyz"
version = "0.1.0"

```

If I just send the project to Alice, she should be able to run the experiment by doing:

```julia
shell> cd project
shell> julia
julia> ]
pkg> activate .
(project) pkg> instantiate
[...]
julia> include("script.jl")

```

**Now Alice has an idea:** she wants to locally make a change to `PkgA`, re-run the experiment, and check whether it improves things. My understanding is that she should be doing

```julia
julia> ]
(project) pkg> dev PkgA

```

and then go somewhere maybe in `.julia/dev` to find the sources, do the change, run the script again. Except that the above instructions yield (Julia 1.0.1):

```julia
(project) pkg> dev PkgA
ERROR: The following package names could not be resolved:
 * PkgA (xyz in manifest but not in project)
Please specify by known `name=uuid`.

```

Am I trying doing it the wrong way?

---

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [October 20, 2018, 12:28pm UTC](https://discourse.julialang.org/t/experimenting-and-developing-unregistered-packages/16563/2 "2018-10-20T12:28:59Z")

</div>

> [@lostella](#):
>
> (project) pkg\> dev PkgA

This is where you might be off. Exit julia first, then do the dev on where those source files are. What happened here is that you are developing a package from within its own environment. You want to develop it from some other external environment, like `v1.0`.

---

<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:** [October 20, 2018, 1:26pm UTC](https://discourse.julialang.org/t/experimenting-and-developing-unregistered-packages/16563/3 "2018-10-20T13:26:52Z")

</div>

> [@lostella](#):
>
> If I just send the project to Alice

How you do this is key to an efficient workflow.

I would suggest that

1. both parties `dev` the package (you need to do this just once),
2. use `git` for version control,
3. “send” the code using pull requests on Github, Gitlab, or similar.

If the project involves multiple such packages, they should all be `dev`’d.

Committing `Manifest.toml` should help with finding the exact same versions.

---

<div class="post-metadata">

**Author:** ![lostella](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lostella/32/356_2.png) [@lostella](https://discourse.julialang.org/u/lostella)\
**Post date:** [October 20, 2018, 4:24pm UTC](https://discourse.julialang.org/t/experimenting-and-developing-unregistered-packages/16563/4 "2018-10-20T16:24:47Z")

</div>

If course, I meant to say “send” in very abstract sense: the idea is that of versioning the project containing the experiments scripts and push it to a shared repository.

I think the problem is with `dev`’ing a non registered package, `PkgA` in my example. To simplify my question: how is one supposed to `dev` a non-registered package?

---

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [October 20, 2018, 4:53pm UTC](https://discourse.julialang.org/t/experimenting-and-developing-unregistered-packages/16563/5 "2018-10-20T16:53:10Z")

</div>

Just `dev url`? Or if you don’t want to put the `dev`ed package online, you could `dev` a relative local path and tell your collaborator to use the same directory structure.

---

<div class="post-metadata">

**Author:** ![lostella](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lostella/32/356_2.png) [@lostella](https://discourse.julialang.org/u/lostella)\
**Post date:** [October 20, 2018, 6:05pm UTC](https://discourse.julialang.org/t/experimenting-and-developing-unregistered-packages/16563/6 "2018-10-20T18:05:32Z")

</div>

Same if I have already `git pull`’ed the package elsewhere, right? I can `dev path` (relative or absolute) and it should recognize (through the uuid) that this is the package which was previously instantiated through the manifest, right?

---

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [October 20, 2018, 6:27pm UTC](https://discourse.julialang.org/t/experimenting-and-developing-unregistered-packages/16563/7 "2018-10-20T18:27:30Z")

</div>

Yep, should work.

You could also have the `dev`’d package as a git submodule of your main package, e.g. in `MainPackage/packages/ABC`, and then `dev packages/ABC` after running `julia --project=.` from `MainPackage`. That way everything is set up to modify `ABC`s code for both you and your collaborator, but you can still have a shared canonical version of `ABC` checked in to the `MainPackage` repo (identified by a git SHA). Git submodules can be a little tricky to work with if you’re not familiar with them though.

---

<div class="post-metadata">

**Author:** ![lostella](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lostella/32/356_2.png) [@lostella](https://discourse.julialang.org/u/lostella)\
**Post date:** [October 20, 2018, 7:25pm UTC](https://discourse.julialang.org/t/experimenting-and-developing-unregistered-packages/16563/8 "2018-10-20T19:25:17Z")

</div>

Got it. Thanks everyone for the useful insights. BTW, the `--project` option is not listed when you use `--help` in Julia 1.0.1. Is that on purpose?

---

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [October 20, 2018, 7:43pm UTC](https://discourse.julialang.org/t/experimenting-and-developing-unregistered-packages/16563/9 "2018-10-20T19:43:48Z")

</div>

Fixed in [https://github.com/JuliaLang/julia/pull/29497](https://github.com/JuliaLang/julia/pull/29497) and [https://github.com/JuliaLang/julia/pull/29731](https://github.com/JuliaLang/julia/pull/29731).
