Skip to content

Commit 5cb180c

Browse files
authored
Merge pull request #3 from jwokaty/devel
Update after 3.23 release
2 parents 9d653c7 + 2bc7fd3 commit 5cb180c

14 files changed

Lines changed: 203 additions & 86 deletions
Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,23 @@ on:
77
- cron: "30 16 * * *" # 2:30pm ET
88
workflow_dispatch:
99

10-
name: pkgdown
10+
name: quarto
1111

1212
jobs:
13-
pkgdown:
13+
quarto:
1414
runs-on: ubuntu-latest
1515
env:
1616
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1717
steps:
1818
- uses: actions/checkout@v4
1919

20-
- uses: r-lib/actions/setup-r@v2
21-
with:
22-
use-public-rspm: true
20+
- uses: quarto-dev/quarto-actions/setup@v2
2321

24-
- uses: quarto-dev/quarto-actions/setup@v2
22+
- uses: r-lib/actions/setup-r@v2
2523

2624
- uses: r-lib/actions/setup-r-dependencies@v2
2725
with:
2826
extra-packages: |
29-
any::pkgdown
3027
any::remotes
3128
local::.
3229
needs: website
@@ -35,9 +32,8 @@ jobs:
3532
run: BiocManager::install("Bioconductor/biocUniTools")
3633
shell: Rscript {0}
3734

38-
- name: Build site
39-
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, quiet = FALSE)
40-
shell: Rscript {0}
35+
- name: Render
36+
run: quarto render
4137

