Force installation from a specific repository
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with the setup-r-dependencies@v2 handling of extra-packages and the setup-r@v2 extra-repositories configuration described in the issue. Compare the proposed repository-qualified syntax with the current url:: workaround and determine how package selection should behave when repositories contain different versions. Done means a package can be selected from a named repository without manually tracking tarball URLs, with coverage for the rstan and StanHeaders examples.
Written by the indexing model from the issue text.
Description
Is your feature request related to a problem? Please describe.
When a package is available in multiple repositories, it would be helpful to force installation from a specific repository. The motivating examples are the rstan and StanHeaders packages. Both are available on CRAN (rstan 2.21.8 and StanHeaders 2.21.0-7), but are not the most up to date versions. The most recent versions are in a a CRAN-like repository from the Stan group (https://github.com/stan-dev/r-packages) which has rstan 2.26.22 and StanHeaders 2.26.22. I've added the mc-stan repository to extra repositories:
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
rtools-version: ${{ matrix.config.rtools }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
extra-repositories: https://mc-stan.org/r-packages/
However, the packages are still getting installed from the default CRAN (i.e., in the session info rstan is version 2.21.8; see example action run).
Describe the solution you'd like
Ideally, if a package exists in multiple repositories, I'd have the option to force installation from a specific repo. For example, maybe we could name extra repositories, and then use those names for install?
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
rtools-version: ${{ matrix.config.rtools }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
extra-repositories: |
mcstan = https://mc-stan.org/r-packages/
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::rcmdcheck
mcstan::rstan
mcstan::StanHeaders
needs: check
I'm not sure if that would actually work, but someway to indicate which repository a package should be installed from if multiple are available would be useful.
Describe alternatives you've considered
Currently, I'm using the url:: specification. This works, but is suboptimal because I have to track when updates are made to the stan-dev/r-packages repository, and then update the url manually.
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::rcmdcheck
url::https://mc-stan.org/r-packages/src/contrib/rstan_2.26.22.tar.gz
url::https://mc-stan.org/r-packages/src/contrib/StanHeaders_2.26.22.tar.gz
needs: check
- Dominant language
- TypeScript
- Stars
- 1.1k
- Forks
- 234
- Avg merge
- 2h 34m
- Merged PRs (30d)
- 3
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from r-lib/actions
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
bug help wanted :heart:
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
feature
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
feature
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
feature
Difficulty 5/5 Over a week Newbie friendliness 30/100
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·