Skip to content

Commit f15f6fd

Browse files
committed
bump to 0.99.8
1 parent eeb1ca5 commit f15f6fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1459
-707
lines changed

.Rhistory

Lines changed: 489 additions & 489 deletions
Large diffs are not rendered by default.

DESCRIPTION

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: rworkflows
22
Type: Package
33
Title: Test, Document, Containerise, and Deploy R Packages
4-
Version: 0.99.7
4+
Version: 0.99.8
55
Authors@R:
66
c(person(given = "Brian",
77
family = "Schilder",
@@ -42,7 +42,11 @@ Imports:
4242
desc,
4343
badger,
4444
renv,
45-
biocViews
45+
biocViews,
46+
tools,
47+
methods,
48+
BiocPkgTools,
49+
data.table
4650
Suggests:
4751
markdown,
4852
rmarkdown,
@@ -51,7 +55,6 @@ Suggests:
5155
BiocStyle,
5256
covr,
5357
testthat (>= 3.0.0),
54-
data.table,
5558
htmltools
5659
RoxygenNote: 7.2.3
5760
VignetteBuilder: knitr

NAMESPACE

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Generated by roxygen2: do not edit by hand
22

33
export(bioc_r_versions)
4+
export(construct_authors)
45
export(construct_runners)
6+
export(dt_to_desc)
57
export(fill_description)
68
export(get_description)
79
export(get_hex)
@@ -15,16 +17,22 @@ export(use_readme)
1517
export(use_vignette_docker)
1618
export(use_vignette_getstarted)
1719
export(use_workflow)
20+
import(BiocPkgTools)
1821
import(badger)
1922
import(desc)
2023
importFrom(biocViews,recommendBiocViews)
24+
importFrom(data.table,":=")
25+
importFrom(data.table,as.data.table)
2126
importFrom(desc,desc)
2227
importFrom(desc,desc_fields)
2328
importFrom(desc,desc_get_field)
2429
importFrom(here,here)
30+
importFrom(methods,is)
2531
importFrom(renv,dependencies)
2632
importFrom(stats,setNames)
33+
importFrom(tools,R_user_dir)
2734
importFrom(utils,download.file)
35+
importFrom(utils,person)
2836
importFrom(yaml,as.yaml)
2937
importFrom(yaml,read_yaml)
3038
importFrom(yaml,write_yaml)

NEWS.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
# rworkflows 0.99.8
2+
3+
## New features
4+
5+
* `get_description`
6+
- Supplying a `description` obj directly to any argument returns that obj.
7+
- Reorder strategies so that local ones go first.
8+
- Add Liam Neeson reference.
9+
- Now caches DESCRIPTION files.
10+
- Add validation step at the end.
11+
- Upgrade to handle multiple `refs` at once
12+
- Add another subroutine for getting DESCRIPTION files from CRAN/Bioc
13+
* `get_hex`
14+
- Now iterable
15+
* Add `output` style arg to vignette functions.
16+
117
# rworkflows 0.99.7
218

319
## New features
@@ -30,6 +46,7 @@
3046
* `get_hex`: Remove extra breaks
3147
* Fix bad quotes in `if` statements when *rworkflows_static* gets saved.
3248

49+
3350
# rworkflows 0.99.6
3451

3552
## New features

R/bioc_r_versions.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#' ver <- bioc_r_versions(bioc_version="devel")
2828
bioc_r_versions <- function(bioc_version = NULL,
2929
depth = NULL){
30-
# templateR:::args2vars(bioc_r_versions)
30+
# devoptera::args2vars(bioc_r_versions)
3131

3232
yml <- yaml::read_yaml("https://bioconductor.org/config.yaml")
3333
info <- list(
@@ -69,4 +69,4 @@ bioc_r_versions <- function(bioc_version = NULL,
6969
# info[["r_latest"]] <- package_version(rversions::r_release()$version)
7070
# info[["r_devel"]] <- package_version(rversions::r_release()$version)
7171
return(info)
72-
}
72+
}

R/check_pkg_name_variants.R

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
check_pkg_name_variants <- function(ref,
2+
pkg_retrieved=NULL,
3+
verbose=TRUE){
4+
# ref <- "neurogenomics/MAGMA_Celltyping"
5+
6+
v1 <- basename(ref) |>
7+
trimws() |> trimws(whitespace = "^\\.|\\.")
8+
v2 <- tolower(v1)
9+
v3 <- lapply(c("-","_"," "), function(x){
10+
gsub(x,".",v1)
11+
})
12+
v4 <- lapply(c("-","_"," "), function(x){
13+
gsub(x,"",v1)
14+
})
15+
v <- unlist(c(ref,basename(ref),v1,v2,v3,v4))
16+
approximate_match <- pkg_retrieved %in% v
17+
if(isFALSE(approximate_match)){
18+
messager(
19+
paste0(
20+
"Requested package (",shQuote(basename(ref)),") ",
21+
"!= retrieved package (",shQuote(pkg_retrieved),") in DESCRIPTION. ",
22+
"Returning NULL."
23+
),v = verbose
24+
)
25+
}
26+
return(approximate_match)
27+
}

R/codecov_graphs.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ codecov_graphs <- function(ref,
66
height=50,
77
style="vertical-align: top;",
88
token=NULL){
9-
# templateR:::args2vars(codecov_graphs)
9+
# devoptera::args2vars(codecov_graphs)
1010
# ref="neurogenomics/rworkflows";branch="master"
1111

1212

@@ -40,4 +40,4 @@ codecov_graphs <- function(ref,
4040
URL
4141
}
4242
})
43-
}
43+
}

