Skip to content

Commit 9281812

Browse files
authored
Upkeep 2025 04 (#119)
* Update upkeep date * Pseudo-air formatting * Add Posit RoR and use tidy description * update readme chunks and re-knit * Use tidy actions * Update vignette chunks and re-knit
1 parent b5c4c3a commit 9281812

25 files changed

+468
-278
lines changed

.github/workflows/check-standard.yaml renamed to .github/workflows/R-CMD-check.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
#
4+
# NOTE: This workflow is overkill for most R packages and
5+
# check-standard.yaml is likely a better choice.
6+
# usethis::use_github_action("check-standard") will install it.
37
on:
48
push:
59
branches: [main, dev]
610
pull_request:
7-
branches: [main, dev]
811

9-
name: R-CMD-check
12+
name: R-CMD-check.yaml
13+
14+
permissions: read-all
1015

1116
jobs:
1217
R-CMD-check:
@@ -50,3 +55,4 @@ jobs:
5055
- uses: r-lib/actions/check-r-package@v2
5156
with:
5257
upload-snapshots: true
58+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

.github/workflows/check-no-suggests.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ on:
1010
push:
1111
branches: [main, dev]
1212
pull_request:
13-
branches: [main, dev]
1413

1514
name: R-CMD-check-hard
1615

.github/workflows/pkgdown.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
5-
branches: [main]
5+
branches: [main, master]
66
pull_request:
7-
branches: [main]
87
release:
98
types: [published]
109
workflow_dispatch:
1110

12-
name: pkgdown
11+
name: pkgdown.yaml
12+
13+
permissions: read-all
1314

1415
jobs:
1516
pkgdown:
@@ -41,7 +42,7 @@ jobs:
4142

4243
- name: Deploy to GitHub pages 🚀
4344
if: github.event_name != 'pull_request'
44-
uses: JamesIves/github-pages-deploy-action@v4
45+
uses: JamesIves/github-pages-deploy-action@v4.5.0
4546
with:
4647
clean: false
4748
branch: gh-pages

.github/workflows/pr-commands.yaml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
name: pr-commands.yaml
8+
9+
permissions: read-all
10+
11+
jobs:
12+
document:
13+
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }}
14+
name: document
15+
runs-on: ubuntu-latest
16+
env:
17+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
permissions:
19+
contents: write
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: r-lib/actions/pr-fetch@v2
24+
with:
25+
repo-token: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- uses: r-lib/actions/setup-r@v2
28+
with:
29+
use-public-rspm: true
30+
31+
- uses: r-lib/actions/setup-r-dependencies@v2
32+
with:
33+
extra-packages: any::roxygen2
34+
needs: pr-document
35+
36+
- name: Document
37+
run: roxygen2::roxygenise()
38+
shell: Rscript {0}
39+
40+
- name: commit
41+
run: |
42+
git config --local user.name "$GITHUB_ACTOR"
43+
git config --local user.email "[email protected]"
44+
git add man/\* NAMESPACE
45+
git commit -m 'Document'
46+
47+
- uses: r-lib/actions/pr-push@v2
48+
with:
49+
repo-token: ${{ secrets.GITHUB_TOKEN }}
50+
51+
style:
52+
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }}
53+
name: style
54+
runs-on: ubuntu-latest
55+
env:
56+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
57+
permissions:
58+
contents: write
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- uses: r-lib/actions/pr-fetch@v2
63+
with:
64+
repo-token: ${{ secrets.GITHUB_TOKEN }}
65+
66+
- uses: r-lib/actions/setup-r@v2
67+
68+
- name: Install dependencies
69+
run: install.packages("styler")
70+
shell: Rscript {0}
71+
72+
- name: Style
73+
run: styler::style_pkg()
74+
shell: Rscript {0}
75+
76+
- name: commit
77+
run: |
78+
git config --local user.name "$GITHUB_ACTOR"
79+
git config --local user.email "[email protected]"
80+
git add \*.R
81+
git commit -m 'Style'
82+
83+
- uses: r-lib/actions/pr-push@v2
84+
with:
85+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-coverage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
5-
branches: [main]
5+
branches: [main, master]
66
pull_request:
77

