Pkg instantiate a package

Hi,

I currently develop interdependent Julia packages and look for an easy way to share my work to others. The packages are all un-registered yet.

What I understood so far to realize this:

  • define dependencies by reference to git repositories
  • so that the manifest file contains all info
  • then use Pkg instantiate to instantiate the package

What I was expecting to work, but didn’t work, is the following

] instantiate https://www.github.com/my/toplevel/package/linking/all/others

and it would download the package, install its dependencies, adding all dependencies to the current project, and lastly adding the toplevel package itself to the current project.

I.e. I thought instead of add I can just call instantiate and deal with all these dependencies which are not yet in a registry. Does not work unfortunately

Any help is highly appreciated.

1 Like

You will have to get the Project.toml and Manifest.toml files first, e.g. by git cloneing:

$ git clone https://www.github.com/my/toplevel/package/linking/all/others tmp

$ cd tmp

$ jlpkg --project instantiate # or julia --project -e 'using Pkg; Pkg.instantiate()'
2 Likes

good to know that it is working for a checkout repository, however my use-case is differently:

  • I just want to share my state with others
  • they not necessarily want to dev further

hence I really rather look for a flexible alternative for ] add in order to add dependencies with non-registered packages

my gut-feeling tells me there is none right now and you better define your custom registry…

You can share the Project.toml + Manifest.toml files then.

1 Like

can you explain in more detail what the steps would be?

(I just read up more and more about the registry approach and it really looks not mature right now - e.g. here is a recommendation against using registries when possible)

Just publish the environment you want the users to replicate somewhere where they can download them and then instantiate. Pseudo-code:

$ mkdir my-env
$ curl -o my-env/Project.toml url.to.project/Project.toml
$ curl -o my-env/Manifest.toml url.to.project/Manifest.toml
$ julia --project=my-env -e 'using Pkg; Pkg.instantiate()'
3 Likes