4238
- name: Deploy to GitHub pages
4339
uses: JamesIves/github-pages-deploy-action@v4

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ vignettes/*_files/*
22
vignettes/*.html
33
docs
44
.Rhistory
5+
6+
/.quarto/

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ Suggests:
2929
testthat (>= 3.0.0)
3030
Encoding: UTF-8
3131
Roxygen: list(markdown = TRUE)
32-
RoxygenNote: 7.3.3
3332
VignetteBuilder: quarto
3433
Config/testthat/edition: 3
34+
Config/roxygen2/version: 8.0.0

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Generated by roxygen2: do not edit by hand
22

3+
export(.expand_jobs)
34
export(filter_by_arch)
45
export(get_binary_os)
56
export(get_candidates)

R/utils.R

Lines changed: 94 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ get_raw_uni_df <- function(uni) {
196196
#'
197197
#' @noRd
198198
match_binaries <- function(binaries, r_xy, os, arch) {
199+
if (nrow(binaries) == 0)
200+
return(binaries)
201+
199202
if (!"arch" %in% names(binaries))
200203
binaries$arch <- NA_character_
201204
binaries_os_ <- get_binary_os(binaries$os)
@@ -210,24 +213,23 @@ match_binaries <- function(binaries, r_xy, os, arch) {
210213
arch_match, ]
211214
}
212215

213-
#' Flatten raw universe data.frame by matching R, OS, and arch information from
214-
#' `_jobs` with `_binaries`
216+
#' get_uni_df helper to expand `_jobs`
215217
#'
216218
#' @description
217-
#' Adds additional columns to `_jobs_r_xy`, `_binaries_r_xy`,
218-
#' `_jobs_type`, `_jobs_arch`, `_jobs_os_`, `_binaries_os_`
219+
#' Adds additional columns to `_jobs_r_xy`, `_jobs_type`, `_jobs_arch`,
220+
#' `_jobs_os_`
219221
#'
220-
#' @param raw_df raw data.frame from R Universe API
222+
#' @param df data.frame unprocessed data from R Universe API
221223
#'
222224
#' @returns data.frame
223225
#'
224226
#' @examples
225227
#' raw_df <- get_raw_uni_df("bioc")
226-
#' get_uni_df(raw_df)
228+
#' df <- .expand_jobs(raw_df)
227229
#'
228230
#' @export
229-
get_uni_df <- function(raw_df) {
230-
uni_df <- raw_df |>
231+
.expand_jobs <- function(df) {
232+
df |>
231233
tidyr::unnest(`_jobs`, names_sep = "_", names_repair = "unique") |>
232234
dplyr::mutate(
233235
`_jobs_r_xy` = r_xy_ver(`_jobs_r`),
@@ -242,23 +244,63 @@ get_uni_df <- function(raw_df) {
242244
.default = NA),
243245
`_jobs_os_` = dplyr::if_else(`_jobs_type` == "binary",
244246
get_binary_os(stringr::str_split_i(`_jobs_config`, "-", 1)),
245-
"linux")) |>
246-
(\(df) dplyr::bind_rows(
247-
df |>
248-
dplyr::filter(`_jobs_type` == "binary") |>
249-
dplyr::mutate(`_binaries` = purrr::pmap(
250-
list(`_binaries`, `_jobs_r_xy`, `_jobs_os_`, `_jobs_arch`),
251-
match_binaries)) |>
252-
tidyr::unnest(`_binaries`, names_sep = "_", names_repair = "unique",
253-
keep_empty = TRUE) |>
254-
dplyr::mutate(`_binaries_os_` = get_binary_os(`_binaries_os`),
255-
`_binaries_r_xy` = dplyr::if_else(is.na(`_binaries_r`),
256-
NA_character_,
257-
r_xy_ver(`_binaries_r`))),
258-
df |>
259-
dplyr::filter(`_jobs_type` %in% c("bioc-checks", "source")) |>
260-
dplyr::select(-`_binaries`) |>
261-
dplyr::mutate(`_binaries_r_xy` = NA_character_)))() |>
247+
"linux"))
248+
}
249+
250+
#' get_uni_df helper to expand `_binaries` and match with `_job`-related columns
251+
#'
252+
#' @description
253+
#' Adds additional columns to `_binaries_r_xy` and `_binaries_os_`
254+
#'
255+
#' @param df data.frame data processed from R Universe API
256+
#'
257+
#' @returns data.frame
258+
#'
259+
#' @examples
260+
#' raw_df <- get_raw_uni_df("bioc")
261+
#' df <- .expand_jobs(df)
262+
#' df <- .expand_binaries(df)
263+
#'
264+
#' @noRd
265+
.expand_binaries <- function(df) {
266+
dplyr::bind_rows(
267+
df |>
268+
dplyr::filter(`_jobs_type` == "binary") |>
269+
dplyr::mutate(`_binaries` = purrr::pmap(
270+
list(`_binaries`, `_jobs_r_xy`, `_jobs_os_`, `_jobs_arch`),
271+
match_binaries)) |>
272+
tidyr::unnest(`_binaries`, names_sep = "_", names_repair = "unique",
273+
keep_empty = TRUE) |>
274+
dplyr::mutate(`_binaries_os_` = get_binary_os(`_binaries_os`),
275+
`_binaries_r_xy` = dplyr::if_else(is.na(`_binaries_r`),
276+
NA_character_,
277+
r_xy_ver(`_binaries_r`))),
278+
df |>
279+
dplyr::filter(`_jobs_type` %in% c("bioc-checks", "source")) |>
280+
dplyr::select(-`_binaries`) |>
281+
dplyr::mutate(`_binaries_r_xy` = NA_character_))
282+
}
283+
284+
#' Flatten raw universe data.frame by matching R, OS, and arch information from
285+
#' `_jobs` with `_binaries`
286+
#'
287+
#' @description
288+
#' Adds additional columns to `_jobs_r_xy`, `_binaries_r_xy`,
289+
#' `_jobs_type`, `_jobs_arch`, `_jobs_os_`, `_binaries_os_`
290+
#'
291+
#' @param raw_df raw data.frame from R Universe API
292+
#'
293+
#' @returns data.frame
294+
#'
295+
#' @examples
296+
#' raw_df <- get_raw_uni_df("bioc")
297+
#' get_uni_df(raw_df)
298+
#'
299+
#' @export
300+
get_uni_df <- function(raw_df) {
301+
uni_df <- raw_df |>
302+
.expand_jobs() |>
303+
.expand_binaries() |>
262304
dplyr::filter(
263305
(`_jobs_type` == "binary" & (`_jobs_r_xy` == `_binaries_r_xy` | is.na(`_binaries_r_xy`))) |
264306
(`_jobs_type` %in% c("bioc-checks", "source")))
@@ -278,7 +320,8 @@ get_uni_df <- function(raw_df) {
278320
#' @returns data.frame packages in a universe
279321
#'
280322
#' @examples
281-
#' get_jobs("bioc", "devel", "4.6.0", "3.23")
323+
#' bu <- get_uni_for_bioc_version("devel")
324+
#' get_jobs(bu$ru_uni, bu$bioc_branch, bu$r_version, bu$bioc_version)
282325
#'
283326
#' @export
284327
get_jobs <- function(uni, uni_os_branch, r_version, bioc_version) {
@@ -330,7 +373,8 @@ get_jobs <- function(uni, uni_os_branch, r_version, bioc_version) {
330373
#' @returns data.frame
331374
#'
332375
#' @examples
333-
#' df <- get_jobs("bioc", "devel", "4.6.0", "3.23", "macosx", "arm64")
376+
#' bu <- get_uni_for_bioc_version("devel")
377+
#' df <- get_jobs(bu$ru_uni, bu$bioc_branch, bu$r_version, bu$bioc_version)
334378
#' filter_by_arch(df, "macosx", "arm64")
335379
#'
336380
#' @export
@@ -371,7 +415,9 @@ filter_by_arch <- function(df, os, arch = NA) {
371415
#' @returns data.frame of filtered candidate packages
372416
#'
373417
#' @examples
374-
#' candidates <- get_candidates("bioc", "devel", "4.6.0", "3.23", "windows",
418+
#' bu <- get_uni_for_bioc_version("devel")
419+
#' candidates <- get_candidates(bu$ru_uni, bu$bioc_branch, bu$r_version,
420+
#' bu$bioc_version, "windows",
375421
#' commit = TRUE)
376422
#'
377423
#' @export
@@ -423,22 +469,29 @@ get_candidates <- function(uni, uni_os_branch, r_version, bioc_version, os,
423469

424470
#' Get information about R Universe building a Bioconductor version
425471
#'
426-
#' @param version character Bioconductor version
472+
#' @param version character Bioconductor version, "devel", or "release"
427473
#'
474+
#' @examples
475+
#' bu <- get_uni_for_bioc_version("devel")
476+
#'
428477
#' @export
429478
get_uni_for_bioc_version <- function(version) {
430479
bioc_yaml <- yaml::read_yaml("https://bioconductor.org/config.yaml")
431-
432-
stopifnot(version %in% bioc_yaml$versions)
433-
bioc_branch <- ifelse(bioc_yaml$devel_version == version, "devel",
434-
"release")
435-
ru_uni <- ifelse(bioc_branch == "devel", "bioc", "bioc-release")
436-
if (bioc_branch == "devel")
480+
stopifnot(version %in% c(bioc_yaml$versions, "release", "devel"))
481+
482+
if (version %in% c("devel", bioc_yaml$devel_version)) {
483+
bioc_version <- bioc_yaml$devel_version
484+
bioc_branch <- "devel"
485+
ru_uni <- "bioc"
437486
r_version <- bioc_yaml$r_version_associated_with_devel
438-
else
487+
} else {
488+
bioc_version <- bioc_yaml$release_version
489+
bioc_branch <- "release"
490+
ru_uni <- "bioc-release"
439491
r_version <- bioc_yaml$r_version_associated_with_release
440-
441-
list(bioc_version = version,
492+
}
493+
494+
list(bioc_version = bioc_version,
442495
bioc_branch = bioc_branch,
443496
ru_uni = ru_uni,
444497
r_version = r_version)
@@ -458,7 +511,9 @@ get_uni_for_bioc_version <- function(version) {
458511
#' @returns vector of the full path of binaries removed
459512
#'
460513
#' @examples
461-
#' remove_old_binaries("/home/biocpush/PACKAGES/3.22/bioc", "4.6.0", "windows")
514+
#' bu <- get_uni_for_bioc_version("devel")
515+
#' repo_root <- paste0("/home/biocpush/PACKAGES/", bu$bioc_version, "/bioc")
516+
#' remove_old_binaries(repo_root, bu$bioc_version, "windows")
462517
#'
463518
#' @export
464519
remove_old_binaries <- function(repo_root, r_version, os, macosx_name = NA,

_quarto.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
project:
2+
type: website
3+
output-dir: docs
4+
5+
website:
6+
title: "biocUniTools"
7+
navbar:
8+
left:
9+
- text: "Bioconductor in R Universe: Linux with Criteria on Commits and Vignettes"
10+
href: vignettes/index.html
11+
12+
format:
13+
html:
14+
theme: cosmo
15+
toc: true

man/dot-expand_jobs.Rd

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/filter_by_arch.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/get_candidates.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/get_jobs.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)