Skip to content

Commit eb8f3c5

Browse files
Merge branch 'release/0.1.1'
2 parents 8a7300c + d7d1df4 commit eb8f3c5

37 files changed

Lines changed: 719 additions & 234 deletions

.Rbuildignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ Rplots.pdf$
5151
^[.]docs/
5252
^.*[.]png
5353

54-
#----------------------------
55-
# Package specific
56-
#----------------------------
57-
^[.]BatchJobs[.]R$
58-
[.]future
59-
6054
#----------------------------
6155
# Miscellaneous
6256
#----------------------------

.github/workflows/R-CMD-check.yaml

Lines changed: 59 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
on: [push, pull_request]
2-
2+
33
name: R-CMD-check
44

55
jobs:
66
R-CMD-check:
77
if: "! contains(github.event.head_commit.message, '[ci skip]')"
88

9-
timeout-minutes: 15
9+
timeout-minutes: 30
1010

1111
runs-on: ${{ matrix.config.os }}
1212

@@ -16,22 +16,35 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
config:
19-
# - {os: windows-latest, r: 'release' }
20-
# - {os: macOS-latest, r: 'release' }
21-
- {os: ubuntu-latest, r: 'devel' }
22-
# - {os: ubuntu-latest, r: 'release' }
23-
19+
# - {os: windows-latest, r: 'release' }
20+
# - {os: windows-latest, r: 'oldrel' }
21+
# - {os: macOS-latest, r: 'release' }
22+
- {os: ubuntu-latest, r: 'devel' }
23+
- {os: ubuntu-latest, r: 'release' }
24+
# - {os: ubuntu-latest, r: 'oldrel' }
25+
# - {os: ubuntu-latest, r: '4.1' }
26+
2427
env:
2528
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
26-
RSPM: https://packagemanager.rstudio.com/cran/__linux__/jammy/latest
29+
R_KEEP_PKG_SOURCE: yes
2730
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
31+
## Test in other locale (optional)
32+
LANGUAGE: ${{ matrix.config.language }}
33+
## R (>= 4.4.0) Note, no trailing underscore (sic!)
34+
_R_COMPARE_LANG_OBJECTS: eqonly
2835
## R CMD check
2936
_R_CHECK_CRAN_INCOMING_: false
30-
_R_CHECK_LENGTH_1_CONDITION_: true
31-
_R_CHECK_LENGTH_1_LOGIC2_: true
3237
_R_CHECK_MATRIX_DATA_: true
3338
_R_CHECK_SUGGESTS_ONLY_: true
34-
39+
_R_CHECK_THINGS_IN_TEMP_DIR_: true
40+
_R_CHECK_TESTS_NLINES_: 300
41+
RCMDCHECK_ERROR_ON: note
42+
## Specific to futures
43+
R_FUTURE_CONNECTIONS_ONMISUSE: "error[details=TRUE]"
44+
R_FUTURE_GLOBALENV_ONMISUSE: "error"
45+
R_FUTURE_GLOBALS_ONREFERENCE: "warning"
46+
R_FUTURE_RNG_ONMISUSE: error
47+
3548
steps:
3649
- uses: actions/checkout@v4
3750

@@ -40,59 +53,59 @@ jobs:
4053
- uses: r-lib/actions/setup-r@v2
4154
with:
4255
r-version: ${{ matrix.config.r }}
43-
44-
- name: Query R package dependencies
45-
run: |
46-
install.packages('remotes')
47-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
48-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
49-
shell: Rscript {0}
50-
51-
- name: Cache R packages
52-
if: runner.os != 'Windows'
53-
uses: actions/cache@v1
56+
http-user-agent: ${{ matrix.config.http-user-agent }}
57+
use-public-rspm: true
58+
59+
- uses: r-lib/actions/setup-r-dependencies@v2
5460
with:
55-
path: ${{ env.R_LIBS_USER }}
56-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
57-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
61+
extra-packages: |
62+
any::rcmdcheck
63+
any::remotes
64+
needs: check
5865

59-
- name: Install R package system dependencies (Linux)
60-
if: runner.os == 'Linux'
61-
env:
62-
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
66+
- name: Install package itself (special case)
6367
run: |
64-
Rscript -e "remotes::install_github('r-hub/sysreqs')"
65-
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
66-
sudo -s eval "$sysreqs"
67-
sudo apt install -y libcurl4-openssl-dev
68-
69-
- name: Install R package dependencies
70-
run: |
71-
remotes::install_deps(dependencies = TRUE)
72-
install.packages(".", repos = NULL, type = "source") ## self vignette engine
73-
shell: Rscript {0}
74-
75-
- name: Install 'rcmdcheck'
76-
run: |
77-
remotes::install_cran("rcmdcheck")
78-
library(rcmdcheck) ## triggers an error, if installation failed
68+
install.packages(".", repos = NULL, type = "source") ## needed by parallel workers
69+
remotes::install_github("futureverse/doFuture", ref = "develop")
70+
7971
shell: Rscript {0}
8072

