JuliaEcosystem / PkgDeps.jl

More insights about your packages dependencies
MIT License
23 stars 6 forks source link

Use the Pkg.Registry API #39

Closed danielmatz closed 1 year ago

danielmatz commented 2 years ago

As of Julia 1.7, Pkg.Registry provides some of the capability that had been implemented in this package. This commit makes this package's reachable_registries a simple wrapper around Pkg.Registry.reachable_registries and removes the RegistryInstance and PkgEntry types in favor of the types of the same name in Pkg.Registry.

The largest change is that this package's version of RegistryInstance stored a dictionary mapping package names to PkgEntrys, but Pkg.Registry's version has a dictionary mapping UUIDs to PkgEntrys.

A benefit of using the Pkg.Registry API is that it already supports both uncompressed registries as well as registries stored in compressed tarballs. Thus, this fixes #37.

danielmatz commented 2 years ago

We now use @static to keep the original implementation in place, but then use the new Pkg.Registry capabilities for Julia v1.7 and later. This seems to work, though we'll have to be very careful going forward. The PkgEntry and RegistryInstance types may have the same name, but their fields are just different enough to cause trouble.

I tested this locally on Julia 1.6 and 1.7, but I'd appreciate an extra set of eyes to make sure I didn't mess anything up.

mattBrzezinski commented 2 years ago

This package had its workflows disabled, things look good to me though. Not sure how to re-kick the CI to run, maybe just this comment will be enough? If not could you amend a commit message, force push back and that should start the job?

danielmatz commented 2 years ago

I force pushed, but now it seems to be waiting for your approval.

giordano commented 2 years ago

Yet another option is to use https://github.com/GunnarFarneback/RegistryInstances.jl (and this package was actually already suggested as a possible beneficiary)

danielmatz commented 1 year ago

I finally had some time to look at this again. I've created yet another pull request that takes the approach of using RegistryInstances. See #42. I'll close this in favor of that new PR.