Skip to content

allow package projects to include themselves in the lockfile#2335

Merged
kevinushey merged 1 commit into
mainfrom
feature/snapshot-include-self
Jul 15, 2026
Merged

allow package projects to include themselves in the lockfile#2335
kevinushey merged 1 commit into
mainfrom
feature/snapshot-include-self

Conversation

@kevinushey

Copy link
Copy Markdown
Collaborator

Closes #2285.

Package projects can now request that the package itself be included in the lockfile, by setting the following in the package DESCRIPTION file:

Config/renv/snapshot/include-self: TRUE

When set:

  • The package is no longer excluded from the lockfile during snapshot (same effect as the existing, previously-undocumented renv.snapshot.ignore.self option, which still takes precedence when set);
  • The package is also treated as a dependency of the project itself, so inclusion doesn't depend on directory structure (e.g. an app.R referencing the package). This covers both implicit and explicit snapshot types.

An explicit Config/renv/snapshot/include-self: FALSE excludes the package even in golem projects, which are otherwise auto-included.

Also documents the renv.snapshot.ignore.self option in ?snapshot, along with the caveat that the package should be installed from a restorable remote source (e.g. renv::install("<user>/<repo>")) for deployment to work.

@kevinushey
kevinushey merged commit 9972ce8 into main Jul 15, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow/forcing project package to be included in renv.lock

1 participant