How to add information of unregistered packages on Project.toml instead of Manifest.toml?

Hi, I am working on a set of packages that I don’t want yet to register.
The issue is that when I add one as a dependency of another one, like add git@github.com:forestmod/GenFSM_resources.jl.git in the environment of GenFSM, then in GenFSM Poject.toml I have just the id of GenFSM_resources, but not its url, that is in Manifest.toml.
So, if I remove the Manifest.toml and I instantiate, I lose this information.

Is there a way to add to Project.toml the url of unregistered packages?
If not, I think this should be implemented at Pkg level, as to have Project.toml to store the id for registered packages and the id + full url for unregistered ones…

I understood that a solution is to employ a local registry, but I think it is a bit too much, I don’t want to set up a local registry, just make discoverable a bunch of public github repos…

A future version of Pkg will allow for a [sources] section in the Project.toml to handle this: Support a `[sources]` section in Project.toml for specifying paths and repo locations for dependencies by KristofferC · Pull Request #3783 · JuliaLang/Pkg.jl · GitHub

I’m not quite sure when this will be released, 1.11 or 1.12. You should be able to try it out now with nightly

2 Likes

An alternative is to perform the necessary pkg> add or pkg> dev inside CI, or as part of your test suite. You will also need to give detailed instructions for users on how to install the set of inter-related packages from URLs, in the correct order.

1 Like

1.11

3 Likes

Thank you… nice when you propose something and you discover it is just coming :slight_smile: :slight_smile: :slight_smile:

Don’t forget to add it to the News… for now, there is only the Manifest-v{major}.{minor}.toml feature…

I confirm this is “working” in julia-1.11.0-beta1, however I think I ran into a corner case.
I want to specify that my dependent package comes from an unregistered repo, but then, like for normal registered packages, I want also to specify that in this specific installation (Manifest) the package must come from a local source for development, as I am developing the 2 packages in parallel, but I am receiving an error:

Main package (GenFSM) Project.toml:

[deps]
GenFSM_resources = "731fd045-8cb1-4036-8c04-a2a477f3265a"

[sources]
GenFSM_resources = {url = "git@github.com:forestmod/GenFSM_resources.jl.git", rev = "main"}

Error when I try to specify to use a local version of the dependant package:

(GenFSM) pkg> dev GenFSM_resources
ERROR: `path` and `url` are conflicting specifications

I understand. I guess the [sources] section should maybe be only used when there is no information at all in the manifest about the package. As it is right now, it is pretty much enforced that you will have the same entry in [sources] as you have in the manifest.

1 Like