Skip to content

Commit

Permalink
docs: lint examples docs
Browse files Browse the repository at this point in the history
  • Loading branch information
luciorq committed Dec 2, 2024
1 parent e75f7c8 commit bb0c823
Show file tree
Hide file tree
Showing 26 changed files with 65 additions and 339 deletions.
12 changes: 7 additions & 5 deletions R/create_env.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,20 @@
#'
#' @param overwrite Logical. Should environment always be overwritten?
#' Defaults to `FALSE`.
#' @return An object of class `list` representing the result of the command execution.
#' Contains information about the standard output, standard error, and exit status of the command.
#' This function is used for its side effect of creating a Conda environment.
#'
#' @return An object of class `list` representing the result of the command
#' execution. Contains information about the standard output, standard error,
#' and exit status of the command.
#'
#' @examples
#' \dontrun{
#' # Create a Conda environment and install the CLI `fastqc` in it.
#' condathis::create_env(
#' packages = "fastqc==0.12.1",
#' env_name = "fastqc_env",
#' env_name = "fastqc-env",
#' verbose = "output"
#' )
#' #> ! Environment fastqc_env succesfully created.
#' #> ! Environment fastqc-env succesfully created.
#' }
#' @export
create_env <- function(
Expand Down
2 changes: 1 addition & 1 deletion R/env_exists.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#' and `FALSE` otherwise.
#'
#' @inheritParams create_env
#' @return Boolean.
#' @return Boolean. `TRUE` if the environment exists and `FALSE` otherwise.
#' @examples
#' \dontrun{
#' # Create the environment
Expand Down
3 changes: 2 additions & 1 deletion R/get_condathis_path.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#' Retrieve System-Dependent Data Path for condathis
#'
#' Determines the appropriate user data directory for the `condathis` package based on the operating system. On macOS, it avoids using paths with spaces due to issues with `micromamba run` failing when there are spaces in the path.
#' Determines the appropriate user data directory for the `condathis` package based on the operating system.
#' On macOS, it avoids using paths with spaces due to issues with `micromamba run` failing when there are spaces in the path.
#'
#' @details
#' This function uses the `rappdirs` package to determine the user data directory.
Expand Down
11 changes: 7 additions & 4 deletions R/install_packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@
#'
#' @inheritParams create_env
#'
#' @return No value is returned; this function is used for its side effect of installing packages in a conda environment.
#' @return An object of class `list` representing the result of the command
#' execution. Contains information about the standard output, standard error,
#' and exit status of the command.
#'
#' @examples
#' \dontrun{
#' condathis::create_env(
#' packages = "fastqc",
#' env_name = "fastqc_env"
#' env_name = "fastqc-env"
#' )
#' # Install the package `vim` in the `fastqc_env` environment.
#' # Install the package `vim` in the `fastqc-env` environment.
#' # It is not recommended to install multiple packages in the same environment,
# # as it defeats the purpose of isolation provided by separate environments.
#' condathis::install_packages(packages = "vim", env_name = "fastqc_env")
#' condathis::install_packages(packages = "vim", env_name = "fastqc-env")
#' }
#' @export
install_packages <- function(packages,
Expand Down
6 changes: 3 additions & 3 deletions R/list_packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#' # Creates a Conda environment with the CLI `fastqc`
#' condathis::create_env(
#' packages = "fastqc",
#' env_name = "fastqc_env"
#' env_name = "fastqc-env"
#' )
#' # Lists the packages in env `fastqc_env`
#' dat <- condathis::list_packages("fastqc_env")
#' # Lists the packages in env `fastqc-env`
#' dat <- condathis::list_packages("fastqc-env")
#' dim(dat)
#' #> [1] 34 8
#' }
Expand Down
5 changes: 3 additions & 2 deletions R/remove_env.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
#'
#' @inheritParams create_env
#'
#' @return An object of class `list` representing the result of the command execution.
#' Contains information about the standard output, standard error, and exit status of the command.
#' @return An object of class `list` representing the result of the command
#' execution. Contains information about the standard output, standard error,
#' and exit status of the command.
#'
#' @examples
#' \dontrun{
Expand Down
14 changes: 8 additions & 6 deletions R/run_bin.R
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
#' Run a Binary from a Conda Environment Without Emvironment Activation
#' Run a Binary from a Conda Environment Without Environment Activation
#'
#' Executes a binary command from a specified Conda environment without activating the environment or using its environment variables. This function temporarily clears Conda and Mamba-related environment variables to prevent interference, ensuring that the command runs in a clean environment.
#' Usually this is not what the user wants, check [run()] for the stable function to use.
#'
#' @inheritParams run
#'
#' @return An invisible list containing the results from `processx::run()`, including standard output and error.
#' @return An object of class `list` representing the result of the command
#' execution. Contains information about the standard output, standard error,
#' and exit status of the command.
#'
#' @examples
#' \dontrun{
#' # Example assumes that 'my_env' exists and contains 'python'
#' # Run 'python' with a script in 'my_env' environment
#' condathis::run_bin("python", "script.py", env_name = "my_env", verbose = "silent")
#' # Example assumes that 'my-env' exists and contains 'python'
#' # Run 'python' with a script in 'my-env' environment
#' condathis::run_bin("python", "script.py", env_name = "my-env", verbose = "silent")
#'
#' # Run 'ls' command with additional arguments
#' condathis::run_bin("ls", "-la", env_name = "my_env")
#' condathis::run_bin("ls", "-la", env_name = "my-env")
#' }
#'
#' @export
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ Run system command line interface (CLI) tools in a **reproducible** and

## Get started

Install package from [CRAN](https://cran.r-project.org):

<!--
When available, install package from [CRAN](https://cran.r-project.org):
&#10;
``` r
install.packages("condathis")
```
-->

Install package from
[R-Universe](https://luciorq.r-universe.dev/condathis):
Expand All @@ -30,6 +32,8 @@ install.packages("condathis", repos = c("https://luciorq.r-universe.dev", getOpt

``` r
remotes::install_github("luciorq/condathis")
# or
pak::pkg_install("github::luciorq/condathis")
```

## Motivation
Expand Down Expand Up @@ -122,8 +126,8 @@ manages all the library dependencies of `fastqc`, making sure that they
are compatible with the specific operating system.

``` r
condathis::create_env(packages = "fastqc==0.12.1", env_name = "fastqc_env", verbose = "output")
#> ! Environment fastqc_env succesfully created.
condathis::create_env(packages = "fastqc==0.12.1", env_name = "fastqc-env", verbose = "output")
#> ! Environment fastqc-env succesfully created.
```

Then we run the command inside the environment just created which
Expand Down
12 changes: 0 additions & 12 deletions man/create_base_env.Rd

This file was deleted.

10 changes: 5 additions & 5 deletions man/create_env.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 0 additions & 36 deletions man/define_platform.Rd

This file was deleted.

2 changes: 1 addition & 1 deletion man/env_exists.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions man/format_channels_args.Rd

This file was deleted.

19 changes: 0 additions & 19 deletions man/get_condathis_path.Rd

This file was deleted.

10 changes: 6 additions & 4 deletions man/install_packages.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions man/is_micromamba_available_for_arch.Rd

This file was deleted.

6 changes: 3 additions & 3 deletions man/list_packages.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions man/micromamba_user_installed.Rd

This file was deleted.

49 changes: 0 additions & 49 deletions man/native_cmd.Rd

This file was deleted.

Loading

0 comments on commit bb0c823

Please sign in to comment.