I’m not sure what else to say other than good luck. My concern is not about your colleague’s understanding of proper code organization. My concern is there may be a fundamental misunderstanding of how Julia works.
How are you loading modules? Are you invoking using SomePackage
or import AnotherPackage
? or… are you just doing include("somepackage.jl")
?
OK, so you are actually using packages. That at least adds uuid
and version
fields to your Project.toml for each package.
PkgTemplates
This is false. The entire configuration is entirely customizable. You can create a template exactly once and reuse it.
julia> using PkgTemplates
julia> template = Template(interactive=true)
Template keywords to customize:
[press: d=done, a=all, n=none]
[ ] user
[ ] authors
[ ] dir
[ ] host
[ ] julia
> [X] plugins
You can activate or deactivate git, GitHub, or GitLab.
Select plugins:
[press: d=done, a=all, n=none]
[X] CompatHelper
[X] ProjectFile
[X] SrcDir
[ ] Git
[X] License
[X] Readme
[X] Tests
> [X] TagBot
[ ] AppVeyor
[ ] BlueStyleBadge
[ ] CirrusCI
[ ] Citation
[ ] Codecov
[ ] ColPracBadge
[ ] Coveralls
[ ] Develop
[ ] Documenter
[ ] DroneCI
[ ] GitHubActions
[ ] GitLabCI
[ ] PkgEvalBadge
[ ] RegisterAction
[ ] TravisCI
CompatHelper keywords to customize:
[press: d=done, a=all, n=none]
> [ ] cron
[ ] destination
[ ] file
ProjectFile keywords to customize:
[press: d=done, a=all, n=none]
> [ ] version
[ ] None
SrcDir keywords to customize:
[press: d=done, a=all, n=none]
> [ ] destination
[ ] file
License keywords to customize:
[press: d=done, a=all, n=none]
> [ ] destination
[ ] name
[ ] path
Readme keywords to customize:
[press: d=done, a=all, n=none]
> [ ] badge_off
[ ] badge_order
[ ] destination
[ ] file
[ ] inline_badges
Tests keywords to customize:
[press: d=done, a=all, n=none]
> [ ] file
[ ] project
TagBot keywords to customize:
[press: d=done, a=all, n=none]
> [ ] branches
[ ] changelog
[ ] changelog_ignore
[ ] destination
[ ] dispatch
[ ] dispatch_delay
[ ] file
[ ] gpg
[ ] gpg_password
[ ] registry
[ ] ssh
[ ] ssh_password
[ ] token
[ ] trigger
Pkg.develop
If seems that you are using git
at some point, so that should make things easier. However, you can use packages without using git
at all by using Pkg.develop
or ]dev
with a local path.
(SomeJuliaPkg) pkg> generate YetAnotherJuliaPackage
Generating project YetAnotherJuliaPackage:
YetAnotherJuliaPackage/Project.toml
YetAnotherJuliaPackage/src/YetAnotherJuliaPackage.jl
(SomeJuliaPkg) pkg> dev ./YetAnotherJuliaPackage
Resolving package versions...
Updating `~/SomeJuliaPkg/Project.toml`
[ff33dcb1] + YetAnotherJuliaPackage v0.1.0 `YetAnotherJuliaPackage`
Updating `~/SomeJuliaPkg/Manifest.toml`
[ff33dcb1] + YetAnotherJuliaPackage v0.1.0 `YetAnotherJuliaPackage`
julia> using YetAnotherJuliaPackage
[ Info: Precompiling YetAnotherJuliaPackage [ff33dcb1-3271-4990-a66c-63e68f98716f]
For example, I actually recommend using the develop
mode rather than the add
mode in your case so that the state of the code on disk is what will be loaded when invoking using
or import
.
In a subsequent julia session, notice that no precompilation occurs:
julia> using YetAnotherJuliaPackage
If before loading the package, a source file has changed, then precompilation will occur if you are using Pkg.develop
or ]dev
:
julia> Base.Filesystem.touch("YetAnotherJuliaPackage/src/YetAnotherJuliaPackage.jl")
"YetAnotherJuliaPackage/src/YetAnotherJuliaPackage.jl"
julia> using YetAnotherJuliaPackage
[ Info: Precompiling YetAnotherJuliaPackage [ff33dcb1-3271-4990-a66c-63e68f98716f]
Also after this precompilation has been done, there will be a .ji
file in .julia/compiled/v1.7/YetAnotherJuliaPackage
containing type inferred code cached during the precompilation step. I believe the Julia devs were smart enough to make the .ji
files platform independent. Yet there are still some configuration issues between platforms that I would still recommend using a distinct JULIA_DEPOT_PATH
environment variable for each platform.
julia> readdir(joinpath(DEPOT_PATH[1], "compiled", "v1.7", "YetAnotherJuliaPackage"))
1-element Vector{String}:
"92CAK_9xKaS.ji"