-
Notifications
You must be signed in to change notification settings - Fork 4
Design function dependencies #185
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
Draft
Melkiades
wants to merge
3
commits into
main
Choose a base branch
from
design_fnc_deps@main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,13 @@ | |
| # todo: local_repos to data.frame: package name to directory: no, because this means that the package needs to be fetched from the remote first | ||
| # todo? unlink(get_packages_cache_dir(), recursive = TRUE); dir.create(get_packages_cache_dir()) | ||
|
|
||
| # Helper function copied from fs internals | ||
| is_windows <- function() { | ||
| if (isTRUE(Sys.getenv("FS_IS_WINDOWS", "FALSE") == "TRUE")) { | ||
| return(TRUE) | ||
| } | ||
| tolower(Sys.info()[["sysname"]]) == "windows" | ||
| } | ||
|
Comment on lines
+7
to
+13
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This in theory could check if on windows to solve #177 |
||
|
|
||
| #' Create dependency structure of your package collection | ||
| #' @param project (`character`) If `project_type` is `local` then | ||
|
|
@@ -76,12 +83,15 @@ dependency_table <- function(project = ".", | |
| verbose = 1) { | ||
|
|
||
| # validate arguments | ||
| stopifnot(is.data.frame(local_repos) || is.null(local_repos)) | ||
| check_verbose_arg(verbose) | ||
| checkmate::assert_data_frame(local_repos, null.ok = TRUE) | ||
| checkmate::assert_int(verbose, lower = 0, upper = 2) | ||
| direction <- check_direction_arg_deprecated(direction) | ||
| check_direction_arg(direction) | ||
| stopifnot(project_type %in% c("local", "repo@host")) | ||
| stopifnot(rlang::is_scalar_character(fallback_branch)) | ||
| checkmate::assert_choice(project_type, c("local", "repo@host")) | ||
| checkmate::assert_character(fallback_branch, max.len = 1) | ||
|
|
||
| # Ideally here we could catch the error for windows and too long paths | ||
| # if (is_windows()) | ||
|
|
||
| if (project_type == "repo@host" && (is.null(ref) || nchar(ref) == 0)) { | ||
| stop("For non-local projects the (branch/tag) must be specified") | ||
|
|
@@ -112,12 +122,12 @@ dependency_table <- function(project = ".", | |
| repo_to_process <- list(parse_remote_project(project)) | ||
| } | ||
|
|
||
|
|
||
| # a dataframe with columns repo, host, ref, sha, cache_dir, accessible (logical) | ||
| internal_deps <- rec_checkout_internal_deps( | ||
| repo_to_process, ref, | ||
| direction = direction, | ||
| local_repos = local_repos, fallback_branch = fallback_branch, | ||
| local_repos = local_repos, | ||
| fallback_branch = fallback_branch, | ||
| verbose = verbose | ||
| ) | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.