Sharing Pluto NBs with Custom Modules

I am working with a group and have developed some of my own modules to facilitate the research we are doing. I used pkg generate to create the template for each module. Currently, I am able to access the contents on my local machine via using MyCustomModule because I manually added them to my environment using Pkg.develop(path="MyJuliaPackages/MyCustomModule.jl")

Is there a way to somehow add them to the Julia registry (or some other registry?) but make them private so that only someone that has been given access (not sure how that would work) can add them?

That way, Pluto could use its automatic package management (i.e. no pkg.activate(".") at the start of the Pluto NB) and I wouldn’t have to worry about whether they could run the files I sent them or not.

I hope that makes sense. Please let me know if I need to clarify anything.

Prehaps GitHub - GunnarFarneback/LocalRegistry.jl: Create and maintain local registries for Julia packages. helps?

1 Like

Yes, LocalRegistry.jl works very well, and once you’ve created a private registry there is even less friction to register there compared to General.
Basically, the workflow is the following:

  • Create private git repos for your Julia registry and for each package. Use github, gitlab, or any other git hosting.
  • Initialize the registry with LocalRegistry.create_registry()
  • Everyone with access to the git repo can now add this registry to their Julia, and use those packages.
  • To register a new package or a new version, run using LocalRegistry; register(registry="YourRegistryName") in the environment of your to-be-registered package.

That’s it!

1 Like

All of the above, plus if you only have one private registry you only need to do register() with your package activated to register it, which make it even more convenient!

Can LocalRegistry and GeneralRegeistry work together? i.e. Can I

test_env>add MyLocalPackage
test_env>add Plots

Sorry for the very naive question, but I cannot find the answer anywhere.

Sure, Julia uses all added registries to resolve packages. I think it asks the user if two packages share the same name, but never encountered this case.

1 Like

That’s great! Now I am confident to give the LocalRegistry a try. I have a lot of private repos under development.