diff --git a/.Rbuildignore b/.Rbuildignore index cb41c62d..f2ead558 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -21,3 +21,5 @@ ^\.github$ ^LICENSE\.md$ ^MAINTENANCE\.md$ +^pkgdown$ +^README\.Rmd$ diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..3ac34c82 --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,126 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at codeofconduct@posit.co. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][https://github.com/mozilla/inclusion]. + +For answers to common questions about this code of conduct, see the FAQ at +. Translations are available at . + +[homepage]: https://www.contributor-covenant.org diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 6ab68884..ee65ccb5 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,4 +1,4 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help # # NOTE: This workflow is overkill for most R packages and @@ -22,49 +22,41 @@ jobs: fail-fast: false matrix: config: - - {os: macOS-latest, r: 'release'} + - {os: macos-latest, r: 'release'} - {os: windows-latest, r: 'release'} # Use 3.6 to trigger usage of RTools35 - {os: windows-latest, r: '3.6'} + # use 4.1 to check with rtools40's older compiler + - {os: windows-latest, r: '4.1'} - # Use older ubuntu to maximise backward compatibility - - {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-18.04, r: 'release'} - - {os: ubuntu-18.04, r: 'oldrel-1'} - - {os: ubuntu-18.04, r: 'oldrel-2'} - - {os: ubuntu-18.04, r: 'oldrel-3'} - - {os: ubuntu-18.04, r: 'oldrel-4'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + - {os: ubuntu-latest, r: 'oldrel-2'} + - {os: ubuntu-latest, r: 'oldrel-3'} + - {os: ubuntu-latest, r: 'oldrel-4'} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} R_KEEP_PKG_SOURCE: yes steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: r-lib/actions/setup-pandoc@v1 + - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 with: r-version: ${{ matrix.config.r }} http-user-agent: ${{ matrix.config.http-user-agent }} use-public-rspm: true - - uses: r-lib/actions/setup-r-dependencies@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: rcmdcheck + extra-packages: any::rcmdcheck + needs: check - - uses: r-lib/actions/check-r-package@v1 - - - name: Show testthat output - if: always() - run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash - - - name: Upload check results - if: failure() - uses: actions/upload-artifact@main + - uses: r-lib/actions/check-r-package@v2 with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check + upload-snapshots: true diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 59ae3087..ed7650c7 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -1,33 +1,48 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: branches: [main, master] - tags: ['*'] + pull_request: + branches: [main, master] + release: + types: [published] + workflow_dispatch: name: pkgdown jobs: pkgdown: runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: r-lib/actions/setup-pandoc@v1 + - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - - uses: r-lib/actions/setup-r-dependencies@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: pkgdown + extra-packages: any::pkgdown, local::. needs: website - - name: Deploy package - run: | - git config --local user.name "$GITHUB_ACTOR" - git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" - Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.4.1 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.github/workflows/pr-commands.yaml b/.github/workflows/pr-commands.yaml index 1cdafbf7..71f335b3 100644 --- a/.github/workflows/pr-commands.yaml +++ b/.github/workflows/pr-commands.yaml @@ -1,4 +1,4 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: issue_comment: @@ -8,28 +8,30 @@ name: Commands jobs: document: - if: startsWith(github.event.comment.body, '/document') + if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }} name: document runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: r-lib/actions/pr-fetch@v1 + - uses: r-lib/actions/pr-fetch@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - - uses: r-lib/actions/setup-r-dependencies@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: roxygen2 + extra-packages: any::roxygen2 + needs: pr-document - name: Document - run: Rscript -e 'roxygen2::roxygenise()' + run: roxygen2::roxygenise() + shell: Rscript {0} - name: commit run: | @@ -38,30 +40,32 @@ jobs: git add man/\* NAMESPACE git commit -m 'Document' - - uses: r-lib/actions/pr-push@v1 + - uses: r-lib/actions/pr-push@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} style: - if: startsWith(github.event.comment.body, '/style') + if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }} name: style runs-on: ubuntu-latest env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: r-lib/actions/pr-fetch@v1 + - uses: r-lib/actions/pr-fetch@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 - name: Install dependencies - run: Rscript -e 'install.packages("styler")' + run: install.packages("styler") + shell: Rscript {0} - name: Style - run: Rscript -e 'styler::style_pkg()' + run: styler::style_pkg() + shell: Rscript {0} - name: commit run: | @@ -70,6 +74,6 @@ jobs: git add \*.R git commit -m 'Style' - - uses: r-lib/actions/pr-push@v1 + - uses: r-lib/actions/pr-push@v2 with: repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 3c0da1c9..27d45283 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,4 +1,4 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help on: push: @@ -15,16 +15,36 @@ jobs: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - - uses: r-lib/actions/setup-r-dependencies@v1 + - uses: r-lib/actions/setup-r-dependencies@v2 with: - extra-packages: covr + extra-packages: any::covr + needs: coverage - name: Test coverage - run: covr::codecov() + run: | + covr::codecov( + quiet = FALSE, + clean = FALSE, + install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") + ) shell: Rscript {0} + + - name: Show testthat output + if: always() + run: | + ## -------------------------------------------------------------------- + find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true + shell: bash + + - name: Upload test results + if: failure() + uses: actions/upload-artifact@v3 + with: + name: coverage-test-failures + path: ${{ runner.temp }}/package diff --git a/.gitignore b/.gitignore index c4b0204c..06f65820 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ doc /.env docs/ /inst/doc +docs diff --git a/DESCRIPTION b/DESCRIPTION index b498f884..2d6f08bd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -3,21 +3,23 @@ Title: R Package Installation from Remote Repositories, Including 'GitHub' Version: 2.4.2.9000 Authors@R: c( person("Gábor", "Csárdi", , "csardi.gabor@gmail.com", role = c("aut", "cre")), - person("Jim", "Hester", , "jim.hester@rstudio.com", role = "aut"), - person("Hadley", "Wickham", role = c("aut")), + person("Jim", "Hester", role = "aut"), + person("Hadley", "Wickham", role = "aut"), person("Winston", "Chang", role = "aut"), - person("RStudio", role = "cph"), person("Martin", "Morgan", role = "aut"), person("Dan", "Tenenbaum", role = "aut"), + person("Posit Software, PBC", role = c("cph", "fnd")), person("Mango Solutions", role = "cph") - ) -Description: Download and install R packages stored in 'GitHub', 'GitLab', - 'Bitbucket', 'Bioconductor', or plain 'subversion' or 'git' repositories. - This package provides the 'install_*' functions in 'devtools'. Indeed most - of the code was copied over from 'devtools'. + ) +Description: Download and install R packages stored in 'GitHub', 'GitLab', + 'Bitbucket', 'Bioconductor', or plain 'subversion' or 'git' + repositories. This package provides the 'install_*' functions in + 'devtools'. Indeed most of the code was copied over from 'devtools'. License: MIT + file LICENSE URL: https://remotes.r-lib.org, https://github.com/r-lib/remotes#readme BugReports: https://github.com/r-lib/remotes/issues +Depends: + R (>= 3.0.0) Imports: methods, stats, @@ -27,22 +29,23 @@ Suggests: brew, callr, codetools, - curl, covr, + curl, git2r (>= 0.23.0), knitr, mockery, - pkgbuild (>= 1.0.1), pingr, + pkgbuild (>= 1.0.1), rmarkdown, rprojroot, - testthat, + testthat (>= 3.0.0), webfakes, withr -Depends: - R (>= 3.0.0) -VignetteBuilder: knitr -RoxygenNote: 7.2.1 -SystemRequirements: Subversion for install_svn, git for install_git +VignetteBuilder: + knitr +Config/Needs/website: tidyverse/tidytemplate +Config/testthat/edition: 3 Encoding: UTF-8 Roxygen: list(markdown = TRUE) +RoxygenNote: 7.2.3 +SystemRequirements: Subversion for install_svn, git for install_git diff --git a/NEWS.md b/NEWS.md index 63e8d375..d33edeb6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -35,7 +35,7 @@ * `system_requirements()` now works as intended if only the `os` argument is used (@mdneuzerling, #609) -* `remote_package_name.git2r_remote` and `remote_package_name.xgit_remote` now get correct package name from HTTP(S) git repo's `DESCRIPTION` file, and thus package's `DESCRIPTION` file's `Remotes` field could have `git::http(s):////[.git][@ref]` items that install remote packages using git via HTTP(S) protocal (@niheaven, #603). +* `remote_package_name.git2r_remote` and `remote_package_name.xgit_remote` now get correct package name from HTTP(S) git repo's `DESCRIPTION` file, and thus package's `DESCRIPTION` file's `Remotes` field could have `git::http(s):////[.git][@ref]` items that install remote packages using git via HTTP(S) protocol (@niheaven, #603). # remotes 2.3.0 diff --git a/R/bioc-standalone.R b/R/bioc-standalone.R index d4b4640a..ff749af5 100644 --- a/R/bioc-standalone.R +++ b/R/bioc-standalone.R @@ -67,6 +67,7 @@ #' * 2020-03-22 get_matching_bioc_version() is now correct if the current #' R version is not in the builtin mapping. #' * 2020-11-21 Update internal map for 3.12. +#' * 2023-05-08 Add 'books' repo. #' #' @name bioconductor #' @keywords internal @@ -79,7 +80,12 @@ bioconductor <- local({ # ------------------------------------------------------------------- # Configuration that does not change often - config_url <- "https://bioconductor.org/config.yaml" + config_url <- function() { + Sys.getenv( + "R_BIOC_CONFIG_URL", + "https://bioconductor.org/config.yaml" + ) + } builtin_map <- list( "2.1" = package_version("1.6"), @@ -105,7 +111,10 @@ bioconductor <- local({ "3.5" = package_version("3.8"), "3.6" = package_version("3.10"), "4.0" = package_version("3.12"), - "4.1" = package_version("3.14") + "4.1" = package_version("3.14"), + "4.2" = package_version("3.16"), + "4.3" = package_version("3.17"), + "4.4" = package_version("3.18") ) # ------------------------------------------------------------------- @@ -116,14 +125,21 @@ bioconductor <- local({ version_map <- NULL yaml_config <- NULL + clear_cache <- function() { + devel_version <<- NULL + release_version <<- NULL + version_map <<- NULL + yaml_config <<- NULL + } + # ------------------------------------------------------------------- # API get_yaml_config <- function(forget = FALSE) { if (forget || is.null(yaml_config)) { - new <- tryCatch(read_url(config_url), error = function(x) x) + new <- tryCatch(read_url(config_url()), error = function(x) x) if (inherits(new, "error")) { - http_url <- sub("^https", "http", config_url) + http_url <- sub("^https", "http", config_url()) new <- tryCatch(read_url(http_url), error = function(x) x) } if (inherits(new, "error")) stop(new) @@ -257,7 +273,7 @@ bioconductor <- local({ if (bioc_version >= "3.7") "{mirror}/packages/{bv}/workflows", BioCextra = if (bioc_version <= "3.5") "{mirror}/packages/{bv}/extra", - BioCbooks = + BioCbooks = if (bioc_version >= "3.12") "{mirror}/packages/{bv}/books" ) diff --git a/R/package.R b/R/package.R index 87e4c633..21b8b65f 100644 --- a/R/package.R +++ b/R/package.R @@ -1,7 +1,7 @@ load_pkg_description <- function(path) { - path <- normalizePath(path) + path <- normalizePath(path, mustWork = TRUE) if (!is_dir(path)) { dir <- tempfile() diff --git a/R/remotes-package.R b/R/remotes-package.R new file mode 100644 index 00000000..a65cf643 --- /dev/null +++ b/R/remotes-package.R @@ -0,0 +1,6 @@ +#' @keywords internal +"_PACKAGE" + +## usethis namespace: start +## usethis namespace: end +NULL diff --git a/R/system_requirements.R b/R/system_requirements.R index ff262451..873abbf1 100644 --- a/R/system_requirements.R +++ b/R/system_requirements.R @@ -1,5 +1,5 @@ DEFAULT_RSPM_REPO_ID <- "1" # cran -DEFAULT_RSPM <- "https://packagemanager.rstudio.com" +DEFAULT_RSPM <- "https://packagemanager.posit.co" #' Query the system requirements for a package (and its dependencies) #' @@ -48,6 +48,7 @@ system_requirements <- function(os, os_release = NULL, path = ".", package = NUL curl, args = c( "--silent", + "-L", shQuote(sprintf("%s/sysreqs?all=false&pkgname=%s&distribution=%s&release=%s", rspm_repo_url, paste(package, collapse = "&pkgname="), @@ -72,6 +73,7 @@ system_requirements <- function(os, os_release = NULL, path = ".", package = NUL curl, args = c( "--silent", + "-L", "--data-binary", shQuote(paste0("@", desc_file)), shQuote(sprintf("%s/sysreqs?distribution=%s&release=%s&suggests=true", diff --git a/README.Rmd b/README.Rmd new file mode 100644 index 00000000..86ef0f72 --- /dev/null +++ b/README.Rmd @@ -0,0 +1,234 @@ +--- +output: github_document +--- + + + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + fig.path = "man/figures/README-", + out.width = "100%" +) +``` + +# remotes + +> Install R Packages from remote or local repositories, +> including GitHub, GitLab, Bitbucket, and Bioconductor + + + +[![R-CMD-check](https://github.com/r-lib/remotes/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/remotes/actions/workflows/R-CMD-check.yaml) +[![Codecov test coverage](https://codecov.io/gh/r-lib/remotes/branch/main/graph/badge.svg)](https://app.codecov.io/gh/r-lib/remotes?branch=main) +[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/remotes)](https://www.r-pkg.org/pkg/remotes) +[![](https://www.r-pkg.org/badges/version/remotes)](https://www.r-pkg.org/pkg/remotes) +[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html) + + +Download and install R packages stored in GitHub, GitLab, Bitbucket, +Bioconductor, or plain subversion or git repositories. This package +is a lightweight replacement of the `install_*` functions in +[`devtools`](https://github.com/r-lib/devtools). +Indeed most of the code was copied over from `devtools`. + +## Features + +* Installers: + * Install packages with their dependencies. + * Install from GitHub, GitLab, Bitbucket. + * Install from git and subversion repositories. + * Install from local files or URLs. + * Install the dependencies of a local package tree. + * Install specific package versions from CRAN. +* Supports [Bioconductor](https://bioconductor.org/) packages. +* Supports the `Remotes` field in `DESCRIPTION`. See more in the + [dependencies](https://github.com/r-lib/remotes/blob/HEAD/vignettes/dependencies.Rmd) vignette. +* Supports the `Additional_repositories` field in `DESCRIPTION`. +* Can install itself from GitHub (see below). +* Does not depend on other R packages. +* Does not contain compiled code, so no compiler is needed. +* Does not need any external software (for most of the functionality + at least). + +## Installation + +Install the released version of remotes from CRAN: + +```r +install.packages("remotes") +``` + +## Usage + +Note that most of the examples here use GitHub. See below for other +supported repository types. + +To install the latest version of a package in the default branch from +GitHub, you can use the `user/repo` form. Note that `user` can also be +an organization: + +```r +remotes::install_github("r-lib/conflicted") +``` + +If the R package is inside a subdirectory of the root directory, +then give this subdirectory as well: + +```r +# build = FALSE because of some specificities of XGBoost package +install_github("dmlc/xgboost/R-package", build = FALSE) +``` + +To install a certain branch or commit or tag, append it to the +repo name, after an `@`: + +```r +remotes::install_github("gaborcsardi/pkgconfig@v2.0.0") +``` + +To install the latest release, append `@*release` to the repo +name: + +```r +remotes::install_github("gaborcsardi/pkgconfig@*release") +``` + +To install a pull request, append `#` and the id (an integer number) +of the pull request to the repo name: + +```r +remotes::install_github("r-lib/pkgconfig#7") +``` + +### Dependencies + +Dependencies are automatically installed from CRAN. By default, +outdated dependencies are automatically upgraded. In interactive sessions +you can select a subset of the dependencies to upgrade. + +#### Dependencies on GitHub + +It is also possible to install dependencies from GitHub or other +supported repositories. For this you need to add a `Remotes` field to the +`DESCRIPTION` file. Its format is: +``` +Remotes: [remote::]repo_spec, [remote::]repo_spec, ... +``` +where `repo_spec` is any repository specification the corresponding +`install_()` function can handle. If `remote::` is missing, `github::` is +assumed. Other possible values: `gitlab::`,`bitbucket::`, `git::`, `local::`, +`svn::`, `url::`, `version::`, `cran::`, `bioc::`. + +See more about the `Remotes` field in this +[vignette](https://remotes.r-lib.org/articles/dependencies.html). + +#### Additional repositories + +remotes supports the `Additional_repositories` field in +`DESCRIPTION`. This is a way to specify dependencies from non-CRAN +package repositories. See the [Writing R extensions](https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Package-Dependencies) +manual for details. + +#### Bioconductor packages + +Bioconductor packages are automatically detected and their +dependencies are installed from Bioconductor. + +#### Currently supported remote types + +* GitHub repositories via `install_github`. +* Bitbucket repositories via `install_bitbucket`. +* Generic git repositories via `install_git`. They need either a + system git installation, or the + [git2r](https://github.com/ropensci/git2r) R package. +* Local directories or package archive files via `install_local`. +* Remote package archive files via `install_url`. +* Packages in subversion repositories via `install_svn`. They need + a system subversion installation. +* Specific package versions from CRAN or other CRAN-like + repositories via `install_version`. This includes outdated + and archived packages as well. +* All dependencies of a package in a local directory via + `install_deps`. + +### Download methods + +* For R older than 3.2, the curl package is required as remotes falls back + to `curl::curl_download` in that case +* For R newer than 3.3, default `download.file()` method is used. + (`method = "auto"`) +* For in between versions, + * `method = "wininet"` is used on windows OS + * `method = "libcurl"` is used on other OS, if available. + +See `help("download.file")` for information on these methods and for +setting proxies if needed. + +### Standalone mode + +remotes will use the curl, git2r and pkgbuild packages if they are +installed to provide faster implementations for some aspects of the install +process. However if you are using remotes to install or update these packages +(or their reverse dependencies) using them during installation may fail +(particularly on Windows). + +If you set the environment variable `R_REMOTES_STANDALONE="true"` (e.g. +in R `Sys.setenv(R_REMOTES_STANDALONE="true")`) you can force remotes to +operate in standalone mode and use only its internal R implementations. This +will allow successful installation of these packages. + +### Options + +remotes uses the following standard R options, see `?options` for their +details: + +* `download.file.method` for the default download method. See + `?download.file`. + +* `pkgType` for the package type (source or binary, see manual) to install, + download or look up dependencies for. + +* `repos` for the locations of the user's standard CRAN(-like) repositories. + +It also uses some remotes specific options: + +* `BioC_git` for the URL of the default Bioconductor git mirror. + +* `BioC_mirror` for the URL of the Bioconductor mirror. + +* `unzip` for the path of the external `unzip` program. + +### Environment variables + +* The `BITBUCKET_USER` and `BITBUCKET_PASSWORD` environment variables + are used for the default Bitbucket user name and password, in + `install_bitbucket()` + +* The `GITHUB_PAT` environment variable is used as the default GitHub + personal access token for all GitHub API queries. + +* The `R_BIOC_MIRROR` environment variable can be used to specify an + alternative Bioconductor mirror. (The `BioC_mirror` option takes + precedence over this.) + +* The `R_BIOC_VERSION` environment variable can be used to force a + Bioconductor version. + +* The `R_REMOTES_UPGRADE` environment variable can be used to set a default + preferred value for the `upgrade =` argument accepted by the various + `install_*()` functions. For example, you can set `R_REMOTES_UPGRADE="always"` + to upgrade dependent packages without asking the user. + +* Setting `R_REMOTES_STANDALONE="true"` forces remotes to work in standalone + mode and avoid loading its optional dependencies (curl, git2 and pkgbuild + currently. See "Standalone mode" above. + +* Setting `R_REMOTES_NO_ERRORS_FROM_WARNINGS="false"` will cause warning + messages during calls to `install.packages()` to become errors. Often warning + messages are caused by dependencies failing to install. + +## License + +GPL (>= 2) © Mango Solutions, RStudio diff --git a/README.md b/README.md index 8f5f7d58..57909144 100644 --- a/README.md +++ b/README.md @@ -1,48 +1,54 @@ -# remotes + -> Install R Packages from remote or local repositories, -> including GitHub, GitLab, Bitbucket, and Bioconductor +# remotes +> Install R Packages from remote or local repositories, including +> GitHub, GitLab, Bitbucket, and Bioconductor -[![R-CMD-check](https://github.com/r-lib/remotes/workflows/R-CMD-check/badge.svg)](https://github.com/r-lib/remotes/actions) -[![Codecov test coverage](https://codecov.io/gh/r-lib/remotes/branch/main/graph/badge.svg)](https://app.codecov.io/gh/r-lib/remotes?branch=main) -[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/remotes)](https://www.r-pkg.org/pkg/remotes) + +[![R-CMD-check](https://github.com/r-lib/remotes/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/remotes/actions/workflows/R-CMD-check.yaml) +[![Codecov test +coverage](https://codecov.io/gh/r-lib/remotes/branch/main/graph/badge.svg)](https://app.codecov.io/gh/r-lib/remotes?branch=main) +[![CRAN RStudio mirror +downloads](https://cranlogs.r-pkg.org/badges/remotes)](https://www.r-pkg.org/pkg/remotes) [![](https://www.r-pkg.org/badges/version/remotes)](https://www.r-pkg.org/pkg/remotes) -[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html) +[![Lifecycle: +stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html) -Download and install R packages stored in GitHub, GitLab, Bitbucket, -Bioconductor, or plain subversion or git repositories. This package -is a lightweight replacement of the `install_*` functions in -[`devtools`](https://github.com/r-lib/devtools). -Indeed most of the code was copied over from `devtools`. +Download and install R packages stored in GitHub, GitLab, Bitbucket, +Bioconductor, or plain subversion or git repositories. This package is a +lightweight replacement of the `install_*` functions in +[`devtools`](https://github.com/r-lib/devtools). Indeed most of the code +was copied over from `devtools`. ## Features -* Installers: - * Install packages with their dependencies. - * Install from GitHub, GitLab, Bitbucket. - * Install from git and subversion repositories. - * Install from local files or URLs. - * Install the dependencies of a local package tree. - * Install specific package versions from CRAN. -* Supports [Bioconductor](https://bioconductor.org/) packages. -* Supports the `Remotes` field in `DESCRIPTION`. See more in the - [dependencies](https://github.com/r-lib/remotes/blob/HEAD/vignettes/dependencies.Rmd) vignette. -* Supports the `Additional_repositories` field in `DESCRIPTION`. -* Can install itself from GitHub (see below). -* Does not depend on other R packages. -* Does not contain compiled code, so no compiler is needed. -* Does not need any external software (for most of the functionality - at least). +- Installers: + - Install packages with their dependencies. + - Install from GitHub, GitLab, Bitbucket. + - Install from git and subversion repositories. + - Install from local files or URLs. + - Install the dependencies of a local package tree. + - Install specific package versions from CRAN. +- Supports [Bioconductor](https://bioconductor.org/) packages. +- Supports the `Remotes` field in `DESCRIPTION`. See more in the + [dependencies](https://github.com/r-lib/remotes/blob/HEAD/vignettes/dependencies.Rmd) + vignette. +- Supports the `Additional_repositories` field in `DESCRIPTION`. +- Can install itself from GitHub (see below). +- Does not depend on other R packages. +- Does not contain compiled code, so no compiler is needed. +- Does not need any external software (for most of the functionality at + least). ## Installation Install the released version of remotes from CRAN: -```r +``` r install.packages("remotes") ``` @@ -55,166 +61,167 @@ To install the latest version of a package in the default branch from GitHub, you can use the `user/repo` form. Note that `user` can also be an organization: -```r +``` r remotes::install_github("r-lib/conflicted") ``` -If the R package is inside a subdirectory of the root directory, -then give this subdirectory as well: +If the R package is inside a subdirectory of the root directory, then +give this subdirectory as well: -```r +``` r # build = FALSE because of some specificities of XGBoost package install_github("dmlc/xgboost/R-package", build = FALSE) ``` -To install a certain branch or commit or tag, append it to the -repo name, after an `@`: +To install a certain branch or commit or tag, append it to the repo +name, after an `@`: -```r +``` r remotes::install_github("gaborcsardi/pkgconfig@v2.0.0") ``` -To install the latest release, append `@*release` to the repo -name: +To install the latest release, append `@*release` to the repo name: -```r +``` r remotes::install_github("gaborcsardi/pkgconfig@*release") ``` -To install a pull request, append `#` and the id (an integer number) -of the pull request to the repo name: +To install a pull request, append `#` and the id (an integer number) of +the pull request to the repo name: -```r +``` r remotes::install_github("r-lib/pkgconfig#7") ``` ### Dependencies -Dependencies are automatically installed from CRAN. By default, -outdated dependencies are automatically upgraded. In interactive sessions -you can select a subset of the dependencies to upgrade. +Dependencies are automatically installed from CRAN. By default, outdated +dependencies are automatically upgraded. In interactive sessions you can +select a subset of the dependencies to upgrade. #### Dependencies on GitHub It is also possible to install dependencies from GitHub or other -supported repositories. For this you need to add a `Remotes` field to the -`DESCRIPTION` file. Its format is: -``` -Remotes: [remote::]repo_spec, [remote::]repo_spec, ... -``` +supported repositories. For this you need to add a `Remotes` field to +the `DESCRIPTION` file. Its format is: + + Remotes: [remote::]repo_spec, [remote::]repo_spec, ... + where `repo_spec` is any repository specification the corresponding -`install_()` function can handle. If `remote::` is missing, `github::` is -assumed. Other possible values: `gitlab::`,`bitbucket::`, `git::`, `local::`, -`svn::`, `url::`, `version::`, `cran::`, `bioc::`. +`install_()` function can handle. If `remote::` is missing, `github::` +is assumed. Other possible values: `gitlab::`,`bitbucket::`, `git::`, +`local::`, `svn::`, `url::`, `version::`, `cran::`, `bioc::`. See more about the `Remotes` field in this [vignette](https://remotes.r-lib.org/articles/dependencies.html). #### Additional repositories -remotes supports the `Additional_repositories` field in -`DESCRIPTION`. This is a way to specify dependencies from non-CRAN -package repositories. See the [Writing R extensions](https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Package-Dependencies) +remotes supports the `Additional_repositories` field in `DESCRIPTION`. +This is a way to specify dependencies from non-CRAN package +repositories. See the [Writing R +extensions](https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Package-Dependencies) manual for details. #### Bioconductor packages -Bioconductor packages are automatically detected and their -dependencies are installed from Bioconductor. +Bioconductor packages are automatically detected and their dependencies +are installed from Bioconductor. #### Currently supported remote types -* GitHub repositories via `install_github`. -* Bitbucket repositories via `install_bitbucket`. -* Generic git repositories via `install_git`. They need either a - system git installation, or the - [git2r](https://github.com/ropensci/git2r) R package. -* Local directories or package archive files via `install_local`. -* Remote package archive files via `install_url`. -* Packages in subversion repositories via `install_svn`. They need - a system subversion installation. -* Specific package versions from CRAN or other CRAN-like - repositories via `install_version`. This includes outdated - and archived packages as well. -* All dependencies of a package in a local directory via - `install_deps`. +- GitHub repositories via `install_github`. +- Bitbucket repositories via `install_bitbucket`. +- Generic git repositories via `install_git`. They need either a system + git installation, or the [git2r](https://github.com/ropensci/git2r) R + package. +- Local directories or package archive files via `install_local`. +- Remote package archive files via `install_url`. +- Packages in subversion repositories via `install_svn`. They need a + system subversion installation. +- Specific package versions from CRAN or other CRAN-like repositories + via `install_version`. This includes outdated and archived packages as + well. +- All dependencies of a package in a local directory via `install_deps`. ### Download methods -* For R older than 3.2, the curl package is required as remotes falls back - to `curl::curl_download` in that case -* For R newer than 3.3, default `download.file()` method is used. +- For R older than 3.2, the curl package is required as remotes falls + back to `curl::curl_download` in that case +- For R newer than 3.3, default `download.file()` method is used. (`method = "auto"`) -* For in between versions, - * `method = "wininet"` is used on windows OS - * `method = "libcurl"` is used on other OS, if available. +- For in between versions, + - `method = "wininet"` is used on windows OS + - `method = "libcurl"` is used on other OS, if available. -See `help("download.file")` for informations on these methods and for +See `help("download.file")` for information on these methods and for setting proxies if needed. ### Standalone mode remotes will use the curl, git2r and pkgbuild packages if they are -installed to provide faster implementations for some aspects of the install -process. However if you are using remotes to install or update these packages -(or their reverse dependencies) using them during installation may fail -(particularly on Windows). +installed to provide faster implementations for some aspects of the +install process. However if you are using remotes to install or update +these packages (or their reverse dependencies) using them during +installation may fail (particularly on Windows). If you set the environment variable `R_REMOTES_STANDALONE="true"` (e.g. in R `Sys.setenv(R_REMOTES_STANDALONE="true")`) you can force remotes to -operate in standalone mode and use only its internal R implementations. This -will allow successful installation of these packages. +operate in standalone mode and use only its internal R implementations. +This will allow successful installation of these packages. ### Options remotes uses the following standard R options, see `?options` for their details: -* `download.file.method` for the default download method. See +- `download.file.method` for the default download method. See `?download.file`. -* `pkgType` for the package type (source or binary, see manual) to install, - download or look up dependencies for. +- `pkgType` for the package type (source or binary, see manual) to + install, download or look up dependencies for. -* `repos` for the locations of the user's standard CRAN(-like) repositories. +- `repos` for the locations of the user’s standard CRAN(-like) + repositories. It also uses some remotes specific options: -* `BioC_git` for the URL of the default Bioconductor git mirror. +- `BioC_git` for the URL of the default Bioconductor git mirror. -* `BioC_mirror` for the URL of the Bioconductor mirror. +- `BioC_mirror` for the URL of the Bioconductor mirror. -* `unzip` for the path of the external `unzip` program. +- `unzip` for the path of the external `unzip` program. ### Environment variables -* The `BITBUCKET_USER` and `BITBUCKET_PASSWORD` environment variables - are used for the default Bitbucket user name and password, in +- The `BITBUCKET_USER` and `BITBUCKET_PASSWORD` environment variables + are used for the default Bitbucket user name and password, in `install_bitbucket()` -* The `GITHUB_PAT` environment variable is used as the default GitHub +- The `GITHUB_PAT` environment variable is used as the default GitHub personal access token for all GitHub API queries. -* The `R_BIOC_MIRROR` environment variable can be used to specify an +- The `R_BIOC_MIRROR` environment variable can be used to specify an alternative Bioconductor mirror. (The `BioC_mirror` option takes precedence over this.) -* The `R_BIOC_VERSION` environment variable can be used to force a +- The `R_BIOC_VERSION` environment variable can be used to force a Bioconductor version. -* The `R_REMOTES_UPGRADE` environment variable can be used to set a default - preferred value for the `upgrade =` argument accepted by the various - `install_*()` functions. For example, you can set `R_REMOTES_UPGRADE="always"` - to upgrade dependent packages without asking the user. +- The `R_REMOTES_UPGRADE` environment variable can be used to set a + default preferred value for the `upgrade =` argument accepted by the + various `install_*()` functions. For example, you can set + `R_REMOTES_UPGRADE="always"` to upgrade dependent packages without + asking the user. -* Setting `R_REMOTES_STANDALONE="true"` forces remotes to work in standalone - mode and avoid loading its optional dependencies (curl, git2 and pkgbuild - currently. See "Standalone mode" above. +- Setting `R_REMOTES_STANDALONE="true"` forces remotes to work in + standalone mode and avoid loading its optional dependencies (curl, + git2 and pkgbuild currently. See “Standalone mode” above. -* Setting `R_REMOTES_NO_ERRORS_FROM_WARNINGS="false"` will cause warning - messages during calls to `install.packages()` to become errors. Often warning - messages are caused by dependencies failing to install. +- Setting `R_REMOTES_NO_ERRORS_FROM_WARNINGS="false"` will cause warning + messages during calls to `install.packages()` to become errors. Often + warning messages are caused by dependencies failing to install. ## License -GPL (>= 2) © Mango Solutions, RStudio +GPL (\>= 2) © Mango Solutions, RStudio diff --git a/_pkgdown.yml b/_pkgdown.yml index 1410a85d..ebf46e07 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,4 +1,16 @@ url: https://remotes.r-lib.org + +development: + mode: auto + +template: + package: tidytemplate + bootstrap: 5 + + includes: + in_header: | + + reference: - title: Package Installation desc: Tools for installing packages from a variety of locations. diff --git a/cran-comments.md b/cran-comments.md deleted file mode 100644 index e69de29b..00000000 diff --git a/inst/install-github.R b/inst/install-github.R index d48ab4db..78755f10 100644 --- a/inst/install-github.R +++ b/inst/install-github.R @@ -75,6 +75,7 @@ function(...) { #' * 2020-03-22 get_matching_bioc_version() is now correct if the current #' R version is not in the builtin mapping. #' * 2020-11-21 Update internal map for 3.12. + #' * 2023-05-08 Add 'books' repo. #' #' @name bioconductor #' @keywords internal @@ -87,7 +88,12 @@ function(...) { # ------------------------------------------------------------------- # Configuration that does not change often - config_url <- "https://bioconductor.org/config.yaml" + config_url <- function() { + Sys.getenv( + "R_BIOC_CONFIG_URL", + "https://bioconductor.org/config.yaml" + ) + } builtin_map <- list( "2.1" = package_version("1.6"), @@ -113,7 +119,10 @@ function(...) { "3.5" = package_version("3.8"), "3.6" = package_version("3.10"), "4.0" = package_version("3.12"), - "4.1" = package_version("3.14") + "4.1" = package_version("3.14"), + "4.2" = package_version("3.16"), + "4.3" = package_version("3.17"), + "4.4" = package_version("3.18") ) # ------------------------------------------------------------------- @@ -124,14 +133,21 @@ function(...) { version_map <- NULL yaml_config <- NULL + clear_cache <- function() { + devel_version <<- NULL + release_version <<- NULL + version_map <<- NULL + yaml_config <<- NULL + } + # ------------------------------------------------------------------- # API get_yaml_config <- function(forget = FALSE) { if (forget || is.null(yaml_config)) { - new <- tryCatch(read_url(config_url), error = function(x) x) + new <- tryCatch(read_url(config_url()), error = function(x) x) if (inherits(new, "error")) { - http_url <- sub("^https", "http", config_url) + http_url <- sub("^https", "http", config_url()) new <- tryCatch(read_url(http_url), error = function(x) x) } if (inherits(new, "error")) stop(new) @@ -265,7 +281,7 @@ function(...) { if (bioc_version >= "3.7") "{mirror}/packages/{bv}/workflows", BioCextra = if (bioc_version <= "3.5") "{mirror}/packages/{bv}/extra", - BioCbooks = + BioCbooks = if (bioc_version >= "3.12") "{mirror}/packages/{bv}/books" ) @@ -5594,7 +5610,7 @@ function(...) { load_pkg_description <- function(path) { - path <- normalizePath(path) + path <- normalizePath(path, mustWork = TRUE) if (!is_dir(path)) { dir <- tempfile() @@ -5730,6 +5746,13 @@ function(...) { params } + # Contents of R/remotes-package.R + #' @keywords internal + "_PACKAGE" + + ## usethis namespace: start + ## usethis namespace: end + NULL # Contents of R/submodule.R parse_submodules <- function(file) { if (grepl("\n", file)) { @@ -5900,7 +5923,7 @@ function(...) { } # Contents of R/system_requirements.R DEFAULT_RSPM_REPO_ID <- "1" # cran - DEFAULT_RSPM <- "https://packagemanager.rstudio.com" + DEFAULT_RSPM <- "https://packagemanager.posit.co" #' Query the system requirements for a package (and its dependencies) #' @@ -5949,6 +5972,7 @@ function(...) { curl, args = c( "--silent", + "-L", shQuote(sprintf("%s/sysreqs?all=false&pkgname=%s&distribution=%s&release=%s", rspm_repo_url, paste(package, collapse = "&pkgname="), @@ -5973,6 +5997,7 @@ function(...) { curl, args = c( "--silent", + "-L", "--data-binary", shQuote(paste0("@", desc_file)), shQuote(sprintf("%s/sysreqs?distribution=%s&release=%s&suggests=true", diff --git a/install-github.R b/install-github.R index d48ab4db..78755f10 100644 --- a/install-github.R +++ b/install-github.R @@ -75,6 +75,7 @@ function(...) { #' * 2020-03-22 get_matching_bioc_version() is now correct if the current #' R version is not in the builtin mapping. #' * 2020-11-21 Update internal map for 3.12. + #' * 2023-05-08 Add 'books' repo. #' #' @name bioconductor #' @keywords internal @@ -87,7 +88,12 @@ function(...) { # ------------------------------------------------------------------- # Configuration that does not change often - config_url <- "https://bioconductor.org/config.yaml" + config_url <- function() { + Sys.getenv( + "R_BIOC_CONFIG_URL", + "https://bioconductor.org/config.yaml" + ) + } builtin_map <- list( "2.1" = package_version("1.6"), @@ -113,7 +119,10 @@ function(...) { "3.5" = package_version("3.8"), "3.6" = package_version("3.10"), "4.0" = package_version("3.12"), - "4.1" = package_version("3.14") + "4.1" = package_version("3.14"), + "4.2" = package_version("3.16"), + "4.3" = package_version("3.17"), + "4.4" = package_version("3.18") ) # ------------------------------------------------------------------- @@ -124,14 +133,21 @@ function(...) { version_map <- NULL yaml_config <- NULL + clear_cache <- function() { + devel_version <<- NULL + release_version <<- NULL + version_map <<- NULL + yaml_config <<- NULL + } + # ------------------------------------------------------------------- # API get_yaml_config <- function(forget = FALSE) { if (forget || is.null(yaml_config)) { - new <- tryCatch(read_url(config_url), error = function(x) x) + new <- tryCatch(read_url(config_url()), error = function(x) x) if (inherits(new, "error")) { - http_url <- sub("^https", "http", config_url) + http_url <- sub("^https", "http", config_url()) new <- tryCatch(read_url(http_url), error = function(x) x) } if (inherits(new, "error")) stop(new) @@ -265,7 +281,7 @@ function(...) { if (bioc_version >= "3.7") "{mirror}/packages/{bv}/workflows", BioCextra = if (bioc_version <= "3.5") "{mirror}/packages/{bv}/extra", - BioCbooks = + BioCbooks = if (bioc_version >= "3.12") "{mirror}/packages/{bv}/books" ) @@ -5594,7 +5610,7 @@ function(...) { load_pkg_description <- function(path) { - path <- normalizePath(path) + path <- normalizePath(path, mustWork = TRUE) if (!is_dir(path)) { dir <- tempfile() @@ -5730,6 +5746,13 @@ function(...) { params } + # Contents of R/remotes-package.R + #' @keywords internal + "_PACKAGE" + + ## usethis namespace: start + ## usethis namespace: end + NULL # Contents of R/submodule.R parse_submodules <- function(file) { if (grepl("\n", file)) { @@ -5900,7 +5923,7 @@ function(...) { } # Contents of R/system_requirements.R DEFAULT_RSPM_REPO_ID <- "1" # cran - DEFAULT_RSPM <- "https://packagemanager.rstudio.com" + DEFAULT_RSPM <- "https://packagemanager.posit.co" #' Query the system requirements for a package (and its dependencies) #' @@ -5949,6 +5972,7 @@ function(...) { curl, args = c( "--silent", + "-L", shQuote(sprintf("%s/sysreqs?all=false&pkgname=%s&distribution=%s&release=%s", rspm_repo_url, paste(package, collapse = "&pkgname="), @@ -5973,6 +5997,7 @@ function(...) { curl, args = c( "--silent", + "-L", "--data-binary", shQuote(paste0("@", desc_file)), shQuote(sprintf("%s/sysreqs?distribution=%s&release=%s&suggests=true", diff --git a/man/remotes-package.Rd b/man/remotes-package.Rd new file mode 100644 index 00000000..61862597 --- /dev/null +++ b/man/remotes-package.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/remotes-package.R +\docType{package} +\name{remotes-package} +\alias{remotes} +\alias{remotes-package} +\title{remotes: R Package Installation from Remote Repositories, Including 'GitHub'} +\description{ +Download and install R packages stored in 'GitHub', 'GitLab', 'Bitbucket', 'Bioconductor', or plain 'subversion' or 'git' repositories. This package provides the 'install_*' functions in 'devtools'. Indeed most of the code was copied over from 'devtools'. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://remotes.r-lib.org} + \item \url{https://github.com/r-lib/remotes#readme} + \item Report bugs at \url{https://github.com/r-lib/remotes/issues} +} + +} +\author{ +\strong{Maintainer}: Gábor Csárdi \email{csardi.gabor@gmail.com} + +Authors: +\itemize{ + \item Jim Hester + \item Hadley Wickham + \item Winston Chang + \item Martin Morgan + \item Dan Tenenbaum +} + +Other contributors: +\itemize{ + \item Posit Software, PBC [copyright holder, funder] + \item Mango Solutions [copyright holder] +} + +} +\keyword{internal} diff --git a/tests/testthat.R b/tests/testthat.R index 40366008..081cccc3 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,3 +1,11 @@ +# This file is part of the standard setup for testthat. +# It is recommended that you do not modify it. +# +# Where should you do additional test configuration? +# Learn more about the roles of various files in: +# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview +# * https://testthat.r-lib.org/articles/special-files.html + library(testthat) library(remotes) diff --git a/tests/testthat/_snaps/github.md b/tests/testthat/_snaps/github.md new file mode 100644 index 00000000..92ef6c14 --- /dev/null +++ b/tests/testthat/_snaps/github.md @@ -0,0 +1,14 @@ +# github_error + + Code + conditionMessage(err) + Output + [1] "HTTP error 304.\n foobar\n\n Rate limit remaining: 0/5000\n Rate limit reset at: 2018-10-19 15:16:18 UTC\n\n To increase your GitHub API rate limit\n - Use `usethis::create_github_token()` to create a Personal Access Token.\n - Use `gitcreds::gitcreds_set()` to add the token." + +--- + + Code + conditionMessage(err) + Output + [1] "HTTP error 304.\n foobar\n\n Rate limit remaining: 0/5000\n Rate limit reset at: 2018-10-19 15:16:18 UTC\n\n To increase your GitHub API rate limit\n - Use `usethis::create_github_token()` to create a Personal Access Token.\n - Add `GITHUB_PAT` to your travis settings as an encrypted variable." + diff --git a/tests/testthat/github-error-local.txt b/tests/testthat/github-error-local.txt deleted file mode 100644 index fa8ccc97..00000000 --- a/tests/testthat/github-error-local.txt +++ /dev/null @@ -1 +0,0 @@ -[1] "HTTP error 304.\n foobar\n\n Rate limit remaining: 0/5000\n Rate limit reset at: 2018-10-19 15:16:18 UTC\n\n To increase your GitHub API rate limit\n - Use `usethis::create_github_token()` to create a Personal Access Token.\n - Use `gitcreds::gitcreds_set()` to add the token." diff --git a/tests/testthat/github-error-travis.txt b/tests/testthat/github-error-travis.txt deleted file mode 100644 index 63a30c78..00000000 --- a/tests/testthat/github-error-travis.txt +++ /dev/null @@ -1 +0,0 @@ -[1] "HTTP error 304.\n foobar\n\n Rate limit remaining: 0/5000\n Rate limit reset at: 2018-10-19 15:16:18 UTC\n\n To increase your GitHub API rate limit\n - Use `usethis::create_github_token()` to create a Personal Access Token.\n - Add `GITHUB_PAT` to your travis settings as an encrypted variable." diff --git a/tests/testthat/test-bioc.R b/tests/testthat/test-bioc.R index 0fdcfaf7..05bcd5f7 100644 --- a/tests/testthat/test-bioc.R +++ b/tests/testthat/test-bioc.R @@ -1,6 +1,3 @@ - -context("BioConductor packages") - test_that("bioc is standalone", { ## baseenv() makes sure that the remotes package env is not used env <- new.env(parent = baseenv()) @@ -39,7 +36,7 @@ test_that("internal map is current", { skip_if_offline() expect_equal( bioconductor$get_release_version(), - package_version("3.14")) + package_version("3.18")) }) test_that("set of repos are correct", { diff --git a/tests/testthat/test-cran.R b/tests/testthat/test-cran.R index cd384d87..909b083b 100644 --- a/tests/testthat/test-cran.R +++ b/tests/testthat/test-cran.R @@ -1,6 +1,3 @@ - -context("CRAN") - test_that("available_packages", { skip_on_cran() diff --git a/tests/testthat/test-dcf.R b/tests/testthat/test-dcf.R index 90234534..7cd2e916 100644 --- a/tests/testthat/test-dcf.R +++ b/tests/testthat/test-dcf.R @@ -1,6 +1,3 @@ - -context("DCF files") - test_that("read_dcf and write_dcf", { DESC <- "Package: foobar diff --git a/tests/testthat/test-decompress.R b/tests/testthat/test-decompress.R index 252f3827..36acae8c 100644 --- a/tests/testthat/test-decompress.R +++ b/tests/testthat/test-decompress.R @@ -1,6 +1,3 @@ - -context("Decompress") - test_that("decompress various file types", { types <- c("zip", "tar", "tar.gz", "tgz") diff --git a/tests/testthat/test-deps.R b/tests/testthat/test-deps.R index 62c1a6ad..0db1c856 100644 --- a/tests/testthat/test-deps.R +++ b/tests/testthat/test-deps.R @@ -1,6 +1,3 @@ - -context("Deps") - test_that("standardise_dep", { expect_equal( @@ -66,7 +63,7 @@ test_that("extra_deps", { expect_equal(res$package, c("testthat", "roxygen2")) - # There are the shas for the v2.0.0 and v6.0.1 tags respectivly + # There are the shas for the v2.0.0 and v6.0.1 tags respectively expect_equal( res$available, c("b0c0d5dcd78c5f97790c4b6ddb5babbce4c63a9d", @@ -268,8 +265,6 @@ test_that("update.package_deps 3", { ) }) -context("Remotes") - test_that("extra_deps returns an empty data frame if no remotes specified", { pkg <- list( @@ -531,11 +526,11 @@ test_that("dev_package_deps works with package using remotes", { is_falsy <- "falsy" == res$package expect_true(any(is_falsy)) - expect_is(res$remote[is_falsy][[1]], "github_remote") + expect_s3_class(res$remote[is_falsy][[1]], "github_remote") is_testthat <- "testthat" == res$package expect_true(any(is_testthat)) - expect_is(res$remote[is_testthat][[1]], "cran_remote") + expect_s3_class(res$remote[is_testthat][[1]], "cran_remote") }) test_that("dev_package_deps can retrieve custom fields", { @@ -546,13 +541,13 @@ test_that("dev_package_deps can retrieve custom fields", { is_pkgdown <- "pkgdown" == res$package expect_true(any(is_pkgdown)) - expect_is(res$remote[is_pkgdown][[1]], "github_remote") + expect_s3_class(res$remote[is_pkgdown][[1]], "github_remote") res <- dev_package_deps(test_path("withremotes"), dependencies = "Config/Needs/coverage") is_covr <- "covr" == res$package expect_true(any(is_covr)) - expect_is(res$remote[is_covr][[1]], "cran_remote") + expect_s3_class(res$remote[is_covr][[1]], "cran_remote") }) test_that("dev_package_deps works with url remotes", { diff --git a/tests/testthat/test-devel.R b/tests/testthat/test-devel.R index ffa8031d..18bb5da6 100644 --- a/tests/testthat/test-devel.R +++ b/tests/testthat/test-devel.R @@ -1,5 +1,3 @@ -context("devel") - test_that("has_devel", { # All platforms when tests are run should have a compiler expect_true(has_devel()) diff --git a/tests/testthat/test-download.R b/tests/testthat/test-download.R index 546388c3..8fcb4640 100644 --- a/tests/testthat/test-download.R +++ b/tests/testthat/test-download.R @@ -1,6 +1,3 @@ - -context("Download") - test_that("download_method", { mockery::stub(download_method, "get_r_version", "3.3.0") diff --git a/tests/testthat/test-git.R b/tests/testthat/test-git.R index e7c35ce7..98992c3a 100644 --- a/tests/testthat/test-git.R +++ b/tests/testthat/test-git.R @@ -1,6 +1,3 @@ - -context("Git") - test_that("git_extract_sha1_tar", { skip_on_cran() diff --git a/tests/testthat/test-github.R b/tests/testthat/test-github.R index 970cf9de..b0c916af 100644 --- a/tests/testthat/test-github.R +++ b/tests/testthat/test-github.R @@ -1,6 +1,3 @@ - -context("GitHub") - test_that("github_pat", { withr::local_envvar(c(GITHUB_PAT="badcafe")) @@ -90,13 +87,13 @@ test_that("github_error", { # Test without the TRAVIS envvar set withr::with_envvar(c(TRAVIS = NA), { err <- github_error(list(headers = "", status_code = "304", content = charToRaw('{"message": "foobar"}'))) - expect_known_output(conditionMessage(err), test_path("github-error-local.txt"), print = TRUE) + expect_snapshot(conditionMessage(err)) }) # Test with the TRAVIS envvar set withr::with_envvar(c(TRAVIS = "true"), { err <- github_error(list(headers = "", status_code = "304", content = charToRaw('{"message": "foobar"}'))) - expect_known_output(conditionMessage(err), test_path("github-error-travis.txt"), print = TRUE) + expect_snapshot(conditionMessage(err)) }) }) diff --git a/tests/testthat/test-install-bioc.R b/tests/testthat/test-install-bioc.R index a7bb54e2..01127132 100644 --- a/tests/testthat/test-install-bioc.R +++ b/tests/testthat/test-install-bioc.R @@ -1,5 +1,3 @@ -context("install_bioc.R") - test_that("bioc repo paths are parsed correctly", { expect_equal(parse_bioc_repo("devtools"), list(repo="devtools")) expect_equal(parse_bioc_repo("devtools#abc123"), list(repo="devtools", commit="abc123")) diff --git a/tests/testthat/test-install-bitbucket.R b/tests/testthat/test-install-bitbucket.R index d2cbff68..01b2d1a4 100644 --- a/tests/testthat/test-install-bitbucket.R +++ b/tests/testthat/test-install-bitbucket.R @@ -1,6 +1,3 @@ - -context("Install from Bitbucket") - test_that("", { skip_on_cran() diff --git a/tests/testthat/test-install-cran.R b/tests/testthat/test-install-cran.R index 95d92d03..7282fa1f 100644 --- a/tests/testthat/test-install-cran.R +++ b/tests/testthat/test-install-cran.R @@ -1,5 +1,3 @@ -context("Installing from CRAN") - test_that("", { skip_on_cran() diff --git a/tests/testthat/test-install-deps.R b/tests/testthat/test-install-deps.R index 64c1bbeb..bad16b25 100644 --- a/tests/testthat/test-install-deps.R +++ b/tests/testthat/test-install-deps.R @@ -1,6 +1,3 @@ - -context("Installing package dependencies") - test_that("installing packages with dependencies", { skip_on_cran() diff --git a/tests/testthat/test-install-dev.R b/tests/testthat/test-install-dev.R index b9d0b9f2..4ca4eba9 100644 --- a/tests/testthat/test-install-dev.R +++ b/tests/testthat/test-install-dev.R @@ -1,5 +1,3 @@ -context("test-install-dev") - test_that("install_dev works with GitHub URLs", { skip_on_cran() skip_if_offline() @@ -41,15 +39,6 @@ test_that("install_dev fails if there is no URL field with a GitHub, GitLab or B expect_error(install_dev("XML"), "Could not determine development repository") }) -test_that("install_dev works with GitLab URLs", { - skip_on_cran() - skip_if_offline() - - mockery::stub(install_dev, "install_gitlab", identity) - - expect_equal(install_dev("iemiscdata"), "iembry/iemiscdata") -}) - test_that("install_dev works with Bitbucket URLs", { skip_on_cran() skip_if_offline() diff --git a/tests/testthat/test-install-git.R b/tests/testthat/test-install-git.R index 11e9fda6..71116f47 100644 --- a/tests/testthat/test-install-git.R +++ b/tests/testthat/test-install-git.R @@ -1,6 +1,3 @@ - -context("Install from git repo") - test_that("install_git with git2r", { skip_on_cran() @@ -32,66 +29,6 @@ test_that("install_git with git2r", { expect_true(!is.na(remote$sha) && nzchar(remote$sha)) }) -test_that("install_git with git2r and ref", { - - skip_on_cran() - skip_if_offline() - skip_if_over_rate_limit() - skip_if_not_installed("git2r") - - Sys.unsetenv("R_TESTS") - - lib <- tempfile() - on.exit(unlink(lib, recursive = TRUE), add = TRUE) - dir.create(lib) - - url <- "https://github.com/gaborcsardi/pkgconfig.git" - install_git(url, lib = lib, ref = "travis", git = "git2r", quiet = TRUE) - - expect_silent(packageDescription("pkgconfig", lib.loc = lib)) - expect_equal( - packageDescription("pkgconfig", lib.loc = lib)$RemoteUrl, - url - ) - - remote <- package2remote("pkgconfig", lib = lib) - expect_s3_class(remote, "remote") - expect_s3_class(remote, "git2r_remote") - expect_equal(format(remote), "Git") - expect_equal(remote$url, url) - expect_equal(remote$ref, "travis") - expect_equal(remote_sha(remote), remote$sha) - expect_true(!is.na(remote$sha) && nzchar(remote$sha)) -}) - - -test_that("install_git with command line git", { - - skip_on_cran() - skip_if_offline() - if (is.null(git_path())) skip("git is not installed") - - Sys.unsetenv("R_TESTS") - - lib <- tempfile() - on.exit(unlink(lib, recursive = TRUE), add = TRUE) - dir.create(lib) - - url <- "https://github.com/cran/falsy.git" - install_git(url, git = "external", lib = lib, quiet = TRUE) - - expect_silent(packageDescription("falsy", lib.loc = lib)) - expect_equal(packageDescription("falsy", lib.loc = lib)$RemoteUrl, url) - - remote <- package2remote("falsy", lib = lib) - expect_s3_class(remote, "remote") - expect_s3_class(remote, "xgit_remote") - expect_equal(format(remote), "Git") - expect_equal(remote$url, url) - expect_equal(remote$ref, NULL) - expect_true(!is.na(remote$sha) && nzchar(remote$sha)) -}) - test_that("install_git with command line git and tag ref", { skip_on_cran() @@ -203,7 +140,7 @@ test_that("remote_package_name.git2r_remote returns the package name if it exist expect_equal(remote_package_name(remote), "igraph") # works with tags in URL (and different name from repo name) - url <- "https://github.com/igraph/rigraph.git@master" + url <- "https://github.com/igraph/rigraph.git@main" remote <- git_remote(url, git = "git2r") expect_equal(remote_package_name(remote), "igraph") @@ -211,17 +148,6 @@ test_that("remote_package_name.git2r_remote returns the package name if it exist url <- "https://gitlab.com/r-lib-grp/test-pkg.git" remote <- git_remote(url, git = "git2r") expect_equal(remote_package_name(remote), "test123") - - # safely returns NA when DESCRIPTION url is not accessible - # (condition emitted due to inaccessible git remote for remote_sha during testing) - url <- "https://gitlab.com/r-lib-grp/fake-private-repo.git" - remote <- git_remote(url, git = "git2r") - err <- tryCatch(remote_sha(remote), error = function(e) e) - expect_error( # expect same error as calling remote_sha directly - expect_equal(remote_package_name(remote), NA_character_), - class = class(err), - label = conditionMessage(err) - ) }) test_that("remote_package_name.xgit_remote returns the package name if it exists", { @@ -241,28 +167,11 @@ test_that("remote_package_name.xgit_remote returns the package name if it exists expect_equal(remote_package_name(remote), "igraph") # works with tags in URL (and different name from repo name) - url <- "https://github.com/igraph/rigraph.git@master" + url <- "https://github.com/igraph/rigraph.git@main" remote <- git_remote(url, git = "external") expect_equal(remote_package_name(remote), "igraph") }) -test_that("remote_sha.xgit remote returns the SHA if it exists", { - - skip_on_cran() - skip_if_offline() - if (is.null(git_path())) skip("git is not installed") - - url <- "https://github.com/cran/falsy.git" - - # works with tags - remote <- git_remote(url, ref = "1.0", git = "external") - expect_equal(remote_sha(remote), "0f39d9eb735bf16909831c0bb129063dda388375") - - # works with full SHAs - remote <- git_remote(url, ref = "26a36cf957a18569e311ef75b6f61f822de945ef", git = "external") - expect_equal(remote_sha(remote), "26a36cf957a18569e311ef75b6f61f822de945ef") -}) - test_that("remote_metadata.xgit_remote", { r <- remote_metadata.xgit_remote( diff --git a/tests/testthat/test-install-github.R b/tests/testthat/test-install-github.R index c14f10a2..65e937f2 100644 --- a/tests/testthat/test-install-github.R +++ b/tests/testthat/test-install-github.R @@ -1,6 +1,3 @@ - -context("Install from GitHub") - test_that("github_resolve_ref.github_release", { skip_on_cran() diff --git a/tests/testthat/test-install-gitlab.R b/tests/testthat/test-install-gitlab.R index 661cd821..a5f66e3d 100644 --- a/tests/testthat/test-install-gitlab.R +++ b/tests/testthat/test-install-gitlab.R @@ -1,5 +1,3 @@ -context("Install from GitLab") - test_that("install_gitlab", { skip_on_cran() @@ -117,18 +115,6 @@ test_that("remote_sha.gitlab_remote", { "0f39d9eb735bf16909831c0bb129063dda388375" ) - expect_equal( - remote_sha( - remote("gitlab", - host = "https://gitlab.com", - username = "drgola", - repo = "r_pkg_test", - ref = "feature/foo_mult" - ) - ), - "58376e96e9b42baece2ab7c0414db6064740c6b6" - ) - }) test_that("gitlab_project_id", { diff --git a/tests/testthat/test-install-local.R b/tests/testthat/test-install-local.R index 06c5f658..cfd1d675 100644 --- a/tests/testthat/test-install-local.R +++ b/tests/testthat/test-install-local.R @@ -1,6 +1,3 @@ - -context("Installing from local files") - test_that("install_local", { skip_on_cran() diff --git a/tests/testthat/test-install-remote.R b/tests/testthat/test-install-remote.R index 8f3d609d..323f8fa6 100644 --- a/tests/testthat/test-install-remote.R +++ b/tests/testthat/test-install-remote.R @@ -1,5 +1,3 @@ -context("install-remotes.R") - test_that("different_sha returns TRUE if remote or local sha is NA not found", { expect_true(different_sha(remote_sha = NA, local_sha = "4a2ea2")) expect_true(different_sha(remote_sha = "4a2ea2", local_sha = NA)) diff --git a/tests/testthat/test-install-svn.R b/tests/testthat/test-install-svn.R index 63d447de..099bce5b 100644 --- a/tests/testthat/test-install-svn.R +++ b/tests/testthat/test-install-svn.R @@ -1,6 +1,3 @@ - -context("Install from SVN repositories") - test_that("install_svn", { skip_on_cran() diff --git a/tests/testthat/test-install-url.R b/tests/testthat/test-install-url.R index 21899f71..178c8d58 100644 --- a/tests/testthat/test-install-url.R +++ b/tests/testthat/test-install-url.R @@ -1,6 +1,3 @@ - -context("Installing from URLs") - test_that("install_url", { skip_on_cran() diff --git a/tests/testthat/test-install-version.R b/tests/testthat/test-install-version.R index 70db092d..3a562a14 100644 --- a/tests/testthat/test-install-version.R +++ b/tests/testthat/test-install-version.R @@ -1,6 +1,3 @@ - -context("Install a specific version from CRAN") - test_that("install_version", { skip_on_cran() skip_if_offline() @@ -240,12 +237,12 @@ test_that("version requirement comparisons", { data.frame(compare = "==", version = "1.5", stringsAsFactors = FALSE) ) - expect_equivalent( + expect_equal( version_criteria(NULL), data.frame(compare = NA_character_, version = NA_character_, stringsAsFactors = FALSE) ) - expect_equivalent( + expect_equal( version_criteria(NA), data.frame(compare = NA_character_, version = NA_character_, stringsAsFactors = FALSE) ) diff --git a/tests/testthat/test-install.R b/tests/testthat/test-install.R index 81e9f6d7..7edd9a7d 100644 --- a/tests/testthat/test-install.R +++ b/tests/testthat/test-install.R @@ -1,5 +1,3 @@ -context("install") - test_that("safe_build_package works with pkgbuild", { out <- tempfile() dir.create(out) diff --git a/tests/testthat/test-json.R b/tests/testthat/test-json.R index 3ebf29a8..ae7ca799 100644 --- a/tests/testthat/test-json.R +++ b/tests/testthat/test-json.R @@ -1,6 +1,3 @@ - -context("JSON parser") - test_that("JSON is standalone", { ## baseenv() makes sure that the remotes package env is not used env <- new.env(parent = baseenv()) diff --git a/tests/testthat/test-package-deps.R b/tests/testthat/test-package-deps.R index 868e154d..c8e10c2d 100644 --- a/tests/testthat/test-package-deps.R +++ b/tests/testthat/test-package-deps.R @@ -1,6 +1,3 @@ - -context("Package dependencies") - test_that("parse_deps", { expect_null(parse_deps(NULL)) expect_null(parse_deps("")) diff --git a/tests/testthat/test-package.R b/tests/testthat/test-package.R index e4231d07..8685b31a 100644 --- a/tests/testthat/test-package.R +++ b/tests/testthat/test-package.R @@ -1,5 +1,3 @@ -context("package") - test_that("load_pkg_description", { pkg <- load_pkg_description("noremotes") expect_equal(pkg$package, "noremotes") diff --git a/tests/testthat/test-parse-git.R b/tests/testthat/test-parse-git.R index 3bce2f22..f29bed61 100644 --- a/tests/testthat/test-parse-git.R +++ b/tests/testthat/test-parse-git.R @@ -1,5 +1,3 @@ -context("Parse git repo") - test_that("pull request and latest release, via spec and URL", { expect_equal( diff --git a/tests/testthat/test-script.R b/tests/testthat/test-script.R index abfc0646..16180061 100644 --- a/tests/testthat/test-script.R +++ b/tests/testthat/test-script.R @@ -1,6 +1,3 @@ - -context("install-github.R script") - test_that("install-github.R script is up to date", { skip_if(covr::in_covr()) skip_on_cran() diff --git a/tests/testthat/test-submodule.R b/tests/testthat/test-submodule.R index 1fdb5af5..082b884a 100644 --- a/tests/testthat/test-submodule.R +++ b/tests/testthat/test-submodule.R @@ -1,5 +1,3 @@ -context("submodule.R") - test_that("parse_submodules works with a single submodule", { x <- '[submodule "foobar"] diff --git a/tests/testthat/test-system.R b/tests/testthat/test-system.R index 11fcae4b..46cfa45a 100644 --- a/tests/testthat/test-system.R +++ b/tests/testthat/test-system.R @@ -1,6 +1,3 @@ - -context("System commands") - test_that("system_check", { mockery::stub(system_check, "system2", structure("output", status = 1)) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index 6c4fab93..033cf135 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -1,6 +1,3 @@ - -context("Utilities") - test_that("%||%", { expect_equal(NULL %||% "foo", "foo") expect_equal("foo" %||% "bar", "foo") diff --git a/vignettes/dependencies.Rmd b/vignettes/dependencies.Rmd index 96df29cc..49ded97c 100644 --- a/vignettes/dependencies.Rmd +++ b/vignettes/dependencies.Rmd @@ -15,7 +15,7 @@ vignette: > Remotes, just like devtools, supports package dependency installation for packages not yet in a standard package repository such as [CRAN](https://cran.r-project.org) -or [Bioconductor](http://bioconductor.org). +or [Bioconductor](https://bioconductor.org). You can mark any regular dependency defined in the `Depends`, `Imports`, `Suggests` or `Enhances` fields as being installed from a remote location by