You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we're trying to use the renv::init function using the explicit snapshot type (only capturing the dependencies as declared in the DESCRIPTION).
It looks like the snapshot type is ignored when submitted interactively as opposed to setting it in advance.
Our workflow was as follows: (in a new package without any dependencies):
setup a package without dependencies (using usethis::create_package())
add a function using tibble package ( use_r("tibble.R")) without adding tibble as package dependency to DESCRIPTION
run renv::init() interactively
renv::init()
#> This project contains a DESCRIPTION file.
#> Which files should renv use for dependency discovery in this project?
#>
#> 1: Use only the DESCRIPTION file. (explicit mode)
#> 2: Use all files in this project. (implicit mode)
#>
#> Selection: 1
#>
#> - Using 'explicit' snapshot type. Please see `?renv::snapshot` for more details.
#>
#> - Linking packages into the project library ... Done!
#> The following package(s) will be updated in the lockfile:
#>
#> # CRAN -----------------------------------------------------------------------
#> - cli [* -> 3.6.1]
#> - glue [* -> 1.6.2]
#> - lifecycle [* -> 1.0.3]
#> - magrittr [* -> 2.0.3]
#> - renv [* -> 1.0.0]
#> - rlang [* -> 1.1.1]
#> - vctrs [* -> 0.6.3]
#>
#> # RSPM -----------------------------------------------------------------------
#> - fansi [* -> 1.0.4]
#> - pillar [* -> 1.9.0]
#> - pkgconfig [* -> 2.0.3]
#> - tibble [* -> 3.2.1]
#> - utf8 [* -> 1.2.3]
#>
#> The version of R recorded in the lockfile will be updated:
#> - R [* -> 4.3.1]
#>
#> - Lockfile written to '~/cstepper/justfortesting/renvtestr/renv.lock'.
#>
#> Restarting R session...
#>
#> - Project '~/cstepper/justfortesting/renvtestr' loaded. [renv 1.0.0]
It looks like all package dependencies from tibble are written to the renv.lock (as we assume is "implicit" mode, not "explicit"). Also, in renv/settings.json snapshot type "implicit" is defined, not "explicit" as chosen interactively.
In contrast, when manually setting the type before renv::init() it seems to work as expected:
renv::settings$snapshot.type("explicit")
renv::init()
#> The following package(s) will be updated in the lockfile:
#>
#> # CRAN -----------------------------------------------------------------------
#> - renv [* -> 1.0.0]
#>
#> The version of R recorded in the lockfile will be updated:
#> - R [* -> 4.3.1]
#>
#> - Lockfile written to '~/cstepper/justfortesting/renvtestr/renv.lock'.
#>
#> Restarting R session...
#>
#> - Project '~/cstepper/justfortesting/renvtestr' loaded. [renv 1.0.0]
#>
Any ideas?
Thanks
The text was updated successfully, but these errors were encountered:
Hi,
we're trying to use the
renv::init
function using the explicit snapshot type (only capturing the dependencies as declared in the DESCRIPTION).It looks like the snapshot type is ignored when submitted interactively as opposed to setting it in advance.
Our workflow was as follows: (in a new package without any dependencies):
usethis::create_package()
)tibble
package (use_r("tibble.R")
) without addingtibble
as package dependency to DESCRIPTIONrenv::init()
interactivelyIt looks like all package dependencies from
tibble
are written to therenv.lock
(as we assume is "implicit" mode, not "explicit"). Also, inrenv/settings.json
snapshot type "implicit" is defined, not "explicit" as chosen interactively.In contrast, when manually setting the type before
renv::init()
it seems to work as expected:Any ideas?
Thanks
The text was updated successfully, but these errors were encountered: