PkgManager.jl for dev package management

Hey Julianners,
I often faced with a problem like this:

ERROR: LoadError: ArgumentError: Package BinanceAPI does not have RateLimiter in its dependencies:
- You may have a partially installed environment. Try `Pkg.instantiate()`
  to ensure all packages in the environment are installed.
- Or, if you have BinanceAPI checked out for development and have
  added RateLimiter as a dependency but haven't updated your primary
  environment's manifest file, try `Pkg.resolve()`.
- Otherwise you may need to report an issue with BinanceAPI

And I felt like I am always stucked resolving the pkgs manually (wasting minutes) as there were problems with development pkgs and registered packages in Project.toml that wasn’t resolved just by running Pkg.resolve().

That’s why I created Cvikli/PkgManager.jl package that automatically able to resolve these kinds of issues.

I would be happy to see your feedbacks. Also, I know it isn’t perfect yet, but it works 99% of the times.

I was thinking about whether we could “allow the package manager to take control when this error arise”. I tried to modify the Base library code, but I see it is harder than just overwriting some Base function for our convenience. Furthermore, I wanted to ask the developers of Julia whether it is possible to review this code and add some more idea to it also prepare it to be as comprehensive as possible and later on just add to the Base library where this ArgumentError is thrown (Do you want to resolve it automatically? (yes(y), no).

Thank you for checking it!

1 Like

With Julia 1.11, Pkg.jl is just a package and no longer compiled into the system image. That makes it easier to develop independently, just like a normal package.

I have not had the chance to look through what exactly your package does, but it seems to mostly use a series of Pkg high level commands to automate updating manifests. This could possibly be a pull request to Pkg.jl.

1 Like

Yes. Basically automatic package dependency issue resolution. :smiley:

So nobody should care about managing the Project.toml. Could spare millions of hours for the community. :wink:

1 Like

It might be useful if you could write out some documentation about what these commands are doing. I will see if I can parse it later today.

1 Like

I checked out the package, because I also had this issue countless times.

When someone is building multiple packages which, dependency management becomes a task.
Automatically adding relevant dependencies to the Manifest.toml seems quite reasonable. On demand adding is also already good, ofc as an improvement to Pkg.jl would be the nicest.

Current solution, your code fails with an “ERROR”, even though you have a missing dependency, which is actually avaiable just not listed! Crazy. Anything is better IMO.

1 Like

Okay, I made some clarification! :slight_smile:

So this is 3 function all in all:

  • CLEAN_Project_toml("PkgName") : cleans the unused packages from Project.toml → [“deps”]
  • SOLVE_dependency_issue("PkgName") : that resolves the dependency issue.
  • SOLVE_PKG("PkgName") : to call each one in order.