Skip to content

Commit

Permalink
Merge branch 'main' into fix/optional-test-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborcsardi committed Mar 22, 2024
2 parents 4fe0c4b + 9a61008 commit dffb548
Show file tree
Hide file tree
Showing 27 changed files with 207 additions and 147 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@
^vignettes$
^man/_cache$
^README_cache$
^LICENSE\.md$
2 changes: 1 addition & 1 deletion .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ 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@rstudio.com.
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
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,27 @@ 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-20.04, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-20.04, r: 'release'}
- {os: ubuntu-20.04, r: 'oldrel-1'}
- {os: ubuntu-20.04, r: 'oldrel-2'}
- {os: ubuntu-20.04, r: 'oldrel-3'}
- {os: ubuntu-20.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@v2

Expand All @@ -53,9 +54,8 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck, r-lib/[email protected]
extra-packages: any::rcmdcheck
needs: check
pak-version: rc

- uses: r-lib/actions/check-r-package@v2
with:
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/html-5-check.yaml

This file was deleted.

10 changes: 6 additions & 4 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ jobs:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_CLI_NUM_COLORS: 256
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -32,19 +35,18 @@ jobs:
with:
extra-packages: any::pkgdown, local::.
needs: website
pak-version: rc

- name: Build site
run: |
rmarkdown::render("README.Rmd")
pkgdown::build_site_github_pages(new_process = TRUE, install = FALSE)
pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}
env:
IN_PKGDOWN: true

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected].4
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
clean: false
branch: gh-pages
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/pr-fetch@v2
with:
Expand All @@ -28,7 +28,6 @@ jobs:
with:
extra-packages: any::roxygen2
needs: pr-document
pak-version: rc

- name: Document
run: roxygen2::roxygenise()
Expand All @@ -52,7 +51,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/pr-fetch@v2
with:
Expand Down
24 changes: 21 additions & 3 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
Expand All @@ -25,8 +25,26 @@ jobs:
with:
extra-packages: any::covr
needs: coverage
pak-version: rc

- name: Test coverage
run: covr::codecov(quiet = FALSE)
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
25 changes: 13 additions & 12 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
Package: callr
Title: Call R from R
Version: 3.7.3.9000
Version: 3.7.5.9000
Authors@R: c(
person("Gábor", "Csárdi", , "[email protected]", role = c("aut", "cre", "cph"),
comment = c(ORCID = "0000-0001-7098-9676")),
person("Winston", "Chang", role = "aut"),
person("RStudio", role = c("cph", "fnd")),
person("Mango Solutions", role = c("cph", "fnd"))
person("Posit Software, PBC", role = c("cph", "fnd")),
person("Ascent Digital Services", role = c("cph", "fnd"))
)
Description: It is sometimes useful to perform a computation in a separate
R process, without affecting the current R process at all. This
packages does exactly that.
License: MIT + file LICENSE
URL: https://callr.r-lib.org, https://github.com/r-lib/callr#readme
URL: https://callr.r-lib.org, https://github.com/r-lib/callr
BugReports: https://github.com/r-lib/callr/issues
Depends: R (>= 3.4)
Depends:
R (>= 3.4)
Imports:
processx (>= 3.6.1),
R6,
utils
Suggests:
asciicast,
asciicast (>= 2.3.1),
cli (>= 1.1.0),
mockery,
ps,
rprojroot,
spelling,
testthat (>= 3.0.0),
testthat (>= 3.2.0),
withr (>= 2.3.0)
Encoding: UTF-8
Language: en-US
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.1.9000
Config/testthat/edition: 3
Config/Needs/website:
r-lib/asciicast,
glue,
htmlwidgets,
igraph,
tibble,
tidyverse/tidytemplate
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-US
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2016
COPYRIGHT HOLDER: Mango Solutions, RStudio
YEAR: 2024
COPYRIGHT HOLDER: see COPYRIGHTS file
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2023 callr authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
10 changes: 10 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# callr (development version)

# callr 3.7.5

* No changes.

# callr 3.7.4

* The `r_session$get_running_time()` method now returns the correct
values, as documented (#241, @djnavarro).

* callr now uses fully qualified function calls in the subprocess to
avoid interference with functions defined in the global environment.
I.e. `base::stderr()` instead of `stderr()`. Closes #246.

# callr 3.7.3

* Errors from callr now include the standard output (in `$stdout`) and
Expand Down
2 changes: 2 additions & 0 deletions R/eval-bg.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#'
#' Starts evaluating an R function call in a background R process, and
#' returns immediately.
#' Use `p$get_result()` to collect the result or to throw an error
#' if the background computation failed.
#'
#' @inheritSection r Security considerations
#' @inheritParams r
Expand Down
19 changes: 16 additions & 3 deletions R/load-client.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ load_client_lib <- function(sofile = NULL, pxdir = NULL) {
stop("Cannot find client file")
}

# We set this to `FALSE` if we load the library from the processx
# install path since that library might be shared (e.g. in tests)
need_cleanup <- TRUE

if (is.null(sofile)) {
sofile <- sofile_in_processx()
lib <- dyn.load(sofile)
need_cleanup <- FALSE
} else {
# This is the usual case, first we try loading it from the
# temporary directory. If that fails (e.g. noexec), then
Expand All @@ -35,7 +40,10 @@ load_client_lib <- function(sofile = NULL, pxdir = NULL) {
if (inherits(lib, "error")) {
sofile <- sofile_in_processx()
tryCatch(
lib <- dyn.load(sofile),
expr = {
lib <- dyn.load(sofile)
need_cleanup <- FALSE
},
error = function(err2) {
err2$message <- err2$message <- paste0(" after ", lib$message)
stop(err2)
Expand All @@ -45,7 +53,9 @@ load_client_lib <- function(sofile = NULL, pxdir = NULL) {
}

# cleanup if setup fails
on.exit(try(dyn.unload(sofile), silent = TRUE), add = TRUE)
if (need_cleanup) {
on.exit(try(dyn.unload(sofile), silent = TRUE), add = TRUE)
}

sym_encode <- getNativeSymbolInfo("processx_base64_encode", lib)
sym_decode <- getNativeSymbolInfo("processx_base64_decode", lib)
Expand All @@ -58,6 +68,7 @@ load_client_lib <- function(sofile = NULL, pxdir = NULL) {

env <- new.env(parent = emptyenv())
env$.path <- sofile
env$.lib <- lib

mycall <- .Call

Expand Down Expand Up @@ -100,7 +111,9 @@ load_client_lib <- function(sofile = NULL, pxdir = NULL) {
}

env$.finalize <- function() {
dyn.unload(env$.path)
if (need_cleanup) {
dyn.unload(env$.path)
}
rm(list = ls(env, all.names = TRUE), envir = env)
}

Expand Down
Loading

0 comments on commit dffb548

Please sign in to comment.