Skip to content

Commit c9342e4

Browse files
Merge branch 'release/0.17.0'
2 parents ac1d840 + fd22090 commit c9342e4

File tree

94 files changed

+938
-1311
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+938
-1311
lines changed

.github/workflows/revdepcheck-top.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- { r: "release", pkg: "SimDesign" }
3131
# - { r: "release", pkg: "tidySEM" } ## fails to install
3232
- { r: "release", pkg: "tsdistributions" }
33-
- { r: "release", pkg: "tsgarch" }
33+
- { r: "release", pkg: "tsgarch", sysdeps: "libcairo2-dev" }
3434

3535
env:
3636
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
@@ -50,7 +50,7 @@ jobs:
5050

5151
- name: Install system dependencies (Linux)
5252
if: runner.os == 'Linux'
53-
run: sudo apt-get install -y tidy
53+
run: sudo apt-get install -y tidy ${{ matrix.config.sysdeps }}
5454

5555
- uses: r-lib/actions/setup-r@v2
5656
with:

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: progressr
2-
Version: 0.16.0
2+
Version: 0.17.0
33
Title: An Inclusive, Unifying API for Progress Updates
44
Description: A minimal, unifying API for scripts and packages to report progress updates from anywhere including when using parallel processing. The package is designed such that the developer can to focus on what progress should be reported on without having to worry about how to present it. The end user has full control of how, where, and when to render these progress updates, e.g. in the terminal using utils::txtProgressBar(), cli::cli_progress_bar(), in a graphical user interface using utils::winProgressBar(), tcltk::tkProgressBar() or shiny::withProgress(), via the speakers using beepr::beep(), or on a file system via the size of a file. Anyone can add additional, customized, progression handlers. The 'progressr' package uses R's condition framework for signaling progress updated. Because of this, progress can be reported from almost anywhere in R, e.g. from classical for and while loops, from map-reduce API:s like the lapply() family of functions, 'purrr', 'plyr', and 'foreach'. It will also work with parallel processing via the 'future' framework, e.g. future.apply::future_lapply(), furrr::future_map(), and 'foreach' with 'doFuture'. The package is compatible with Shiny applications.
55
Authors@R: c(person("Henrik", "Bengtsson",

NEWS.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# Version 0.17.0 [2025-10-15]
2+
3+
## New Features
4+
5+
* Now also `with_progress()` warns about receiving progress updates
6+
after the progressor has finished. Previously, only the global
7+
'progression' handler would do this.
8+
9+
## Bug Fixes
10+
11+
* Using `with_progress()` together with `handlers(global = TRUE)`
12+
would produce a warning on "Received a progression 'update' request
13+
(...) but is not listening to this progressor".
14+
15+
* Shiny apps running as background jobs in RStudio could fail with an
16+
error "object 'RStudio.Version' of mode 'function' was not found".
17+
This error occurred sporadically.
18+
19+
120
# Version 0.16.0 [2025-05-18]
221

322
## New Features

R/global_progression_handler.R

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -217,14 +217,7 @@ global_progression_handler <- local({
217217
}
218218
} else if (type == "update") {
219219
if (is.null(current_progressor_uuid)) {
220-
## We might receive zero-amount progress updates after the fact that the
221-
## progress has been completed
222-
amount <- progression$amount
223-
if (!is.numeric(amount) || amount > 0) {
224-
msg <- conditionMessage(progression)
225-
if (length(msg) == 0) msg <- "character(0)"
226-
warning(sprintf("Received a progression %s request (amount=%g; msg=%s) but is not listening to this progressor. This can happen when code signals more progress updates than it configured the progressor to do. When the progressor completes all steps, it shuts down resulting in the global progression handler to no longer listen to it. To troubleshoot this, try with progressr::handlers(\"debug\")", sQuote(type), amount, sQuote(msg)))
227-
}
220+
warn_about_too_many_progressions(progression, global = TRUE)
228221
return()
229222
}
230223

@@ -308,9 +301,9 @@ global_progression_handler <- local({
308301

309302
## Muffle it for now
310303
if (inherits(condition, "message")) {
311-
invokeRestart("muffleMessage")
304+
tryInvokeRestart("muffleMessage")
312305
} else if (inherits(condition, "warning")) {
313-
invokeRestart("muffleWarning")
306+
tryInvokeRestart("muffleWarning")
314307
} else if (inherits(condition, "condition")) {
315308
## If there is a "muffle" restart for this condition,
316309
## then invoke that restart, i.e. "muffle" the condition
@@ -319,7 +312,7 @@ global_progression_handler <- local({
319312
name <- restart$name
320313
if (is.null(name)) next
321314
if (!grepl("^muffle", name)) next
322-
invokeRestart(restart)
315+
tryInvokeRestart(restart)
323316
break
324317
}
325318
}

R/handler_cli.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ handler_cli <- function(show_after = 0.0, intrusiveness = getOption("progressr.i
6666
output <- gsub("[\n\r]+$", "", output)
6767
}
6868
cat(output, file = stderr())
69-
invokeRestart("muffleMessage")
69+
tryInvokeRestart("muffleMessage")
7070
})
7171

7272
invisible(res)

R/handler_rpushbullet.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ is_rpushbullet_working <- local({
125125
})
126126
}, message = function(cond) {
127127
conds <<- c(conds, list(cond))
128-
if (quiet) invokeRestart("muffleMessage")
128+
if (quiet) tryInvokeRestart("muffleMessage")
129129
}, warning = function(cond) {
130130
conds <<- c(conds, list(cond))
131-
if (quiet) invokeRestart("muffleWarning")
131+
if (quiet) tryInvokeRestart("muffleWarning")
132132
})
133133

134134
if (is.na(res)) res <- FALSE

R/make_calling_handler.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ make_calling_handler <- function(handlers) {
66
handler <- handlers[[kk]]
77
if (handler(p)) finished <- TRUE
88
}
9-
finished
9+
invisible(finished)
1010
}
1111
} else {
1212
calling_handler <- handlers[[1]]

R/options.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,8 @@ update_package_options <- function(debug = FALSE) {
263263

264264
## However, not used
265265
update_package_option("global.handler", mode = "logical", debug = debug)
266+
267+
## For RStudio users
268+
update_package_option("rstudio.patch", mode = "logical", debug = debug)
266269
}
270+

R/progress_aggregator.R

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,11 @@ progress_aggregator <- function(progress) {
4141
}
4242
}
4343

44-
## Prevent upstream calling handlers to receive progression 'p'
45-
invokeRestart("muffleProgression")
44+
## Prevent upstream calling handlers to receive progression 'p'.
45+
## Restart 'muffleProgression' is not guaranteed to exist, e.g. the
46+
## 'progression' condition might be resignaled by a handler that
47+
## does not define it.
48+
tryInvokeRestart("muffleProgression")
4649
}
4750

4851
handler <- make_progression_handler("progress_aggregator", handler = handler)

R/rstudio-console.R

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,17 @@ get_rstudio_version <- local({
22
.version <- NULL
33
function() {
44
if (is.null(.version)) {
5-
if (!"tools:rstudio" %in% search()) {
6-
.version <<- package_version("0.0")
7-
} else {
5+
.version <<- package_version("0.0")
6+
if ("tools:rstudio" %in% search()) {
87
envir <- as.environment("tools:rstudio")
9-
RStudio.Version <- get("RStudio.Version", mode = "function", envir = envir, inherits = FALSE)
10-
.version <<- RStudio.Version()[["version"]]
8+
## There are cases where 'tools:rstudio' exist, but there is no
9+
## RStudio.Version() function. See
10+
## https://github.com/futureverse/progressr/issues/183 for
11+
## an example. Not sure how that happens. /HB 2025-09-23
12+
if (exists("RStudio.Version", mode = "function", envir = envir, inherits = FALSE)) {
13+
RStudio.Version <- get("RStudio.Version", mode = "function", envir = envir, inherits = FALSE)
14+
.version <<- RStudio.Version()[["version"]]
15+
}
1116
}
1217
}
1318
.version

0 commit comments

Comments
 (0)