Skip to content
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

Optionally install packages during snapshot() #1370

Merged
merged 22 commits into from
Jun 5, 2023
Merged

Optionally install packages during snapshot() #1370

merged 22 commits into from
Jun 5, 2023

Conversation

hadley
Copy link
Member

@hadley hadley commented May 31, 2023

Fixes #1198

@hadley hadley requested a review from kevinushey May 31, 2023 17:58
R/snapshot.R Outdated
@@ -971,6 +971,9 @@ renv_snapshot_filter_impl <- function(project, records, packages, type) {
}

renv_snapshot_filter_report_missing <- function(missing, type) {
if (!interactive() || !renv_verbose()) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic is wrong — still need to show the message even if not interactive.

Copy link
Collaborator

@kevinushey kevinushey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; I can't think of a better solution other than finding a way to pull out renv_snapshot_filter_report_missing but that seems tough to untangle.

hadley added 3 commits June 2, 2023 07:14
#Conflicts:
#	NEWS.md
#	tests/testthat/_snaps/snapshot.md
#	tests/testthat/test-snapshot.R
@hadley
Copy link
Member Author

hadley commented Jun 5, 2023

@kevinushey would you mind taking a look in your windows VM to figure out what's wrong with https://github.com/rstudio/renv/actions/runs/5164075054/jobs/9302761838?pr=1370#step:6:225?

@kevinushey
Copy link
Collaborator

Looks like it might be due to path separators?

> tempdir()
[1] "C:\\temp\\RtmpmKiprC"
> getwd()
[1] "C:/temp/RtmpmKiprC/renv-test-36fc460a4fe2"

Maybe

x <- gsub(getwd(), "<wd>", x, fixed = TRUE)
should be a regex or something accepting either kind of separator? Or just normalize getwd() before checking?

@hadley
Copy link
Member Author

hadley commented Jun 5, 2023

I have tried like 7 different ways of normalizing the path, but it's totally possible I screwed it up every time 😄

@hadley
Copy link
Member Author

hadley commented Jun 5, 2023

I'm relieved that this wasn't simple 😆

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.

Confusing prompt from snapshot()
2 participants