diff --git a/.Rbuildignore b/.Rbuildignore
index f62a415..6a79e04 100644
--- a/.Rbuildignore
+++ b/.Rbuildignore
@@ -1,3 +1,4 @@
+^auto$
.*\.Rproj$
^\.Rproj\.user$
^README.Rmd
diff --git a/.github/workflows/rworkflows.yml b/.github/workflows/rworkflows.yml
index 0c2d138..cb7c71e 100644
--- a/.github/workflows/rworkflows.yml
+++ b/.github/workflows/rworkflows.yml
@@ -4,14 +4,19 @@ name: rworkflows
branches:
- master
- main
+ - devel
- RELEASE_**
pull_request:
branches:
- master
- main
+ - devel
- RELEASE_**
jobs:
rworkflows:
+ permissions:
+ contents: write
+ packages: write
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
container: ${{ matrix.config.cont }}
@@ -20,16 +25,22 @@ jobs:
matrix:
config:
- os: ubuntu-latest
- r: devel
bioc: devel
- cont: bioconductor/bioconductor_docker:devel
- rspm: https://packagemanager.rstudio.com/cran/__linux__/focal/release
+ r: auto
+ cont: ghcr.io/bioconductor/bioconductor_docker:devel
+ python: 3.11
- os: macOS-latest
- r: latest
bioc: release
+ r: auto
+ cont: ~
+ rspm: ~
+ python: 3.11
- os: windows-latest
- r: latest
bioc: release
+ r: auto
+ cont: ~
+ rspm: ~
+ python: 3.11
steps:
- uses: neurogenomics/rworkflows@master
with:
@@ -41,10 +52,9 @@ jobs:
run_covr: ${{ true }}
run_pkgdown: ${{ true }}
has_runit: ${{ false }}
- GITHUB_TOKEN: ${{ secrets.PAT_GITHUB }}
- run_docker: ${{ true }}
- docker_user: bschilder
- docker_org: neurogenomicslab
+ has_latex: ${{ false }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run_docker: ${{ false }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
runner_os: ${{ runner.os }}
- cache_version: cache-master
+ cache_version: cache-v1
diff --git a/.gitignore b/.gitignore
index 9aa76e2..c5a9972 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+auto/
basilisk/
# R project files
*.Rproj
@@ -40,4 +41,4 @@ vignettes/*.R
*.utf8.md
*.knit.md
# R Environment Variables
-.Renviron
\ No newline at end of file
+.Renviron
diff --git a/DESCRIPTION b/DESCRIPTION
index ef929d7..412722c 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Package: echoconda
Type: Package
Title: echoverse module: conda environment management
-Version: 0.99.9
+Version: 0.99.10
Authors@R:
c(person(given = "Brian",
family = "Schilder",
@@ -59,7 +59,7 @@ Suggests:
Remotes:
github::MRCIEU/genetics.binaRies,
github::RajLabMSSM/echodata
-RoxygenNote: 7.2.3
+RoxygenNote: 7.3.1
StagedInstall: no
VignetteBuilder: knitr
License: GPL (>= 3)
diff --git a/NEWS.md b/NEWS.md
index 547a2bb..743f8aa 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,3 +1,9 @@
+# echoconda 0.99.10
+
+## New features
+
+* Updated `rworkflows`.
+
# echoconda 0.99.9
## New features
diff --git a/R/basilisk.R b/R/basilisk.R
index 31a6758..64fcfb5 100644
--- a/R/basilisk.R
+++ b/R/basilisk.R
@@ -22,11 +22,14 @@ create_env_basilisk <- function(yaml_path,
pkgs,
sep="=",
use_subversion=FALSE,
+ use_nodefaults=TRUE,
start = TRUE){
package <- NULL;
# yaml_path <- tail(ymls$yaml_path,1)
yaml_txt <- yaml::read_yaml(file = yaml_path)
deps <- unlist(yaml_txt$dependencies)
+ #### Omit python ####
+ deps <- deps[!startsWith(deps,"python")]
#### Check for pip deps ####
has_pip <- if(!is.null(names(deps))){
startsWith(names(deps),"pip")
@@ -41,7 +44,7 @@ create_env_basilisk <- function(yaml_path,
}
#### Subset to only core packages ####
#### Make sure package aren't listed twice ####
- pkgs <- pkgs[!duplicated(pkgs$package),]
+ pkgs <- pkgs[!duplicated(pkgs$package),]
#### Omit subversions for increased flexibility ####
if(isFALSE(use_subversion)){
pkgs$version <- stringr::str_split(pkgs$version,"[.]",
@@ -50,15 +53,18 @@ create_env_basilisk <- function(yaml_path,
## Split by pip / non-pip
pip_pkgs <- pkgs[package %in% unname(deps[has_pip]),]
nonpip_pkgs <- pkgs[package %in% unname(deps[!has_pip]),]
+ channels <- unique(c(pkgs$channel,
+ if(use_nodefaults) "nodefaults" else NULL))
+ use_nodefaults
#### Create basilisk env object ####
envObj <- basilisk::BasiliskEnvironment(
envname = yaml_txt$name,
pkgname = "echoconda",
## Use >= rather than = or == for increased flexibility,
## but reduced reproducibility.
- packages = paste(nonpip_pkgs$package,nonpip_pkgs$version,sep=sep),
- pip = paste(pip_pkgs$package,pip_pkgs$version,sep=sep),
- channels = unique(c(pkgs$channel,"nodefaults"))
+ packages = paste(nonpip_pkgs$package, nonpip_pkgs$version, sep=sep),
+ pip = paste(pip_pkgs$package, pip_pkgs$version, sep=sep),
+ channels = channels
)
if(isTRUE(start)){
proc <- basilisk::basiliskStart(env = envObj)
diff --git a/R/create_env.R b/R/create_env.R
index 92b275a..2448bac 100644
--- a/R/create_env.R
+++ b/R/create_env.R
@@ -1,6 +1,13 @@
#' Create conda env
#'
#' Create conda env using one of several methods.
+#' @param ... Additional arguments passed to method-specific
+#' conda env build functions:
+#' \itemize{
+#' \item \code{basilisk}: \link[echoconda]{create_env_basilisk}
+#' \item \code{reticulate}: \link[reticulate]{conda_create}
+#' \item \code{cli}: \link[echoconda]{create_env_cli}
+#' }
#' @keywords internal
#' @inheritParams yaml_to_env
#' @inheritParams reticulate::conda_create
@@ -9,7 +16,8 @@ create_env <- function(conda_env,
method=c("basilisk","reticulate","cli"),
conda="auto",
force_new=FALSE,
- verbose=TRUE){
+ verbose=TRUE,
+ ...){
messager("echoconda:: Creating conda environment:", conda_env,
v = verbose
)
@@ -26,7 +34,8 @@ create_env <- function(conda_env,
if(method=="reticulate"){
reticulate::conda_create(envname = conda_env,
environment = yaml_path,
- conda = conda)
+ conda = conda,
+ ...)
#### basilisk ####
} else if(method=="basilisk"){
pkgs <- data.table::fread(
@@ -35,7 +44,7 @@ create_env <- function(conda_env,
)
envObj <- create_env_basilisk(yaml_path = yaml_path,
pkgs = pkgs,
- start = TRUE)
+ ...)
conda_env <- envObj@envname
#### cli ####
@@ -43,7 +52,8 @@ create_env <- function(conda_env,
conda_env <- create_env_cli(yaml_path = yaml_path,
conda = conda,
force_new = force_new,
- verbose = verbose)
+ verbose = verbose,
+ ...)
} else {
stp <- paste("method must be one of:",
paste("\n -",eval(formals(create_env)$method)))
diff --git a/R/env_to_yaml.R b/R/env_to_yaml.R
index 67f64a1..f1fac39 100644
--- a/R/env_to_yaml.R
+++ b/R/env_to_yaml.R
@@ -16,11 +16,11 @@
#' @export
#' @importFrom reticulate conda_export
#' @examples
-#' path <- echoconda::env_to_yaml(conda_env="base")
+#' path <- env_to_yaml(conda_env="base")
env_to_yaml <- function(conda_env,
yaml_path = file.path(tempdir(),"conda.yml"),
conda = "auto",
- method = c("basilisk","reticulate"),
+ method = c("reticulate","basilisk"),
verbose = TRUE,
...){
diff --git a/R/find_env_rlib.R b/R/find_env_rlib.R
index 8b3350c..02827c0 100644
--- a/R/find_env_rlib.R
+++ b/R/find_env_rlib.R
@@ -5,10 +5,12 @@
#'
#' @family conda
#' @export
-find_env_rlib <- function(conda_env = "echoR",
+find_env_rlib <- function(conda_env = "echoR_mini",
suffix = "lib/R/library/") {
conda_env <- check_env(conda_env = conda_env)
- conda_path <- dirname(dirname(find_python_path(conda_env = conda_env)))
+ list.files(conda_env)
+ python <- find_python_path(conda_env = conda_env)
+ conda_path <- dirname(dirname(python))
if (conda_path == ".") {
env_Rlib <- .libPaths()
message("No conda_env='", conda_env, "' not found.")
diff --git a/R/install_conda_basilisk.R b/R/install_conda_basilisk.R
index 4931ef6..6cbe00f 100644
--- a/R/install_conda_basilisk.R
+++ b/R/install_conda_basilisk.R
@@ -6,8 +6,8 @@
#' @keywords internal
#' @importFrom basilisk.utils installConda
install_conda_basilisk <- function(verbose=TRUE){
-
- new_install <- basilisk.utils::installConda()
+ # Sys.setenv("BASILISK_USE_SYSTEM_DIR"=1)
+ new_install <- basilisk.utils::installConda(installed = FALSE)
if(isTRUE(new_install)){
messager("echoconda:: Installing conda via basilisk.",v=verbose)
} else {
diff --git a/R/yaml_to_env.R b/R/yaml_to_env.R
index 535e523..2420be5 100644
--- a/R/yaml_to_env.R
+++ b/R/yaml_to_env.R
@@ -14,17 +14,19 @@
#' overwrite it with a new one (\emph{DEFAULT}: \code{FALSE}).
#' @param show_contents Show the contents of the yaml file (if used).
#' @param verbose Print messages.
+#' @inheritParams create_env
#' @inheritParams reticulate::conda_create
#'
#' @source \href{https://github.com/rstudio/reticulate/issues/779}{GitHub Issue}
#' @source \href{https://stackoverflow.com/questions/35802939/install-only-available-packages-using-conda-install-yes-file-requirements-t}{
#' StackOverflow suggestions for cross-platform troubleshooting}
#' @family conda
+#'
#' @export
#' @importFrom reticulate conda_binary
#' @importFrom echodata is_local is_url
#' @examples
-#' conda_env <- echoconda::yaml_to_env()
+#' conda_env <- yaml_to_env()
yaml_to_env <- function(yaml_path = system.file(
package = "echoconda",
"conda","echoR_mini.yml"
@@ -33,13 +35,13 @@ yaml_to_env <- function(yaml_path = system.file(
conda = "auto",
force_new = FALSE,
show_contents = FALSE,
- verbose = TRUE) {
- # echoverseTemplate:::source_all()
- # echoverseTemplate:::args2vars(echoconda::yaml_to_env)
+ verbose = TRUE,
+ ...) {
+ # devoptera::args2vars(yaml_to_env)
method <- tolower(method)[1]
- install_conda(method = method,
- verbose = verbose)
+ # install_conda(method = method,
+ # verbose = verbose)
start <- Sys.time()
#### Check whether env exists ####
conda_env <- name_from_yaml(yaml_path = yaml_path,
@@ -87,7 +89,8 @@ yaml_to_env <- function(yaml_path = system.file(
method = method,
conda = conda,
force_new = force_new,
- verbose = verbose)
+ verbose = verbose,
+ ...)
}
}
conda_env <- check_env(conda_env = conda_env)
diff --git a/README.Rmd b/README.Rmd
index ea896ac..4255ed3 100644
--- a/README.Rmd
+++ b/README.Rmd
@@ -1,12 +1,6 @@
---
title: ""
-author: "
- `r badger::badge_github_version(color = 'black')`
- `r badger::badge_github_actions(action = 'rworkflows')`
- `r badger::badge_last_commit()`
- `r badger::badge_codecov()`
- `r badger::badge_license()`
-