8173
- name: Session info
8274
run: |
8375
options(width = 100)
76+
parallelly::availableCores(which = "all")
77+
sapply(c(physical_cores = FALSE, logical_cores = TRUE), parallel::detectCores)
78+
if (require(RhpcBLASctl, quietly=TRUE)) c(get_num_procs = get_num_procs(), get_num_cores = get_num_cores(), blas_get_num_procs = blas_get_num_procs(), omp_get_num_procs = omp_get_num_procs(), omp_get_max_threads = omp_get_max_threads())
8479
capabilities()
8580
pkgs <- installed.packages()[, "Package"]
8681
sessioninfo::session_info(pkgs, include_base = TRUE)
82+
## Verify LANGUAGE settings by generating a translatable error
83+
cat(sprintf("LANGUAGE=%s\n", sQuote(Sys.getenv("LANGUAGE"))))
84+
cat(sprintf("locales: %s\n", sQuote(Sys.getlocale())))
85+
tryCatch(log("a"), error = conditionMessage)
8786
shell: Rscript {0}
8887

8988
- name: Check
90-
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran", if (.Platform$OS.type == "windows" && getRversion() >= "4.2.0") "--no-multiarch"), error_on = "warning", check_dir = "check")
89+
if: runner.os != 'Windows'
90+
run: |
91+
rcmdcheck::rcmdcheck(
92+
args = c("--no-manual", "--as-cran"),
93+
check_dir = "check"
94+
)
95+
shell: Rscript {0}
96+
97+
- name: Check (Windows)
98+
if: runner.os == 'Windows'
99+
run: |
100+
rcmdcheck::rcmdcheck(
101+
args = c("--no-manual", "--as-cran", if (getRversion() >= "4.2.0") "--no-multiarch"),
102+
check_dir = "check"
103+
)
91104
shell: Rscript {0}
92105

93106
- name: Upload check results
94107
if: failure()
95-
uses: actions/upload-artifact@v2
108+
uses: actions/upload-artifact@v4
96109
with:
97110
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
98111
path: check

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future.tools
2-
Version: 0.1.0-9002
2+
Version: 0.1.1
33
Title: Tools for Working with Futures
44
Depends:
55
R (>= 3.3.0),
@@ -18,5 +18,5 @@ LazyLoad: TRUE
1818
Encoding: UTF-8
1919
URL: https://future.tools.futureverse.org, https://github.com/futureverse/future.tools
2020
BugReports: https://github.com/futureverse/future.tools/issues
21-
RoxygenNote: 7.3.1
21+
RoxygenNote: 7.3.3
2222
Roxygen: list(markdown = TRUE)

NEWS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Version (development version)
1+
# Version 0.1.1 (2025-10-31)
22

3-
* ...
3+
* Documentation updates.
44

55

66
# Version 0.1.0 (2023-05-19)

R/100.journal.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#' _WARNING: This function is under development. It can change at any time.
44
#' For now, please, do not depend on this function in a published R package._
55
#'
6-
#' @param x A [Future] object.
6+
#' @param x A [future::Future] object.
77
#'
88
## @param baseline (POSIXct; optional) A timestamp to server as time zero
99
## for the relative start time (`at`). If `TRUE` (default), then the

R/testme.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## This runs 'testme' test inst/testme/test-<name>.R scripts
2+
## Don't edit - it was autogenerated by inst/testme/deploy.R
3+
testme <- function(name) {
4+
path <- system.file(package = 'future.tools', 'testme', mustWork = TRUE)
5+
Sys.setenv(R_TESTME_PATH = path)
6+
Sys.setenv(R_TESTME_PACKAGE = 'future.tools')
7+
Sys.setenv(R_TESTME_NAME = name)
8+
on.exit(Sys.unsetenv('R_TESTME_NAME'))
9+
source(file.path(path, 'run.R'))
10+
}

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
## Installation
99

10-
R package **[future.tools]** is available via R-universe and can be
11-
installed as:
10+
The **future.tools** package is not, yet, on CRAN. In the meanwhile,
11+
it can be installed from the R Universe as:
1212

