-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Add support for Additional_repositories
field in DESCRIPTION file
#424
Comments
@gaborcsardi: I remember seeing an alternative approach for specifying this so that pak can use CRAN-like repos. Does this ring a bell? Needed for tidyverse/dplyr#6526. |
IDK what you mean. On GHA you can set |
Can I indicate in |
No, you cannot currently, apart from using an |
That would work for my use case. Will that pick up binary packages from r-universe? |
AFAIK you can link to binary packages with |
I want to install bleeding edge duckdb so that the tests run on CI/CD. Can I use |
Maybe, I never tried that.
Why not add the duckdb repo on the CI instead? Repository configuration does not belong in the package metadata. |
I tried remotes::install_github("duckdb/duckdb/tools/rpkg")
#> Downloading GitHub repo duckdb/duckdb@HEAD
#>
#> * checking for file ‘/private/var/folders/dj/yhk9rkx97wn_ykqtnmk18xvc0000gn/T/RtmpS8daew/remotes1513e111fe4e9/duckdb-duckdb-dfae126/tools/rpkg/DESCRIPTION’ ... OK
#> * preparing ‘duckdb’:
#> * checking DESCRIPTION meta-information ... OK
#> * cleaning src
#> * checking for LF line-endings in source and make files and shell scripts
#> * checking for empty or unneeded directories
#> * building ‘duckdb_0.6.0.tar.gz’
#> Installing package into '/Users/kirill/Library/R/arm64/4.1/library'
#> (as 'lib' is unspecified)
#> Warning in i.p(...): installation of package '/var/folders/dj/
#> yhk9rkx97wn_ykqtnmk18xvc0000gn/T//RtmpS8daew/file1513e133d9fae/
#> duckdb_0.6.0.tar.gz' had non-zero exit status Created on 2022-11-24 with reprex v2.0.2 On the console I see:
|
Hmmm, why is that a pak issue? |
Because pak is used at the front end in GitHub Actions. I was looking for functionality existing today to achieve the desired behavior: install dev duckdb as a dplyr dependency. I tried |
FWIW, the linked issue contains a bad idea. But installing from a subdirectory should work even if the installation process accesses files from outside the R package. |
But you did not use pak at all in your test. Also, the installation fails for a completely different reason, so that's not even a remotes issue. Btw. it also fails if you clone the repo and call
That is for cran-like repositories, and only for optional dependencies. If you indeed have a cran-like repo for dev duckdb, then specify that in
In that issue you tried to install Nevertheless (the dev version of) pak (or any version of remotes) can happily install from a subdirectory, as long as you specify the subdirectory. They assume that you can run This clearly does not hold for duckdb, so there is not much we can do. You'll need to clone the repo, and then manually create an R package using whatever procedure duckdb uses to do that. |
Doesn't pak use {remotes} internally? I missed that remotes::install_github("krlmlr/duckdb/tools/rpkg@f-cleanup") The Lastly, is there a reason why pak shouldn't be using I'll work around. |
It does not.
No reason, it will be probably supported eventually. It is not entirely clear how it should be supported, as it can only be used for suggested packages on CRAN, and it is not part of the CRAN metadata, so we don't know if CRAN(like) packages have |
{rnaturalearth} is on CRAN: https://cran.r-project.org/web/packages/rnaturalearth/index.html I would personally be interested in this feature too, as the use of "r-universe" may change the way I choose my dependencies for CRAN packages. I created a reprex there, that you can fork for your tests if you want: https://github.com/statnmap/test.add.repos - name: Additional Repositories
run: |
cat(
"\noptions(repos = c(thinkropen = 'https://thinkr-open.r-universe.dev', getOption('repos')))",
file = ".Rprofile", append = TRUE)
source(".Rprofile")
shell: Rscript {0} |
Have you tried adding the extra repo to |
No I have not. I am not sure where I should do it. In the yaml file? |
It is the |
Oh yes, it works ! Link to the yaml file: https://github.com/statnmap/test.add.repos/blob/main/.github/workflows/R-CMD-check.yaml |
Works perfectly. Thank you, @statnmap and @gaborcsardi. 👍 |
tags: ci, test Why? - {pak} does not account for extra-repository field in description for now: r-lib/pak#424 What? - Add extra repo in the CI yaml files issue #7
Although adding |
It takes about the same amount of time to add |
|
Not really, CRAN does not install anything from
Neither does
We already have other entries, e.g.
pak will not see the
The other issue is that it introduces ambiguity wrt. where packages should be installed from, in case packages are available in multiple repositories. And they will be typically available in multiple repositories, because all packages of a GitHub user/organization are in the same R-universe repo. I guess some users would prefer that repo over CRAN, others might not. So I would prefer syntax that declares that a certain package should be installed from a certain repository (like we already have in |
My understanding of |
FWIW, |
To make
pak
a more complete "alternative toinstall.packages()
", I think that it would be useful ifpak
used theAdditional_repositories
field in theDESCRIPTION
file: https://cran.r-project.org/doc/manuals/R-exts.html#Package-DependenciesOriginally posted by @billdenney in #421 (comment)
The text was updated successfully, but these errors were encountered: