Output from Base.find_package?

Hi all,

I have a question about the behaviour of Base.find_package.
I know package can be found :

  1. if the package is already installed.
  2. by using CSV

But when I follow this tuto: How to develop a Julia package for developing package, I get output from Base.find_package("YourPackageName") (without Pkg.add(pkg) nor using pkg).

I can’t get any clue from here (julia/base/loading.jl at master · JuliaLang/julia · GitHub)
Does anyone know what happened?

julia> using PkgTemplates
julia> t = Template(;
           user="your-GitHub-username",
           authors=["pywugate"],
           plugins=[
               License(name="MIT"),
               Git(),
               GitHubActions(),
           ],
       )
julia> t("YourPackageName")
[ Info: Running prehooks
[ Info: Running hooks
  Activating project at `~\.julia\dev\YourPackageName`
    Updating registry at `~\.julia\registries\General.toml`
  No Changes to `~\.julia\dev\YourPackageName\Project.toml`
  No Changes to `~\.julia\dev\YourPackageName\Manifest.toml`
Precompiling project...
  1 dependency successfully precompiled in 1 seconds
  Activating project at `~\Documents\Julia`
[ Info: Running posthooks
[ Info: New package is at ~\.julia\dev\YourPackageName
"~\\.julia\\dev\\YourPackageName"

julia> Base.find_package("YourPackageName")
"~\\.julia\\dev\\YourPackageName\\src\\YourPackageName.jl"

julia> t("YourPackageName2")
[ Info: Running prehooks
[ Info: Running hooks
  Activating project at `~\.julia\dev\YourPackageName2`
    Updating registry at `~\.julia\registries\General.toml`
  No Changes to `~\.julia\dev\YourPackageName2\Project.toml`
  No Changes to `~\.julia\dev\YourPackageName2\Manifest.toml`
Precompiling project...
  1 dependency successfully precompiled in 1 seconds
  Activating project at `~\Documents\Julia`
[ Info: Running posthooks
[ Info: New package is at ~\.julia\dev\YourPackageName2
"~\\.julia\\dev\\YourPackageName2"

julia> Base.find_package("YourPackageName2")

julia> t("MyCoolPackage")
[ Info: Running prehooks
[ Info: Running hooks
  Activating project at `~\.julia\dev\MyCoolPackage`
    Updating registry at `~\.julia\registries\General.toml`
  No Changes to `~\.julia\dev\MyCoolPackage\Project.toml`
  No Changes to `~\.julia\dev\MyCoolPackage\Manifest.toml`
Precompiling project...
  1 dependency successfully precompiled in 1 seconds
  Activating project at `~\Documents\Julia`
[ Info: Running posthooks
[ Info: New package is at ~\.julia\dev\MyCoolPackage
"~\\.julia\\dev\\MyCoolPackage"

julia> Base.find_package("MyCoolPackage")

Considering this is in the “New to Julia” category, why do want to use Base.find_package at all? Please note that it is an internal function not part of the public interface (because it has no docstring). So what is it you want to achieve? Perhaps there is a better way of doing that :slight_smile:

2 Likes