Skip to content

Commit c21c718

Browse files
authored
Prepare release 2.2.0 (#240)
1 parent 7298271 commit c21c718

13 files changed

+96
-92
lines changed

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

+23-51
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
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+
#
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.
17
on:
28
push:
3-
branches:
4-
- master
9+
branches: [main, master]
510
pull_request:
6-
branches:
7-
- master
11+
branches: [main, master]
812

913
name: R-CMD-check
1014

@@ -18,62 +22,30 @@ jobs:
1822
fail-fast: false
1923
matrix:
2024
config:
25+
- {os: macos-latest, r: 'release'}
2126
- {os: windows-latest, r: 'release'}
22-
- {os: macOS-latest, r: 'release'}
23-
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
24-
27+
- {os: ubuntu-latest, r: 'release'}
28+
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
2529
env:
26-
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
27-
RSPM: ${{ matrix.config.rspm }}
2830
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
31+
R_KEEP_PKG_SOURCE: yes
2932

3033
steps:
31-
- uses: actions/checkout@v2
34+
- uses: actions/checkout@v3
35+
36+
- uses: r-lib/actions/setup-pandoc@v2
3237

33-
- uses: r-lib/actions/setup-r@master
38+
- uses: r-lib/actions/setup-r@v2
3439
with:
3540
r-version: ${{ matrix.config.r }}
41+
http-user-agent: ${{ matrix.config.http-user-agent }}
42+
use-public-rspm: true
3643

37-
- uses: r-lib/actions/setup-pandoc@master
38-
39-
- name: Query dependencies
40-
run: |
41-
install.packages('remotes')
42-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
43-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
44-
shell: Rscript {0}
45-
46-
- name: Cache R packages
47-
if: runner.os != 'Windows'
48-
uses: actions/cache@v2
44+
- uses: r-lib/actions/setup-r-dependencies@v2
4945
with:
50-
path: ${{ env.R_LIBS_USER }}
51-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
52-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
53-
54-
- name: Install system dependencies
55-
if: runner.os == 'Linux'
56-
run: |
57-
while read -r cmd
58-
do
59-
eval sudo $cmd
60-
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
61-
62-
- name: Install dependencies
63-
run: |
64-
remotes::install_deps(dependencies = TRUE)
65-
remotes::install_cran("rcmdcheck")
66-
shell: Rscript {0}
67-
68-
- name: Check
69-
env:
70-
_R_CHECK_CRAN_INCOMING_REMOTE_: false
71-
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
72-
shell: Rscript {0}
46+
extra-packages: any::rcmdcheck
47+
needs: check
7348

74-
- name: Upload check results
75-
if: failure()
76-
uses: actions/upload-artifact@main
49+
- uses: r-lib/actions/check-r-package@v2
7750
with:
78-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
79-
path: check
51+
upload-snapshots: true

.github/workflows/pkgdown.yaml

+29-27
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
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
13
on:
24
push:
3-
branches: master
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
release:
9+
types: [published]
10+
workflow_dispatch:
411

512
name: pkgdown
613

714
jobs:
815
pkgdown:
9-
runs-on: macOS-latest
16+
runs-on: ubuntu-latest
17+
# Only restrict concurrency for non-PR jobs
18+
concurrency:
19+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
1020
env:
1121
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1222
steps:
13-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
1424

15-
- uses: r-lib/actions/setup-r@master
25+
- uses: r-lib/actions/setup-pandoc@v2
1626

17-
- uses: r-lib/actions/setup-pandoc@master
18-
19-
- name: Query dependencies
20-
run: |
21-
install.packages('remotes')
22-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
23-
shell: Rscript {0}
27+
- uses: r-lib/actions/setup-r@v2
28+
with:
29+
use-public-rspm: true
2430

25-
- name: Cache R packages
26-
uses: actions/cache@v1
31+
- uses: r-lib/actions/setup-r-dependencies@v2
2732
with:
28-
path: ${{ env.R_LIBS_USER }}
29-
key: macOS-r-4.0-1-${{ hashFiles('.github/depends.Rds') }}
30-
restore-keys: macOS-r-4.0-1-
33+
extra-packages: any::pkgdown, local::.
34+
needs: website
3135

32-
- name: Install dependencies
33-
run: |
34-
install.packages("remotes")
35-
remotes::install_deps(dependencies = TRUE)
36-
remotes::install_dev("pkgdown")
36+
- name: Build site
37+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
3738
shell: Rscript {0}
3839

39-
- name: Install package
40-
run: R CMD INSTALL .
41-
42-
- name: Deploy package
43-
run: pkgdown::deploy_to_branch(new_process = FALSE)
44-
shell: Rscript {0}
40+
- name: Deploy to GitHub pages 🚀
41+
if: github.event_name != 'pull_request'
42+
uses: JamesIves/[email protected]
43+
with:
44+
clean: true
45+
branch: gh-pages
46+
folder: docs

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Title: Fast and Versatile Argument Checks
44
Description: Tests and assertions to perform frequent argument checks. A
55
substantial part of the package was written in C to minimize any worries
66
about execution time overhead.
7-
Version: 2.1.0-9000
7+
Version: 2.2.0
88
Authors@R: c(
99
person("Michel", "Lang", NULL, "[email protected]",
1010
role = c("cre", "aut"), comment = c(ORCID = "0000-0001-9754-0393")),

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
YEAR: 2022
1+
YEAR: 2023
22
COPYRIGHT HOLDER: Michel Lang

NEWS.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# Version 2.1.1
2-
*
3-
*
1+
# Version 2.2.0
2+
* Fixed C compiler warnings for windows
3+
* Added `checkPermutation` (#230).
4+
* Better handling of long vectors (#231).
5+
* Fixed a bounds check for numeric vectors and infinite bounds.
46

57
# Version 2.1.0
68
* New arguments `n.chars` and `max.chars` for `checkCharacter()` and

R/checkPermutation.R

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
#' Check if the arguments are permutations of each other.
2-
#' NAs are being treated as actual values by default.
2+
#'
3+
#' @description
4+
#' In contrast to \code{\link{checkSetEqual}}, the function tests for a true
5+
#' permutation of the two vectors and also considers duplicated values.
6+
#' Missing values are being treated as actual values by default.
7+
#' Does not work on raw values.
8+
#'
39
#' @templateVar fn Permutation
410
#' @template x
511
#' @param y [\code{atomic}]\cr
612
#' Vector to compare with. Atomic vector of type other than raw.
713
#' @param na.ok [\code{logical(1)}]\cr
814
#' Are missing values allowed? Default is \code{TRUE}.
915
#' @template checker
16+
#' @template set
17+
#' @family set
1018
#' @export
1119
#' @examples
1220
#' testPermutation(letters[1:2], letters[2:1])
@@ -16,11 +24,12 @@
1624
checkPermutation = function(x, y, na.ok = TRUE) {
1725
qassert(x, "a")
1826
qassert(y, "a")
19-
# raws cannot be sorted
20-
assert_false(is.raw(x))
21-
assert_false(is.raw(y))
2227

23-
# These are the cheap checks that we perform seperately
28+
if (is.raw(x) || is.raw(y)) {
29+
stop("Cannot check permutation on raw vectors")
30+
}
31+
32+
# These are the cheap checks that we perform separately
2433
if (!isSameType(x, y) || length(x) != length(y)) {
2534
return(sprintf("Must be permutation of %s, but is %s", array_collapse(y), array_collapse(x)))
2635
}

R/zzz.R

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
#' \item{\code{\link{checkSubset}}}
5858
#' \item{\code{\link{checkSetEqual}}}
5959
#' \item{\code{\link{checkDisjunct}}}
60+
#' \item{\code{\link{checkPermutation}}}
6061
#' }
6162
#'
6263
#' @section File IO:

man/checkChoice.Rd

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/checkDisjunct.Rd

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/checkPermutation.Rd

+17-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/checkSetEqual.Rd

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/checkSubset.Rd

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/checkmate-package.Rd

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)