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

provide exported functions for interacting with lockfiles #1438

Merged
merged 6 commits into from
Jun 13, 2023

Conversation

kevinushey
Copy link
Collaborator

TBH I'm still on the fence on whether we should provide all these methods, or a single function lockfile that returns the "API" object as we did before.

@kevinushey kevinushey requested a review from hadley June 12, 2023 23:31
Copy link
Member

@hadley hadley left a comment

Choose a reason for hiding this comment

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

I definitely prefer the individual functions over providing a list of functions as an API.

@@ -416,7 +416,7 @@ local({
on.exit(do.call(base::options, saved), add = TRUE)
}

catf("* Downloading from GitHub ... ", appendLF = FALSE)
catf("* Downloading version %s from GitHub ... ", version, appendLF = FALSE)
Copy link
Member

Choose a reason for hiding this comment

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

Spurious diff?

#' @rdname lockfile
#' @export
lockfile_modify <- function(lockfile,
...,
Copy link
Member

Choose a reason for hiding this comment

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

Not used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not used internally, but I thought this might be useful for end users (e.g. a way to explicitly set the repositories in a lockfile)

Copy link
Member

Choose a reason for hiding this comment

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

Oh I meant the ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh sorry. That's there intentionally so we can:

  1. Force some arguments to be named,
  2. Add new arguments (in any order) in a backwards compatible way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(but maybe I should add renv_dots_check() to warn about unused arguments)

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I think if you use ... for this purpose, you need to error if there's anything in them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok; I made that change on main.

@@ -96,7 +96,80 @@
#' Note that the `Name` field may be empty. In that case, a project-local Python
#' environment will be used instead (when not directly using a system copy of Python).
#'
#' @inheritParams snapshot
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest adding a "for expert use only" caution somewhere.

@hadley
Copy link
Member

hadley commented Jun 13, 2023

Maybe remove lockfile-api.R as part of this PR?

@kevinushey
Copy link
Collaborator Author

Maybe remove lockfile-api.R as part of this PR?

I did indeed do that 🙂

@kevinushey kevinushey merged commit 85f32bd into main Jun 13, 2023
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.

2 participants