88
name: test-coverage.yaml

DESCRIPTION

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,43 @@
1-
Package: nanonext
21
Type: Package
2+
Package: nanonext
33
Title: NNG (Nanomsg Next Gen) Lightweight Messaging Library
44
Version: 1.5.2.9005
5-
Description: R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is
6-
a socket library for reliable, high-performance messaging over in-process,
7-
IPC, TCP, WebSocket and secure TLS transports. Implements 'Scalability
8-
Protocols', a standard for common communications patterns including
9-
publish/subscribe, request/reply and service discovery. As its own threaded
10-
concurrency framework, provides a toolkit for asynchronous programming and
11-
distributed computing. Intuitive 'aio' objects resolve automatically when
12-
asynchronous operations complete, and synchronisation primitives allow R to
13-
wait upon events signalled by concurrent threads.
14-
Authors@R:
15-
c(person(given = "Charlie",
16-
family = "Gao",
17-
role = c("aut", "cre"),
18-
email = "[email protected]",
19-
comment = c(ORCID = "0000-0002-0750-061X")),
20-
person(given = "Posit Software, PBC",
21-
role = c("cph", "fnd")),
22-
person(given = "Hibiki AI Limited",
23-
role = "cph"),
24-
person(given = "R Consortium",
25-
role = "fnd"))
5+
Authors@R: c(
6+
person("Charlie", "Gao", , "[email protected]", role = c("aut", "cre"),
7+
comment = c(ORCID = "0000-0002-0750-061X")),
8+
person("Posit Software, PBC", role = c("cph", "fnd"),
9+
comment = c(ROR = "03wc8by49")),
10+
person("Hibiki AI Limited", role = "cph"),
11+
person("R Consortium", role = "fnd")
12+
)
13+
Description: R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ.
14+
NNG is a socket library for reliable, high-performance messaging over
15+
in-process, IPC, TCP, WebSocket and secure TLS transports. Implements
16+
'Scalability Protocols', a standard for common communications patterns
17+
including publish/subscribe, request/reply and service discovery. As
18+
its own threaded concurrency framework, provides a toolkit for
19+
asynchronous programming and distributed computing. Intuitive 'aio'
20+
objects resolve automatically when asynchronous operations complete,
21+
and synchronisation primitives allow R to wait upon events signalled
22+
by concurrent threads.
2623
License: MIT + file LICENSE
27-
BugReports: https://github.com/r-lib/nanonext/issues
2824
URL: https://nanonext.r-lib.org, https://github.com/r-lib/nanonext
29-
Encoding: UTF-8
30-
SystemRequirements: 'libnng' >= 1.9 and 'libmbedtls' >= 2.5, or 'cmake' and 'xz'
31-
to compile NNG and/or Mbed TLS included in package sources
25+
BugReports: https://github.com/r-lib/nanonext/issues
3226
Depends:
3327
R (>= 3.6)
34-
Enhances:
35-
promises
3628
Suggests:
3729
later,
3830
litedown
39-
VignetteBuilder: litedown
40-
RoxygenNote: 7.3.2
41-
Roxygen: list(markdown = TRUE)
31+
Enhances:
32+
promises
33+
VignetteBuilder:
34+
litedown
4235
Biarch: true
4336
Config/build/compilation-database: true
4437
Config/Needs/website: tidyverse/tidytemplate
38+
Config/usethis/last-upkeep: 2025-04-23
39+
Encoding: UTF-8
40+
Roxygen: list(markdown = TRUE)
41+
RoxygenNote: 7.3.2.9000
42+
SystemRequirements: 'libnng' >= 1.9 and 'libmbedtls' >= 2.5, or 'cmake'
43+
and 'xz' to compile NNG and/or Mbed TLS included in package sources

