Find where a package comes from

pkg> status shows that I have the Symbolics package added to my project.

I wanted to check if it’s the old one (GitHub - MasonProtter/Symbolics.jl: A symbolic math library written in Julia modelled off scmutils) or the new one (GitHub - JuliaSymbolics/Symbolics.jl: A fast and modern CAS for a fast and modern language.).

What’s the simplest way to do that? I looked for a pkg command such as info Symbolics or show Symbolics but didn’t find anything.

You can check the UUIDs in the respective Project.toml files against the output of Base.identify_package("Symbolics")

1 Like

I have

julia> Base.identify_package("Symbolics")
Symbolics [0c5d862f-8b57-4792-8d23-62f2024744c7]

and

shell> cat Project.toml
[deps]
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"

but that doesn’t say where the Symbolics package comes from…

What I meant is to check against this: Symbolics.jl/Project.toml at 1f2188d9da92abfe7901ecea064da462bdca1522 · JuliaSymbolics/Symbolics.jl · GitHub

So it seems you have the new package.

Actually, I just realized that I don’t think Mason’s package was ever registered, so if you did pkg> add Symbolics it can only be the new one.

1 Like

Ah OK that makes sense. It’s a bit cumbersome but it works if you know where to look (i.e. you have a guess for the repository URL)…

But then what if you have no prior idea where the package might come from? :slight_smile:

Pkg.status("Symbolics") should tell you where it comes from if it’s not straight out of the registry. E.g. I have

julia> Pkg.status("LongestPaths")
Status `~/.julia/environments/v1.5/Project.toml`
  [3a25c17e] LongestPaths v0.2.0 `https://github.com/GunnarFarneback/LongestPaths.jl.git#weighted_paths`

julia> Pkg.status("YAML")
Status `~/.julia/environments/v1.5/Project.toml`
  [ddb6d928] YAML v0.4.5

where the latter is from the registry.

1 Like

Right, then if it does come from the registry I can go to https://github.com/JuliaRegistries/General.git, navigate to the package directory and find the repo entry in the Project.toml.

The registry URL itself can be found with pkg> registry status.

More cumbersome than expected but I think it covers all cases :slight_smile: