How to automatically add dependencies?

I have written a small package, and uploaded it to github: Bai-Zhan/GluonModel

I have also written another package, which depends on this GluonModel package: Bai-Zhan/ColdDSE.

Now I want to install the ColdDSE package in a clean environment with

] add

I would expect that it will also install the GluonModel package since it is in the dependency list of ColdDSE. However, there appears an error message reading:

ERROR: Unsatisfiable requirements detected for package GluonModel [168114fb]:
 GluonModel [168114fb] log:
 ├─GluonModel [168114fb] has no known versions!
 └─restricted to versions * by ColdDSE [6af89522] — no versions left
   └─ColdDSE [6af89522] log:
     ├─possible versions are: 0.1.0 or uninstalled
     └─ColdDSE [6af89522] is fixed to version 0.1.0

This problem can be solved if I install the GluonModel package in advance manually:

] add

but I hope these dependencies can be installed automatically, since there is likely to be more and more dependencies like this in the future.

How can I fix this problem?

Your Project.toml file lists no dependencies (and your code does not import ColdDSE either.

You need to Pkg.add or Pkg.develop ColdDSE (which will then appear in [deps] of Project.toml.

The Project.toml file of GluonModel lists no dependencies because it does not depend on any other package.

The Project.toml file of ColdDSE lists several dependencies, which includes the GluonModel that I want to automatically install.

GluonModel is not registered so it cannot be resolved as a dependency. The manifest of the other package is not enough when you ]add. Not sure what the best practice is for this case. You might consider a private registry if you regularly work with interdependent non-registered packages.

1 Like