Skip to content

Commit

Permalink
rworkflows 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bschilder committed Nov 16, 2023
1 parent b4e0170 commit eea1f6b
Show file tree
Hide file tree
Showing 34 changed files with 697 additions and 604 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ rworkflows-merged
^reports
^inst/hex$
^hex$
.*\.pdf$
^CITATION$

.*\.Rproj$
^\.Rproj\.user$
Expand Down
12 changes: 6 additions & 6 deletions .Rhistory
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
library(rworkflows)
use_vignette_docker(force_new = T)
use_vignette_docker("neurogenomics",force_new = T)
library(rworkflows)
use_vignette_docker("neurogenomics",force_new = T)
library(rworkflows)
use_vignette_docker("neurogenomics",force_new = T)
cont
library(rworkflows)
Expand Down Expand Up @@ -510,3 +504,9 @@ library(rworkflows)
devtools::build_manual()
devtools::build_manual(path = 'inst')
## Bug fixes
testthat::test_check()
testthat::test_check("rworkflows")
?rstatix::anova_test
?rstatix::Anova()
?)
?rstatix::cor_pmat
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rworkflows
Type: Package
Title: Test, Document, Containerise, and Deploy R Packages
Version: 1.0.1
Version: 1.0.2
Authors@R:
c(person(given = "Brian",
family = "Schilder",
Expand Down Expand Up @@ -59,7 +59,8 @@ Suggests:
BiocPkgTools,
biocViews,
reticulate,
rvest
rvest,
tinytex
VignetteBuilder: knitr
License: GPL-3
Config/testthat/edition: 3
Expand Down
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ export(construct_authors)
export(construct_conda_yml)
export(construct_cont)
export(construct_runners)
export(dependencies_latex)
export(dependencies_linux)
export(dependencies_macos)
export(dependencies_windows)
export(dt_to_desc)
export(fill_description)
export(get_description)
Expand Down
25 changes: 24 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# rworkflows 1.0.2

## New features

* *action.yml*
- Condense steps
- Use new `rworkflows` funcs to specific system and latex deps
* *Dockerfile*
- Use new `rworkflows` funcs to specific system and latex deps
* New functions:
- `dependencies_linux`
- `dependencies_macos`
- `dependencies_windows`
- `dependencies_latex`
* README: update and condense.

## Bug fixes

* Get rid of CRAN NOTE by reducing package size:
- Remove unused *inst* files.
- Change vignettes to use `rmarkdown::render` instead of `BiocStyle::html_document`.
- Add to *.Rbuildignore*: .`*\.pdf$`, `^CITATION$`

# rworkflows 1.0.1

## New features
Expand All @@ -9,7 +32,7 @@
- *action.yml*
- `repository: ${{ github.repository }}` --> `repository: ${{ env.packageName }}`
- Add `env: GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}` to any checking steps
(allows piggyback to download data from Relesases)
(allows piggyback to download data from Releases)

# rworkflows 1.0.0

Expand Down
48 changes: 48 additions & 0 deletions R/dependencies_latex.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#' Latex dependencies
#'
#' Install extra latex package dependencies.
#' @param install Install the packages with \link[tinytex]{tlmgr_install}
#' (\code{TRUE}). Otherwise, return a character vector of the packages to
#' install.
#' @inheritParams dependencies_linux
#' @inheritDotParams tinytex::tlmgr_install
#' @returns A character vector of extra latex packages.
#'
#' @export
#' @examples
#' dependencies_latex(install=FALSE)
dependencies_latex <- function(extra=c("bera",
"nowidow",
"parnotes",
"marginfix",
"etoolbox",
"titlesec",
"sectsty",
"framed",
"enumitem",
"parskip",
"soul",
"placeins",
"footmisc",
"changepage",
"xstring",
"caption",
"mathtools",
"fancyhdr",
"preprint",
"ragged2e",
"pdfcrop",
"titling",
"silence",
"everysel"),
install=TRUE,
...){
requireNamespace("tinytex")

if(isTRUE(install)){
tinytex::tlmgr_install(pkgs = unique(extra),
...)
} else {
extra
}
}
38 changes: 38 additions & 0 deletions R/dependencies_linux.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#' Linux dependencies
#'
#' Construct a command to install system dependencies for the
#' Linux OS environment.
#' Includes all dependencies listed by \link[remotes]{system_requirements},
#' in addition to user-specified dependencies via \code{extra}.
#' @param prefix Prefix to prepend to the command.
#' @param extra Additional dependencies to install.
#' @param verbose Print messages.
#' @inheritParams remotes::system_requirements
#' @inheritDotParams remotes::system_requirements
#' @returns Command to install system dependencies.
#'
#' @export
#' @examples
#' dependencies_linux(package="rworkflows")
dependencies_linux <- function(os = "ubuntu",
os_release = "20.04",
extra=c("qpdf",
"rsync"),
prefix=paste("apt-get update -y",
"apt-get install -y",
sep=" && "),
verbose = TRUE,
...
){
# devoptera::args2vars(linux_dependencies)

deps <- gsub("apt-get install -y ", "",
remotes::system_requirements(os = os,
os_release = os_release,
...)
)
deps <- unique(c(deps,extra))
cmd <- paste(prefix,paste(deps,collapse = " "))
messager(cmd,v=verbose)
cat(cmd)
}
53 changes: 53 additions & 0 deletions R/dependencies_macos.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#' MacOS dependencies
#'
#' Construct a command to install system dependencies for the
#' Mac OS environment.
#'
#'### --- Justifications for each package --- ####
#'## libxml2 ###
#' Enable installing XML from source if needed
#'## imagemagick@6 ###
#' Required to install magick as noted at
#' https://github.com/r-lib/usethis/commit/f1f1e0d10c1ebc75fd4c18fa7e2de4551fd9978f#diff-9bfee71065492f63457918efcd912cf2
#'## harfbuzz fribidi ###
#' For textshaping, required by ragg, and required by pkgdown
#'## libgit2 ###
#' For installing usethis's dependency gert
#'## xquartz --cask ###
#' Required for tcltk
#'## libxfont ###
#' Required for some ggplot2 functions
#'## texlive ###
#' Required for rendering Sweave files (even with r-lib/actions/setup-tinytex)
#' @param cask Additional dependencies to install via cask.
#' @inheritParams dependencies_linux
#' @returns Command to install system dependencies.
#'
#' @export
#' @examples
#' dependencies_macos()
dependencies_macos <- function(extra=c("libxml2",
"harfbuzz",
"fribidi",
"libgit2",
"texlive",
"imagemagick@6",
"rsync"),
cask = c("xquartz"),
prefix="brew install",
verbose=TRUE){
# devoptera::args2vars(macos_dependencies)

### Install normally ###
cmd <- paste(prefix,paste(extra,collapse=" "))
### Install via cask ###
if(length(cask) > 0){
cmd <- paste(
cmd,
paste(prefix,paste(cask,collapse=" "),"--cask"),
sep=" && "
)
}
messager(cmd,v=verbose)
cat(cmd)
}
19 changes: 19 additions & 0 deletions R/dependencies_windows.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#' Windows dependencies
#'
#' Construct a command to install system dependencies for the
#' Windows environment.
#' @inheritParams dependencies_linux
#' @returns Command to install system dependencies.
#'
#' @export
#' @examples
#' dependencies_windows()
dependencies_windows <- function(extra=c("curl"),
prefix="npm install",
verbose=TRUE){
# devoptera::args2vars(windows_dependencies)

cmd <- paste(prefix,paste(extra,collapse=" "))
messager(cmd,v=verbose)
cat(cmd)
}
2 changes: 1 addition & 1 deletion R/use_vignette_docker.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ use_vignette_docker <- function(package = names(get_description()),
"vignettes",
"docker.Rmd"),
output=list(
"BiocStyle::html_document"= list(
"rmarkdown::html_document"= list(
"md_extensions"="-autolink_bare_uris"
)
),
Expand Down
2 changes: 1 addition & 1 deletion R/use_vignette_getstarted.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use_vignette_getstarted <- function(package = names(get_description()),
path=file.path(save_dir,
"vignettes",
paste0(package,".Rmd")),
output="BiocStyle::html_document",
output="rmarkdown::html_document",
force_new=FALSE,
show=FALSE,
verbose=TRUE){
Expand Down
Loading

0 comments on commit eea1f6b

Please sign in to comment.