Installing own package with dependency

Hi,

I have written a package Lithe (which I may unfortunately not share…). I have a GIT clone of it on my PC. Part of its Project.toml reads

name = "Lithe"
...version = "0.1.0"

[deps]
...
Espy = "1729f5b0-844e-4123-9b7f-b77abbdddeb6"
...
[compat]
julia = "1.7.0"

The dependency Espy (also home-made) is hosted at GitHub, and its Project.toml reads

name = "Espy"
uuid = "1729f5b0-844e-4123-9b7f-b77abbdddeb6"
authors = ["Philippe Maincon <...@...>"]
version = "0.1.0"

[deps]
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

Now, I want to work using Lithe. Because Lithe is not hosted on a server (and I might tweak it), use dev

(@v1.7) pkg> dev "C:\Users\philippem\Documents\GIT\Lithe"

I get an error I do not make sense of:

ERROR: Unsatisfiable requirements detected for package Espy [1729f5b0]:
 Espy [1729f5b0] log:
 ├─Espy [1729f5b0] has no known versions!
 └─restricted to versions * by Lithe [fc63d2cd] — no versions left
   └─Lithe [fc63d2cd] log:
     ├─possible versions are: 0.1.0 or uninstalled
     └─Lithe [fc63d2cd] is fixed to version 0.1.0

Watchamean Espy has no known versions?, Espy’s Project.toml declares it to be Espy 0.1.0.

I’d be thankful for any pointer.

You may add Espy first, and then try to dev Lithe.

Hi Liu,

This may be a good workaround. however, I need to be able to distribute Lithe within my company, and so I would like to take advantage of Julia’s package manager. And clearly I do not understand the package manager very well yet.

:grinning:

Philippe

For this case, LocalRegistry.jl may be a good choice for you, though I have no experience in using it.

I have read (superficially) the README file, and this is interesting: if I understand correctly, LocalRegistry.jl would allow me to create a package registry, either

  • for my personal use
  • for distribution at company level
    and thus provide me with an elegant distribution solution. I will definitely study this, thank you.

But I am still curious about what I did wrong to get this error message: using dev on a local package that has a publicly hosted dependency should work if done correctly, shouldn’t it?

I always do such things. There is no problem. If Espy is not registered in the General Registry, even it is a public git repo, you have to add Espy_github_URL it first before dev Lithe.

1 Like

Yes, this is a typical use case for the LocalRegistry package.

Yes, but unless you have deved the dependency first or have it available in a registry, Pkg does not know where to find information about that package.

1 Like

Shie-shie! This works .

I am surprised though: Lithe has plenty other dependencies which I do not need to add. OHHH! Now I get it! There is a Julia-package sort-of-DNS server somewhere, and it has never heard of Espy.

I reckon I need to follow these instructions.

https://github.com/JuliaRegistries/General

There we have it. Thanks!

Depends on whether your package is of public interest. If it’s something that’s only useful within your company, registering it in your own registry is more appropriate and very convenient with LocalRegistry.

1 Like