diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 7b788e0..58dc2e0 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -24,7 +24,7 @@ jobs: - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: lintr@3.2.0, any::pkgload, local::. + extra-packages: any::lintr, any::pkgload, local::. needs: lint - name: Lint diff --git a/DESCRIPTION b/DESCRIPTION index f312a76..1360ba7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -18,32 +18,29 @@ License: MIT + file LICENSE URL: https://databrary.github.io/databraryr/, https://github.com/databrary/databraryr BugReports: https://github.com/databrary/databraryr/issues +Depends: + R (>= 4.3.0) Imports: assertthat (>= 0.2.1), dplyr (>= 1.1.4), - getPass (>= 0.2.4), - httr2 (>= 1.0.0), - keyring (>= 1.3.2), + getPass (>= 0.2-4), + httr2 (>= 1.2.1), + keyring (>= 1.4.1), lifecycle (>= 1.0.4), - magrittr, - methods (>= 4.3.2), - options (>= 0.2.0), - purrr (>= 1.0.2), - stringr (>= 1.5.1), + magrittr (>= 2.0.0), + openssl (>= 2.0.0), + options (>= 0.3.1), + purrr (>= 1.1.0), + stringr (>= 1.5.2), stats, - tibble (>= 3.2.1) + tibble (>= 3.3.0) Suggests: - av (>= 0.9.0), - covr (>= 3.6.0), - ggplot2, - knitr, - lintr (>= 3.0.0), - openssl, - readr, - rmarkdown (>= 2.26), - testthat (>= 3.0.0), - withr (>= 2.5.0), - xml2 (>= 1.3.0) + covr (>= 3.6.5), + knitr (>= 1.45), + lintr (>= 3.3.0), + rmarkdown (>= 2.31), + testthat (>= 3.2.3), + withr (>= 3.0.2) VignetteBuilder: knitr Config/testthat/edition: 3 diff --git a/NAMESPACE b/NAMESPACE index d5eebbb..458d8f6 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -113,6 +113,5 @@ export(update_session_file) export(update_volume_record) export(upload_file) export(whoami) -importFrom(lifecycle,deprecated) +importFrom(lifecycle,badge) importFrom(magrittr,"%>%") -importFrom(methods,is) diff --git a/R/databraryr-package.R b/R/databraryr-package.R index 1f81120..9ce25a5 100644 --- a/R/databraryr-package.R +++ b/R/databraryr-package.R @@ -2,7 +2,6 @@ "_PACKAGE" ## usethis namespace: start -#' @importFrom lifecycle deprecated -#' @importFrom methods is +#' @importFrom lifecycle badge ## usethis namespace: end NULL diff --git a/R/get_institution_avatar.R b/R/get_institution_avatar.R index e719560..b5f86f9 100644 --- a/R/get_institution_avatar.R +++ b/R/get_institution_avatar.R @@ -78,9 +78,9 @@ get_institution_avatar <- function(institution_id = 1, } # Build the request with the avatar URL - req <- req %>% - httr2::req_url(full_url) %>% - httr2::req_method("GET") %>% + req <- req |> + httr2::req_url(full_url) |> + httr2::req_method("GET") |> httr2::req_error( is_error = function(resp) { FALSE diff --git a/R/get_institution_by_id.R b/R/get_institution_by_id.R index 9c7a9e7..836d45b 100644 --- a/R/get_institution_by_id.R +++ b/R/get_institution_by_id.R @@ -45,6 +45,6 @@ get_institution_by_id <- function(institution_id = 12, latitude = institution$latitude, longitude = institution$longitude, manual_coordinates = institution$manual_coordinates - ) %>% + ) |> as.list() } diff --git a/R/get_user_by_id.R b/R/get_user_by_id.R index 11d972a..f777087 100644 --- a/R/get_user_by_id.R +++ b/R/get_user_by_id.R @@ -47,6 +47,6 @@ get_user_by_id <- function(user_id = 6, affiliation_id = institution_id, is_authorized_investigator = user$is_authorized_investigator, has_avatar = user$has_avatar - ) %>% + ) |> as.list() } diff --git a/R/list_asset_formats.R b/R/list_asset_formats.R index 97d1429..d332774 100644 --- a/R/list_asset_formats.R +++ b/R/list_asset_formats.R @@ -32,8 +32,8 @@ list_asset_formats <- function(vb = options::opt("vb")) { transcodable <- NULL if (!is.null(db_constants$format)) { - purrr::map(db_constants$format, as.data.frame) %>% - purrr::list_rbind() %>% + purrr::map(db_constants$format, as.data.frame) |> + purrr::list_rbind() |> dplyr::rename(format_id = id, format_mimetype = mimetype, format_extension = extension, @@ -42,6 +42,6 @@ list_asset_formats <- function(vb = options::opt("vb")) { } else { if (vb) message("No format information retrieved.") - return(NULL) + NULL } } diff --git a/R/list_folder_assets.R b/R/list_folder_assets.R index 6b1ee8f..57f55cd 100644 --- a/R/list_folder_assets.R +++ b/R/list_folder_assets.R @@ -96,7 +96,7 @@ list_folder_assets <- function(folder_id = 9807, ) }) - file_rows %>% + file_rows |> dplyr::mutate( folder_id = folder_id, vol_id = vol_id, diff --git a/R/list_session_assets.R b/R/list_session_assets.R index f6e341f..2e4d5a5 100644 --- a/R/list_session_assets.R +++ b/R/list_session_assets.R @@ -99,7 +99,7 @@ list_session_assets <- function(session_id = 9807, ) }) - asset_rows %>% + asset_rows |> dplyr::mutate( session_id = session_id, vol_id = vol_id, diff --git a/R/list_user_volumes.R b/R/list_user_volumes.R index ae6a1a5..3f82147 100644 --- a/R/list_user_volumes.R +++ b/R/list_user_volumes.R @@ -48,11 +48,11 @@ list_user_volumes <- function(user_id = 6, vol_access_level = entry$access_level, vol_sharing_level = entry$sharing_level ) - }, .progress = TRUE) %>% - purrr::list_rbind() %>% + }, .progress = TRUE) |> + purrr::list_rbind() |> dplyr::mutate(user_id = user_df$id, user_prename = user_df$prename, user_sortname = user_df$sortname, - user_affiliation = user_df$affiliation) %>% + user_affiliation = user_df$affiliation) |> dplyr::arrange(vol_id) } diff --git a/R/list_volume_assets.R b/R/list_volume_assets.R index 8eec11f..ce5e958 100644 --- a/R/list_volume_assets.R +++ b/R/list_volume_assets.R @@ -79,9 +79,9 @@ list_volume_assets <- function(vol_id = 1, session_date = session$source_date, session_release = session$release_level ) - }, .progress = TRUE) %>% + }, .progress = TRUE) |> purrr::list_rbind() - }) %>% + }) |> purrr::list_rbind() if (is.null(files) || nrow(files) == 0) { diff --git a/R/list_volume_funding.R b/R/list_volume_funding.R index b251525..04835e2 100644 --- a/R/list_volume_funding.R +++ b/R/list_volume_funding.R @@ -68,7 +68,7 @@ list_volume_funding <- function(vol_id = 1, rows <- dplyr::mutate(rows, vol_id = id) } rows - }) %>% + }) |> purrr::list_rbind() if (is.null(out) || nrow(out) == 0L) { diff --git a/R/list_volume_info.R b/R/list_volume_info.R index ce40175..4a43c70 100644 --- a/R/list_volume_info.R +++ b/R/list_volume_info.R @@ -39,7 +39,7 @@ list_volume_info <- volume <- databraryr::get_volume_by_id(vol_id = vol_id, vb = vb, rq = rq) if (is.null(volume)) { - return(NULL) + NULL } else { if (vb) message("Summarising volume detail...") diff --git a/R/list_volume_session_assets.R b/R/list_volume_session_assets.R index 234cc9e..74aefeb 100644 --- a/R/list_volume_session_assets.R +++ b/R/list_volume_session_assets.R @@ -102,7 +102,7 @@ list_volume_session_assets <- session_name = session$name, session_release = session$release_level ) - }) %>% + }) |> purrr::list_rbind() asset_rows diff --git a/R/list_volume_sessions.R b/R/list_volume_sessions.R index efc8cfd..666abd8 100644 --- a/R/list_volume_sessions.R +++ b/R/list_volume_sessions.R @@ -82,7 +82,7 @@ list_volume_sessions <- vb = vb ) - df <- df %>% + df <- df |> dplyr::mutate( vol_id = volume$id, vol_name = volume$title, diff --git a/R/make_login_client.R b/R/make_login_client.R index df2de34..40c7cf7 100644 --- a/R/make_login_client.R +++ b/R/make_login_client.R @@ -123,8 +123,8 @@ make_login_client <- function(email = NULL, if (is.null(rq)) rq <- make_default_request() - rq <- rq %>% - httr2::req_url(LOGIN) %>% + rq <- rq |> + httr2::req_url(LOGIN) |> httr2::req_body_json(list(email = email, password = password)) resp <- tryCatch(