I’m trying to understand the organization mechanism of Julia packages and seeking for a good workflow that is suitable for me for package development. My expected learning roadmap is to firstly create a minimal package from scratch locally and invoke it from another project, and after that learn how to upload it to GitHub and register it and so on.
Up to now, I have just created a package named MyPackage using command generate under Julia’s package mode and the folder MyPackage has appeared in my working directory named myPkgDev.
Now, I’d like to ask the following several questions:
- I’ve learnt there are several ways to invoke this package such as
activate,devoraddit, but what are the differences between them? - It seems that to
adda local package I need to make it a git repository first, so I executedcd MyPackage,git init,git add .andgit commit -a -m "Initial package structure."in sequence and executedadd ./MyPackageunder Julia package mode in the original working directory. No surprise, it worked, but my question here is, why is theadd-ing package process so slow? (I can understand the slow process of adding a registered package from the network, but why is adding the smallest local package so slow? What exactly happened in the process?) And why are there 11 dependencies for a package that only hasHello World!?
(@v1.9) pkg> add ./MyPackage
Cloning git-repo `D:\myPkgDev\MyPackage`
Updating git-repo `D:\myPkgDev\MyPackage`
Updating registry at `C:\Users\Name\.julia\registries\General.toml`
Resolving package versions...
Updating `C:\Users\Name\.julia\environments\v1.9\Project.toml`
[2fed5cd1] + MyPackage v0.1.0 `D:\myPkgDev\MyPackage#main`
Updating `C:\Users\Name\.julia\environments\v1.9\Manifest.toml`
[2fed5cd1] + MyPackage v0.1.0 `D:\myPkgDev\MyPackage#main`
Precompiling project...
✓ MyPackage
11 dependencies successfully precompiled in 159 seconds. 229 already precompiled.
1 dependency precompiled but a different version is currently loaded. Restart julia to access the new version
- It would be nice if you could recommend some complete tutorials or good workflows for Julia package development.
Thanks! ![]()