Beginner question: precompiling local modules

A local dev package does not need to be managed by git. As long as you have something structured like a package (having the Project.toml file with the necessary metadata and the src folder), you can go to your pkg prompt and type dev PATH_TO_FOLDER.

(testpkg) pkg> generate MyPackage # create an empty package with the necessary structure

(testpkg) pkg> add ./MyPackage/ # this indeed does not work for the reason you mentioned
ERROR: Did not find a git repository at `MyPackage/`, perhaps you meant `Pkg.develop`?

(testpkg) pkg> dev ./MyPackage/ # works fine
   Resolving package versions...
    Updating `/tmp/testpkg/Project.toml`
  [d6775135] + MyPackage v0.1.0 `MyPackage`
    Updating `/tmp/testpkg/Manifest.toml`
  [d6775135] + MyPackage v0.1.0 `MyPackage`

julia> using MyPackage # seems to precompile
[ Info: Precompiling MyPackage [d6775135-1b9a-4058-9fc1-6e67b52696a1]

julia> MyPackage.greet()
Hello World!

You are right that the version management seems closely intertwined with git. I am curious what other options there are.

Just out of curiosity, why do you prefer to avoid git? Is it because you prefer another version control system or because you prefer to avoid version control systems altogether?

1 Like