R/construct_authors.R

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#' Construct authors
2+
#'
3+
#' Helper function to construct an author list for a \emph{DESCRIPTION} file.
4+
#' Returns a template when \code{authors} is not provided (default).
5+
#' @param template Default value to return when \code{authors=NULL}.
6+
#' @inheritParams fill_description
7+
#' @returns Named list in \link[utils]{person} format.
8+
#'
9+
#' @export
10+
#' @importFrom utils person
11+
#' @examples
12+
#' authors <- construct_authors()
13+
construct_authors <- function(authors=NULL,
14+
template=c(
15+
utils::person(
16+
given = "yourGivenName",
17+
family = "yourFamilyName",
18+
role = c("cre"),
19+
email = "[email protected]",
20+
comment = c(ORCID = "yourOrcidId"))
21+
)
22+
){
23+
if(is.null(authors)){
24+
return(template)
25+
} else {
26+
return(authors)
27+
}
28+
}

R/construct_runners.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ construct_runners <- function(os=c("ubuntu-latest",
5656
versions_explicit=FALSE
5757
){
5858

59-
# templateR:::source_all()
60-
# templateR:::args2vars(construct_runners)
59+
# devoptera::args2varssource_all()
60+
# devoptera::args2vars(construct_runners)
6161

6262
#### Check args ####
6363
construct_runners_check_args(os = os,

R/dt_to_desc.R

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#' \link[data.table]{data.table} to \link[desc]{desc}
2+
#'
3+
#' Convert \link[data.table]{data.table} containing the
4+
#' parsed \emph{DESCROPTION} file data and convert each of them to
5+
#' to \link[desc]{desc} format.
6+
#' @param db A \link[data.table]{data.table} where each row is a different R package
7+
#' and each column is a field from the \emph{DESCROPTION} file.
8+
#' @param verbose Print messages.
9+
#' @inheritParams get_description
10+
#' @returns A named list of \link[desc]{desc} objects.
11+
#'
12+
#' @export
13+
#' @importFrom stats setNames
14+
#' @importFrom data.table as.data.table
15+
#' @import desc
16+
#' @examples
17+
#' db <- BiocPkgTools::biocPkgList()
18+
#' dl <- dt_to_desc(db=db, refs="GenomicRanges")
19+
dt_to_desc <- function(db,
20+
refs=NULL,
21+
verbose=TRUE){
22+
23+
Package <- NULL;
24+
25+
26+
db <- data.table::as.data.table(db)
27+
if(is.null(refs)){
28+
refs <- db$Package
29+
}else{
30+
refs <- refs[basename(refs) %in% db$Package]
31+
}
32+
messager("Constructing DESCRIPTION files for",
33+
formatC(length(refs),big.mark = ","),"R packages.",v=verbose)
34+
valid_fields <-desc::cran_valid_fields
35+
lapply(stats::setNames(basename(refs),
36+
refs),
37+
function(p){
38+
messager("Constructing DESCRIPTION for:",p,v=verbose)
39+
db_sub <- db[Package==p,][1,]
40+
d <- desc::description$new("!new")
41+
for(k in names(db_sub)){
42+
vals <- db_sub[[k]]
43+
if(is.list(vals)) vals <- unlist(vals)
44+
vals <- vals[vals!=""]
45+
if(k %in% valid_fields &&
46+
!all(is.na(vals))){
47+
d$set_list(key = k,
48+
list_value = vals)
49+
}
50+
}
51+
d
52+
})
53+
}

0 commit comments

Comments
 (0)