Skip to content

Commit ff78e0f

Browse files
authored
RC 1.4.1 (#864)
* Escalation deprecation of legacy functions * Update NEWS, README, etc * Do not evaluate code in vignette for updating * Update tests * Run revdepcheck * Update NEWS * Don't run deprecated examples * Try to skip some examples in the action to check across boards * Increment version number to 1.4.1
1 parent 45c1634 commit ff78e0f

37 files changed

+1144
-614
lines changed

.github/workflows/check-boards.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
env:
1515
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1616
R_KEEP_PKG_SOURCE: yes
17+
# To avoid running `board_url()` examples that result in 529 errors on GH
18+
NOT_CRAN: false
1719

1820
# board specific env vars
1921
PINS_AZURE_SAS: ${{ secrets.PINS_AZURE_SAS }}

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: pins
33
Title: Pin, Discover, and Share Resources
4-
Version: 1.4.0.9000
4+
Version: 1.4.1
55
Authors@R: c(
66
person("Julia", "Silge", , "[email protected]", role = c("cre", "aut"),
77
comment = c(ORCID = "0000-0002-3671-836X")),

NEWS.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
# pins (development version)
1+
# pins 1.4.1
22

33
* Support new `preview_data` parameter for pin previews on Posit Connect (#850).
44

55
* Fixed a bug in how `pin_upload()` handles pin names (#852).
66

77
* Improved documentation for S3-compatible object storage (#853).
88

9-
* Prepends 'https://' to Databricks host if missing (#855).
9+
* Prepend 'https://' to Databricks host if missing (#855).
1010

1111
* Fixed handling of `rsconnect::accounts()` results (#861).
1212

13+
* Escalated gradual deprecation process for legacy pins functions such as `pin()` (#864).
14+
1315
# pins 1.4.0
1416

1517
## Lifecycle changes

R/legacy_azure.R

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#'
33
#' @description
44
#' `r lifecycle::badge('deprecated')`
5-
#'
5+
#'
66
#' To use Microsoft Azure Storage as a board, you'll need an Azure Storage
77
#' account, an Azure Storage container, and an Azure Storage key.
88
#' @inheritParams legacy_datatxt
@@ -27,14 +27,17 @@
2727
#' @export
2828
#' @keywords internal
2929
legacy_azure <- function(
30-
container = Sys.getenv("AZURE_STORAGE_CONTAINER"),
31-
account = Sys.getenv("AZURE_STORAGE_ACCOUNT"),
32-
key = Sys.getenv("AZURE_STORAGE_KEY"),
33-
cache = NULL,
34-
name = "azure",
35-
...) {
36-
if (nchar(container) == 0) stop("The 'azure' board requires a 'container' parameter.")
37-
if (nchar(account) == 0) stop("The 'azure' board requires an 'account' parameter.")
30+
container = Sys.getenv("AZURE_STORAGE_CONTAINER"),
31+
account = Sys.getenv("AZURE_STORAGE_ACCOUNT"),
32+
key = Sys.getenv("AZURE_STORAGE_KEY"),
33+
cache = NULL,
34+
name = "azure",
35+
...
36+
) {
37+
if (nchar(container) == 0)
38+
stop("The 'azure' board requires a 'container' parameter.")
39+
if (nchar(account) == 0)
40+
stop("The 'azure' board requires an 'account' parameter.")
3841
if (nchar(key) == 0) stop("The 'azure' board requires a 'key' parameter.")
3942

4043
azure_url <- paste0("https://", account, ".blob.core.windows.net/", container)
@@ -56,14 +59,16 @@ legacy_azure <- function(
5659

5760
#' @rdname legacy_azure
5861
#' @export
59-
board_register_azure <- function(name = "azure",
60-
container = Sys.getenv("AZURE_STORAGE_CONTAINER"),
61-
account = Sys.getenv("AZURE_STORAGE_ACCOUNT"),
62-
key = Sys.getenv("AZURE_STORAGE_KEY"),
63-
cache = NULL,
64-
path = NULL,
65-
...) {
66-
lifecycle::deprecate_soft(
62+
board_register_azure <- function(
63+
name = "azure",
64+
container = Sys.getenv("AZURE_STORAGE_CONTAINER"),
65+
account = Sys.getenv("AZURE_STORAGE_ACCOUNT"),
66+
key = Sys.getenv("AZURE_STORAGE_KEY"),
67+
cache = NULL,
68+
path = NULL,
69+
...
70+
) {
71+
lifecycle::deprecate_warn(
6772
"1.4.0",
6873
"board_register_azure()",
6974
details = 'Learn more at <https://pins.rstudio.com/articles/pins-update.html>'
@@ -120,7 +125,10 @@ azure_headers <- function(board, verb, path, file) {
120125
sep = "\n"
121126
)
122127

123-
signature <- openssl::sha256(charToRaw(content), key = jsonlite::base64_dec(board$key)) %>%
128+
signature <- openssl::sha256(
129+
charToRaw(content),
130+
key = jsonlite::base64_dec(board$key)
131+
) %>%
124132
jsonlite::base64_enc()
125133

126134
headers <- httr::add_headers(

R/legacy_board_registry.R

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818
#' board %>% pin_read("mtcars")
1919
#' @keywords internal
2020
#' @export
21-
board_register <- function(board,
22-
name = NULL,
23-
cache = NULL,
24-
versions = NULL,
25-
...) {
21+
board_register <- function(
22+
board,
23+
name = NULL,
24+
cache = NULL,
25+
versions = NULL,
26+
...
27+
) {
2628
if (is_url(board)) {
2729
board <- legacy_datatxt(
2830
name = name,
@@ -34,10 +36,20 @@ board_register <- function(board,
3436
} else {
3537
fun <- paste0("board_register_", board)
3638
if (!exists(fun, mode = "function")) {
37-
stop("Don't know how to create board of type '", board, "'", call. = FALSE)
39+
stop(
40+
"Don't know how to create board of type '",
41+
board,
42+
"'",
43+
call. = FALSE
44+
)
3845
}
3946
fun <- match.fun(fun)
40-
board <- fun(name = name %||% board, cache = cache, versions = versions, ...)
47+
board <- fun(
48+
name = name %||% board,
49+
cache = cache,
50+
versions = versions,
51+
...
52+
)
4153
}
4254

4355
board_register2(board)
@@ -47,14 +59,16 @@ board_register <- function(board,
4759

4860
#' @rdname board_register
4961
#' @export
50-
board_register_rsconnect <- function(name = "rsconnect",
51-
server = NULL,
52-
account = NULL,
53-
key = NULL,
54-
output_files = FALSE,
55-
cache = NULL,
56-
...) {
57-
lifecycle::deprecate_soft(
62+
board_register_rsconnect <- function(
63+
name = "rsconnect",
64+
server = NULL,
65+
account = NULL,
66+
key = NULL,
67+
output_files = FALSE,
68+
cache = NULL,
69+
...
70+
) {
71+
lifecycle::deprecate_warn(
5872
"1.4.0",
5973
"board_register_rsconnect()",
6074
details = 'Learn more at <https://pins.rstudio.com/articles/pins-update.html>'
@@ -88,7 +102,10 @@ board_register_code <- function(board, name) {
88102
parent_call <- sys.call(sys.parent(parent_idx))
89103
if (!is.function(parent_func) || !is.call(parent_call)) break
90104

91-
this_parent_call <- tryCatch(match.call(definition = parent_func, call = parent_call), error = function(e) NULL)
105+
this_parent_call <- tryCatch(
106+
match.call(definition = parent_func, call = parent_call),
107+
error = function(e) NULL
108+
)
92109

93110
if (is.null(this_parent_call)) break
94111
if (length(this_parent_call) < 1) break
@@ -105,8 +122,7 @@ board_register_code <- function(board, name) {
105122
header <- if (grepl("^pins::", function_name)) "" else "library(pins)\n"
106123
if (is.null(parent_call)) {
107124
paste0(header, "board_register(\"", board, "\", name = \"", name, "\")")
108-
}
109-
else {
125+
} else {
110126
main_call <- paste(deparse(parent_call, width.cutoff = 500), collapse = " ")
111127
paste0(header, main_call)
112128
}
@@ -115,7 +131,8 @@ board_register_code <- function(board, name) {
115131
#' @rdname board_register
116132
#' @export
117133
board_deregister <- function(name, ...) {
118-
if (!name %in% board_registry_list()) stop("Board '", name, "' is not registered.")
134+
if (!name %in% board_registry_list())
135+
stop("Board '", name, "' is not registered.")
119136

120137
board <- board_get(name)
121138
board_registry_set(name, NULL)
@@ -151,7 +168,12 @@ board_get <- function(name) {
151168
} else if (name %in% board_list()) {
152169
board_registry_get(name)
153170
} else {
154-
stop("Board '", name, "' not a board, available boards: ", paste(board_list(), collapse = ", "))
171+
stop(
172+
"Board '",
173+
name,
174+
"' not a board, available boards: ",
175+
paste(board_list(), collapse = ", ")
176+
)
155177
}
156178
} else {
157179
stop("Invalid board specification", call. = FALSE)

0 commit comments

Comments
 (0)