I was trying to add a new package (custom package) “P” of version 2.0, which is the latest version of the package “P” to my project environment and run into some weird issue (Julia v 1.6, macosx 11.6). The package “P” with version 2.0 depends on another package “D” of version 2.0 (defined in [deps] and [compat] section of the Project.toml file of the package “P”). I had versions 1.0 of both packages “P” and “D” installed and available in my Julia depot. However, versions 2.0 of both packages were not available/installed yet on my computer.
When I tried adding package “P” to my project (I did not specify the version, assuming it will always try to add the latest version of package “P”), It kept adding v1.0 which depends on “D” of v1.0 as well.
Is this the expected behavior of the Pkg.add(“P”) or pkg> add P ? I was assuming “add” command would download the latest version of the package “P” (and whatever versions of deps “D” defined in its Project.toml file). [Custom registry was updated during this experiment, so the latest versions of those packages “P” and “D” were registered.]