From 6b951035be8c6e7a21bfb64d88cb6a3bbb3827d2 Mon Sep 17 00:00:00 2001 From: luciorq Date: Tue, 10 Dec 2024 12:09:22 -0500 Subject: [PATCH] docs: add package namespace to examples --- DESCRIPTION | 2 +- NEWS.md | 6 +++++- R/create_env.R | 2 +- R/env_exists.R | 2 +- R/get_env_dir.R | 2 +- R/get_install_dir.R | 2 +- R/install_micromamba.R | 2 +- R/install_packages.R | 2 +- R/list_envs.R | 2 +- R/list_packages.R | 2 +- R/micromamba_bin_path.R | 2 +- R/remove_env.R | 2 +- R/run.R | 2 +- R/run_bin.R | 2 +- R/with_sandbox_dir.R | 4 ++-- man/create_env.Rd | 2 +- man/env_exists.Rd | 2 +- man/get_env_dir.Rd | 2 +- man/get_install_dir.Rd | 2 +- man/install_micromamba.Rd | 2 +- man/install_packages.Rd | 2 +- man/list_envs.Rd | 2 +- man/list_packages.Rd | 2 +- man/micromamba_bin_path.Rd | 2 +- man/remove_env.Rd | 2 +- man/run.Rd | 2 +- man/run_bin.Rd | 2 +- man/with_sandbox_dir.Rd | 4 ++-- 28 files changed, 34 insertions(+), 30 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index a6b83bd..570b657 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: condathis Title: Run Any CLI Tool on a 'Conda' Environment -Version: 0.0.8 +Version: 0.1.0 Authors@R: c( person("Lucio", "Queiroz", , "luciorqueiroz@gmail.com", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0002-6090-1834")), diff --git a/NEWS.md b/NEWS.md index d18f5da..735f14a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,10 +1,14 @@ +# condathis 0.1.0 + +* Initial submission to CRAN. + # condathis 0.0.8 ## Breaking changes * `env_exists()` now error if no argument is supplied. -* The base directory path used for creating the environments is now controlled by `tools::R_R_user_dir()` and accepts `R_USER_DATA_DIR`, and `XDG_DATA_HOME`, respectively as environment variables that can control that path. On Unix/Linux it should be `"${HOME}/.local/share/R/condathis"`. +* The base directory path used for creating the environments is now controlled by `tools::R_user_dir()` and accepts `R_USER_DATA_DIR`, and `XDG_DATA_HOME`, respectively as environment variables that can control that path. On Unix/Linux it should be `"${HOME}/.local/share/R/condathis"`. * The default `TMPDIR` for all `run()` and `run_bin()` calls are clean after execution. diff --git a/R/create_env.R b/R/create_env.R index 81ff472..ff21ad6 100644 --- a/R/create_env.R +++ b/R/create_env.R @@ -43,7 +43,7 @@ #' #' @examples #' \dontrun{ -#' with_sandbox_dir({ +#' condathis::with_sandbox_dir({ #' # Create a Conda environment and install the CLI `fastqc` in it. #' condathis::create_env( #' packages = "fastqc==0.12.1", diff --git a/R/env_exists.R b/R/env_exists.R index 6b66be2..9ca2fb2 100644 --- a/R/env_exists.R +++ b/R/env_exists.R @@ -8,7 +8,7 @@ #' @return Boolean. `TRUE` if the environment exists and `FALSE` otherwise. #' @examples #' \dontrun{ -#' with_sandbox_dir({ +#' condathis::with_sandbox_dir({ #' # Create the environment #' condathis::create_env( #' packages = "fastqc", diff --git a/R/get_env_dir.R b/R/get_env_dir.R index dd89052..85dd896 100644 --- a/R/get_env_dir.R +++ b/R/get_env_dir.R @@ -7,7 +7,7 @@ #' @return A character string indicating the path where environments will be created. #' @examples -#' with_sandbox_dir({ +#' condathis::with_sandbox_dir({ #' # Get the default environment directory #' condathis::get_env_dir() #' #> "/path/to/condathis/envs/condathis-env" diff --git a/R/get_install_dir.R b/R/get_install_dir.R index 8ba1230..2f82d5f 100644 --- a/R/get_install_dir.R +++ b/R/get_install_dir.R @@ -15,7 +15,7 @@ #' A character string representing the normalized, real path to the `condathis` data directory. #' #' @examples -#' with_sandbox_dir({ +#' condathis::with_sandbox_dir({ #' condathis::get_install_dir() #' #> /home/username/.local/share/condathis #' }) diff --git a/R/install_micromamba.R b/R/install_micromamba.R index c748bac..715364c 100644 --- a/R/install_micromamba.R +++ b/R/install_micromamba.R @@ -29,7 +29,7 @@ #' #' @examples #' \dontrun{ -#' with_sandbox_dir({ +#' condathis::with_sandbox_dir({ #' # Install the default version of Micromamba #' condathis::install_micromamba() #' diff --git a/R/install_packages.R b/R/install_packages.R index f4237eb..fc4a674 100644 --- a/R/install_packages.R +++ b/R/install_packages.R @@ -12,7 +12,7 @@ #' #' @examples #' \dontrun{ -#' with_sandbox_dir({ +#' condathis::with_sandbox_dir({ #' condathis::create_env( #' packages = "fastqc", #' env_name = "fastqc-env" diff --git a/R/list_envs.R b/R/list_envs.R index 31eb8d6..e9b06ed 100644 --- a/R/list_envs.R +++ b/R/list_envs.R @@ -13,7 +13,7 @@ #' #' @examples #' \dontrun{ -#' with_sandbox_dir({ +#' condathis::with_sandbox_dir({ #' # Create environments #' condathis::create_env( #' packages = "fastqc", diff --git a/R/list_packages.R b/R/list_packages.R index 1f2b5bd..a471a9a 100644 --- a/R/list_packages.R +++ b/R/list_packages.R @@ -20,7 +20,7 @@ #' } #' @examples #' \dontrun{ -#' with_sandbox_dir({ +#' condathis::with_sandbox_dir({ #' # Creates a Conda environment with the CLI `fastqc` #' condathis::create_env( #' packages = "fastqc", diff --git a/R/micromamba_bin_path.R b/R/micromamba_bin_path.R index e7a3d40..781e122 100644 --- a/R/micromamba_bin_path.R +++ b/R/micromamba_bin_path.R @@ -12,7 +12,7 @@ #' } #' #' @examples -#' with_sandbox_dir({ +#' condathis::with_sandbox_dir({ #' # Retrieve the path to where micromamba executable is searched #' micromamba_path <- condathis::micromamba_bin_path() #' print(micromamba_path) diff --git a/R/remove_env.R b/R/remove_env.R index 7a67413..b63866f 100644 --- a/R/remove_env.R +++ b/R/remove_env.R @@ -10,7 +10,7 @@ #' #' @examples #' \dontrun{ -#' with_sandbox_dir({ +#' condathis::with_sandbox_dir({ #' condathis::create_env( #' packages = "fastqc", #' env_name = "fastqc-env" diff --git a/R/run.R b/R/run.R index f3e28ee..f387ef4 100644 --- a/R/run.R +++ b/R/run.R @@ -41,7 +41,7 @@ #' #' @examples #' \dontrun{ -#' with_sandbox_dir({ +#' condathis::with_sandbox_dir({ #' ## Create env #' create_env("samtools", env_name = "samtools-env") #' diff --git a/R/run_bin.R b/R/run_bin.R index 4581fe8..2543bfc 100644 --- a/R/run_bin.R +++ b/R/run_bin.R @@ -17,7 +17,7 @@ #' #' @examples #' \dontrun{ -#' with_sandbox_dir({ +#' condathis::with_sandbox_dir({ #' # Example assumes that 'my-env' exists and contains 'python' #' # Run 'python' with a script in 'my-env' environment #' condathis::run_bin( diff --git a/R/with_sandbox_dir.R b/R/with_sandbox_dir.R index 40c7e2d..c8833df 100644 --- a/R/with_sandbox_dir.R +++ b/R/with_sandbox_dir.R @@ -24,8 +24,8 @@ #' Returns `NULL` invisibly. #' #' @examples -#' with_sandbox_dir(print(fs::path_home())) -#' with_sandbox_dir(print(tools::R_user_dir("condathis"))) +#' condathis::with_sandbox_dir(print(fs::path_home())) +#' condathis::with_sandbox_dir(print(tools::R_user_dir("condathis"))) #' #' @export with_sandbox_dir <- function(code, .local_envir = base::parent.frame()) { diff --git a/man/create_env.Rd b/man/create_env.Rd index 2687fb1..bc67232 100644 --- a/man/create_env.Rd +++ b/man/create_env.Rd @@ -69,7 +69,7 @@ Create Conda Environment with specific packages installed to be used by \code{ru } \examples{ \dontrun{ -with_sandbox_dir({ +condathis::with_sandbox_dir({ # Create a Conda environment and install the CLI `fastqc` in it. condathis::create_env( packages = "fastqc==0.12.1", diff --git a/man/env_exists.Rd b/man/env_exists.Rd index f38a729..21c3861 100644 --- a/man/env_exists.Rd +++ b/man/env_exists.Rd @@ -20,7 +20,7 @@ and \code{FALSE} otherwise. } \examples{ \dontrun{ -with_sandbox_dir({ +condathis::with_sandbox_dir({ # Create the environment condathis::create_env( packages = "fastqc", diff --git a/man/get_env_dir.Rd b/man/get_env_dir.Rd index 800fb8a..30c78c6 100644 --- a/man/get_env_dir.Rd +++ b/man/get_env_dir.Rd @@ -18,7 +18,7 @@ Retrieve path to where environment should be created. \strong{Note}: It retrieves the Path even if the environment is \strong{not} created yet. } \examples{ -with_sandbox_dir({ +condathis::with_sandbox_dir({ # Get the default environment directory condathis::get_env_dir() #> "/path/to/condathis/envs/condathis-env" diff --git a/man/get_install_dir.Rd b/man/get_install_dir.Rd index a7744bf..8901d97 100644 --- a/man/get_install_dir.Rd +++ b/man/get_install_dir.Rd @@ -22,7 +22,7 @@ as \verb{micromamba run} fails if there are spaces in the path (e.g., in \verb{~ Therefore, Unix-style paths are used on macOS. } \examples{ -with_sandbox_dir({ +condathis::with_sandbox_dir({ condathis::get_install_dir() #> /home/username/.local/share/condathis }) diff --git a/man/install_micromamba.Rd b/man/install_micromamba.Rd index 47db467..9b61cb5 100644 --- a/man/install_micromamba.Rd +++ b/man/install_micromamba.Rd @@ -42,7 +42,7 @@ If the download fails, appropriate error messages are displayed. } \examples{ \dontrun{ -with_sandbox_dir({ +condathis::with_sandbox_dir({ # Install the default version of Micromamba condathis::install_micromamba() diff --git a/man/install_packages.Rd b/man/install_packages.Rd index b25b28a..782d208 100644 --- a/man/install_packages.Rd +++ b/man/install_packages.Rd @@ -45,7 +45,7 @@ Install Packages in a Existing Conda Environment } \examples{ \dontrun{ -with_sandbox_dir({ +condathis::with_sandbox_dir({ condathis::create_env( packages = "fastqc", env_name = "fastqc-env" diff --git a/man/list_envs.Rd b/man/list_envs.Rd index de28e6d..c33b52e 100644 --- a/man/list_envs.Rd +++ b/man/list_envs.Rd @@ -22,7 +22,7 @@ to Condathis, such as the base Conda environment itself. } \examples{ \dontrun{ -with_sandbox_dir({ +condathis::with_sandbox_dir({ # Create environments condathis::create_env( packages = "fastqc", diff --git a/man/list_packages.Rd b/man/list_packages.Rd index 73b0e7d..958bde4 100644 --- a/man/list_packages.Rd +++ b/man/list_packages.Rd @@ -40,7 +40,7 @@ each package, including its name, version, and source details. } \examples{ \dontrun{ -with_sandbox_dir({ +condathis::with_sandbox_dir({ # Creates a Conda environment with the CLI `fastqc` condathis::create_env( packages = "fastqc", diff --git a/man/micromamba_bin_path.Rd b/man/micromamba_bin_path.Rd index 9c1fdcc..3a3b56e 100644 --- a/man/micromamba_bin_path.Rd +++ b/man/micromamba_bin_path.Rd @@ -20,7 +20,7 @@ by the \code{condathis} package. The path is determined based on the system's operating system and architecture. } \examples{ -with_sandbox_dir({ +condathis::with_sandbox_dir({ # Retrieve the path to where micromamba executable is searched micromamba_path <- condathis::micromamba_bin_path() print(micromamba_path) diff --git a/man/remove_env.Rd b/man/remove_env.Rd index e65c379..8dbd2f2 100644 --- a/man/remove_env.Rd +++ b/man/remove_env.Rd @@ -29,7 +29,7 @@ Remove a Conda environment previously created by \code{create_env()}. } \examples{ \dontrun{ -with_sandbox_dir({ +condathis::with_sandbox_dir({ condathis::create_env( packages = "fastqc", env_name = "fastqc-env" diff --git a/man/run.Rd b/man/run.Rd index a5f6138..55e5ad3 100644 --- a/man/run.Rd +++ b/man/run.Rd @@ -60,7 +60,7 @@ This is particularly useful for reproducible research and ensuring that specific } \examples{ \dontrun{ -with_sandbox_dir({ +condathis::with_sandbox_dir({ ## Create env create_env("samtools", env_name = "samtools-env") diff --git a/man/run_bin.Rd b/man/run_bin.Rd index 37ed343..c38a08f 100644 --- a/man/run_bin.Rd +++ b/man/run_bin.Rd @@ -59,7 +59,7 @@ load environment variables and scripts defined in the environment } \examples{ \dontrun{ -with_sandbox_dir({ +condathis::with_sandbox_dir({ # Example assumes that 'my-env' exists and contains 'python' # Run 'python' with a script in 'my-env' environment condathis::run_bin( diff --git a/man/with_sandbox_dir.Rd b/man/with_sandbox_dir.Rd index 01651af..ea3855d 100644 --- a/man/with_sandbox_dir.Rd +++ b/man/with_sandbox_dir.Rd @@ -31,7 +31,7 @@ used to create an isolated environment during examples and tests. The temporary directories are created automatically and cleaned up after execution. } \examples{ -with_sandbox_dir(print(fs::path_home())) -with_sandbox_dir(print(tools::R_user_dir("condathis"))) +condathis::with_sandbox_dir(print(fs::path_home())) +condathis::with_sandbox_dir(print(tools::R_user_dir("condathis"))) }