1313
```r
1414
options(repos = c("https://futureverse.r-universe.dev", getOption("repos")))
@@ -18,16 +18,11 @@ install.packages("future.tools")
1818

1919
### Pre-release version
2020

21-
To install the pre-release version that is available in Git branch
22-
`develop` on [GitHub], use:
23-
21+
To install the pre-release version that is available in Git branch `develop` on GitHub, use:
2422
```r
25-
remotes::install_github("futureverse/future.tools", ref="develop")
23+
remotes::install_github("futureverse/future.tools", ref = "develop")
2624
```
27-
2825
This will install the package from source.
2926

30-
[future.tools]: https://future.tools.futureverse.org
31-
[GitHub]: https://www.github.com/futureverse/future.tools
32-
3327
<!-- pkgdown-drop-below -->
28+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Undo future debug
2+
options(future.debug = FALSE)
3+
4+
## Undo future strategy
5+
future::plan(oplan)
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
## Undo future strategy
2-
future::plan(oplan)
3-
1+
testme <- as.environment("testme")
2+
hpaste <- future:::hpaste
43

54
## Undo options
65
## (a) Reset
76
options(oopts0)
7+
88
## (b) Remove added
9-
added <- setdiff(names(options()), names(oopts0))
10-
opts <- vector("list", length = length(added))
11-
names(opts) <- added
12-
options(opts)
9+
local({
10+
added <- setdiff(names(options()), names(oopts0))
11+
opts <- vector("list", length = length(added))
12+
names(opts) <- added
13+
options(opts)
14+
})
15+
1316
## (c) Assert that everything was undone
1417
if (!identical(options(), oopts0)) {
1518
message("Failed to undo options:")
@@ -22,16 +25,18 @@ if (!identical(options(), oopts0)) {
2225
missing <- setdiff(names(oopts0), names(oopts))
2326
message(paste(sprintf(" - Options missing: [n=%d]", length(missing)),
2427
hpaste(sQuote(missing))))
25-
message("Differences option by option:")
26-
for (name in names(oopts0)) {
28+
29+
message("Differences option by option:")
30+
void <- lapply(names(oopts0), FUN = function(name) {
2731
value0 <- oopts0[[name]]
2832
value <- oopts[[name]]
2933
if (!identical(value, value0)) {
30-
utils::str(list(name = name, expected = value0, actual = value))
34+
if (testme[["debug"]]) {
35+
utils::str(list(name = name, expected = value0, actual = value))
36+
}
3137
}
32-
}
38+
})
3339
}
34-
stopifnot(identical(options(), oopts0))
3540

3641

3742
## Undo system environment variables
@@ -53,21 +58,22 @@ if (!identical(Sys.getenv(), oenvs0)) {
5358
message(paste(sprintf(" - Environment variables missing: [n=%d]", length(missing)),
5459
hpaste(sQuote(missing))))
5560
message("Differences environment variable by environment variable:")
56-
for (name in names(oenvs0)) {
61+
void <- lapply(names(oenvs0), FUN = function(name) {
5762
value0 <- unname(oenvs0[name])
5863
value <- unname(oenvs[name])
5964
if (!identical(value, value0)) {
60-
utils::str(list(name = name, expected = value0, actual = value))
65+
if (testme[["debug"]]) {
66+
utils::str(list(name = name, expected = value0, actual = value))
67+
}
6168
}
62-
}
69+
})
6370
}
6471

6572

66-
## Undo variables
67-
rm(list = c(setdiff(ls(), ovars)))
68-
73+
## Assert undo was successful
74+
if (testme[["debug"]]) {
75+
stopifnot(identical(options(), oopts0))
76+
}
6977

70-
## Travis CI specific: Explicit garbage collection because it
71-
## looks like Travis CI might run out of memory during 'covr'
72-
## testing and we now have so many tests. /HB 2017-01-11
73-
if ("covr" %in% loadedNamespaces()) gc()
78+
## Undo variables
79+
rm(list = c(setdiff(ls(envir = globalenv()), ovars)), envir = globalenv())

inst/testme/_epilogue/090.gc.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## Travis CI specific: Explicit garbage collection because it
2+
## looks like Travis CI might run out of memory during 'covr'
3+
## testing and we now have so many tests. /HB 2017-01-11
4+
if ("covr" %in% loadedNamespaces()) {
5+
res <- gc()
6+
testme <- as.environment("testme")
7+
if (testme[["debug"]]) print(res)
8+
}

0 commit comments

Comments
 (0)