R/aio.R

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,13 @@ send_aio <- function(con, data, mode = c("serial", "raw"), timeout = NULL, pipe
121121
#'
122122
#' @export
123123
#'
124-
recv_aio <- function(con,
125-
mode = c("serial", "character", "complex", "double",
126-
"integer", "logical", "numeric", "raw", "string"),
127-
timeout = NULL,
128-
cv = NULL,
129-
n = 65536L)
124+
recv_aio <- function(
125+
con,
126+
mode = c("serial", "character", "complex", "double", "integer", "logical", "numeric", "raw", "string"),
127+
timeout = NULL,
128+
cv = NULL,
129+
n = 65536L
130+
)
130131
data <- .Call(rnng_recv_aio, con, mode, timeout, cv, n, environment())
131132

132133
# Core aio functions -----------------------------------------------------------
@@ -336,13 +337,10 @@ unresolved <- function(x) .Call(rnng_unresolved, x)
336337
#' @exportS3Method promises::as.promise
337338
#'
338339
as.promise.recvAio <- function(x) {
339-
340340
promise <- .subset2(x, "promise")
341341

342342
if (is.null(promise)) {
343-
344343
promise <- if (unresolved(x)) {
345-
346344
promises::promise(
347345
function(resolve, reject) .keep(x, environment())
348346
)$then(
@@ -361,13 +359,11 @@ as.promise.recvAio <- function(x) {
361359
})
362360
)
363361
}
364-
362+
365363
`[[<-`(x, "promise", promise)
366-
367364
}
368365

369366
promise
370-
371367
}
372368

373369
#' @exportS3Method promises::is.promising

R/context.R

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -132,20 +132,19 @@ close.nanoContext <- function(con, ...) invisible(.Call(rnng_ctx_close, con))
132132
#'
133133
#' @export
134134
#'
135-
reply <- function(context,
136-
execute,
137-
recv_mode = c("serial", "character", "complex", "double",
138-
"integer", "logical", "numeric", "raw"),
139-
send_mode = c("serial", "raw"),
140-
timeout = NULL,
141-
...) {
142-
135+
reply <- function(
136+
context,
137+
execute,
138+
recv_mode = c("serial", "character", "complex", "double", "integer", "logical", "numeric", "raw", "string"),
139+
send_mode = c("serial", "raw"),
140+
timeout = NULL,
141+
...
142+
) {
143143
block <- if (is.null(timeout)) TRUE else timeout
144144
res <- recv(context, mode = recv_mode, block = block)
145145
is_error_value(res) && return(res)
146146
data <- .Call(rnng_eval_safe, as.call(list(execute, res, ...)))
147147
send(context, data = data, mode = send_mode, block = block)
148-
149148
}
150149

151150
#' Request over Context (RPC Client for Req/Rep Protocol)
@@ -225,12 +224,13 @@ reply <- function(context,
225224
#'
226225
#' @export
227226
#'
228-
request <- function(con,
229-
data,
230-
send_mode = c("serial", "raw"),
231-
recv_mode = c("serial", "character", "complex", "double",
232-
"integer", "logical", "numeric", "raw", "string"),
233-
timeout = NULL,
234-
cv = NULL,
235-
msgid = NULL)
227+
request <- function(
228+
con,
229+
data,
230+
send_mode = c("serial", "raw"),
231+
recv_mode = c("serial", "character", "complex", "double", "integer", "logical", "numeric", "raw", "string"),
232+
timeout = NULL,
233+
cv = NULL,
234+
msgid = NULL
235+
)
236236
data <- .Call(rnng_request, con, data, send_mode, recv_mode, timeout, cv, msgid, environment())

R/messenger.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#' @export
3737
#'
3838
messenger <- function(url, auth = NULL) {
39-
4039
lock <- md5_object(auth)
4140
comb <- order(as.integer(random(20L, convert = FALSE)))
4241
key <- c(comb, as.integer(lock)[comb])
@@ -84,7 +83,6 @@ messenger <- function(url, auth = NULL) {
8483
cat(sprintf("%*s > not sent: peer offline: %s\n", nchar(data), "", format.POSIXct(Sys.time())), file = stderr()) else
8584
cat(sprintf("%*s > %s\n", nchar(data), "", format.POSIXct(Sys.time())), file = stdout())
8685
}
87-
8886
}
8987

9088
# nocov end

0 commit comments

Comments
 (0)