rstudio / rstudio/packrat

Adding `testthat` to `Suggests` and `external.packages` snapshots dependencies

Open
#427 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
409
Forks
89
PR merge metrics
No merged PRs in 30d

Description

If I add the package testthat to both external.packages in packrat/packrat.opts and the Suggests-field in the DESCRIPTION the dependencies of testthat are included in the snapshot. This seems unnecessary as one could assume that the external package will take care of its own dependencies.

Steps to reproduce:

  1. Create a plain new project in RStudio.
  2. Enable packrat while excluding testthat
  3. Add Suggests: testthat to DESCRIPTION
  4. Run:
> packrat::snapshot()

Adding these packages to packrat:
             _       
    R6         2.2.2 
    crayon     1.3.2 
    digest     0.6.12
    magrittr   1.5   
    praise     1.0.0 

Note that the directory packrat/lib doesn't contain any installed packages except packrat itself, a subsequent packrat::restore does install the dependencies.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the snapshot behavior involving packrat/packrat.opts and the Suggests field in DESCRIPTION. Reproduce the steps with testthat excluded, then compare the packages recorded by packrat::snapshot() with those installed by packrat::restore(). Done means external packages do not cause their own dependencies to be added unnecessarily to the snapshot.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.