metrumresearchgroup / pkgr

R package installation and management - reimagined.
https://metrumresearchgroup.github.io/pkgr/docs
39 stars 4 forks source link

Feature: Allow passing url to download tarball and install packages #404

Open rymarinelli opened 2 years ago

rymarinelli commented 2 years ago

As a user, I want to be able to specify the url under the repo in the YAML and download a package from source.

Repos:
  - marginaleffects: https://cloud.r-project.org/src/contrib/marginaleffects_0.5.0.tar.gz

Customizations:
  Packages:
  - marginaleffects: {Type: source}
dpastoor commented 2 years ago

One thing you might consider, is this functionality is already largely present in the Tarballs implementation, it just knows how to find stuff on the filesystem. It wouldn't be that significant of a code change to instead also allow that to be a URL.

For example, https://github.com/metrumresearchgroup/pkgr/blob/develop/cmd/tarballOps.go#L56 just expects a path on the filesystem, could instead detect if strings.Prefix("http") .... then its a remote tarball, go download it first then begin.

Then the implementation would be:

Tarballs:
- https://cloud.r-project.org/src/contrib/marginaleffects_0.5.0.tar.gz
kyleam commented 2 years ago

@dpastoor I think that's a good point (and had the similar thought when reading the initial post). And conceptually the Tarballs section feels more appropriate to me than Repos because a URL pointing to a package tarball isn't a repository.