Skip to content

Commit

Permalink
merging master
Browse files Browse the repository at this point in the history
  • Loading branch information
crowding committed Jul 1, 2024
2 parents 6de9b06 + 3fad920 commit 3d85180
Show file tree
Hide file tree
Showing 16 changed files with 129 additions and 79 deletions.
3 changes: 2 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
^pkgdown$
^scratch.*
^last.dump.r.*
^.*/last.dump.r.*
^.*/last.dump.r.*
^nseval\.Rproj$
34 changes: 19 additions & 15 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
#
# NOTE: This workflow is overkill for most R packages and
Expand All @@ -22,37 +22,41 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macos-latest, r: 'release'}

- {os: windows-latest, r: 'release'}
# Use 3.6 to trigger usage of RTools35
- {os: windows-latest, r: '3.6'}
# use 4.1 to check with rtools40's older compiler
- {os: windows-latest, r: '4.1'}

# Use older ubuntu to maximise backward compatibility
- {os: ubuntu-18.04, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-18.04, r: 'release'}
- {os: ubuntu-18.04, r: 'oldrel-1'}
- {os: ubuntu-18.04, r: 'oldrel-2'}
- {os: ubuntu-18.04, r: 'oldrel-3'}
- {os: ubuntu-18.04, r: 'oldrel-4'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}
- {os: ubuntu-latest, r: 'oldrel-2'}
- {os: ubuntu-latest, r: 'oldrel-3'}
- {os: ubuntu-latest, r: 'oldrel-4'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v1
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
27 changes: 20 additions & 7 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:
Expand All @@ -12,10 +14,15 @@ name: pkgdown
jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -28,8 +35,14 @@ jobs:
extra-packages: any::pkgdown, local::.
needs: website

- name: Deploy package
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
32 changes: 18 additions & 14 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
issue_comment:
Expand All @@ -14,22 +14,24 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v1
- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: roxygen2
extra-packages: any::roxygen2
needs: pr-document

- name: Document
run: Rscript -e 'roxygen2::roxygenise()'
run: roxygen2::roxygenise()
shell: Rscript {0}

- name: commit
run: |
Expand All @@ -38,7 +40,7 @@ jobs:
git add man/\* NAMESPACE
git commit -m 'Document'
- uses: r-lib/actions/pr-push@v1
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -49,19 +51,21 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/pr-fetch@v1
- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2

- name: Install dependencies
run: Rscript -e 'install.packages("styler")'
run: install.packages("styler")
shell: Rscript {0}

- name: Style
run: Rscript -e 'styler::style_pkg()'
run: styler::style_pkg()
shell: Rscript {0}

- name: commit
run: |
Expand All @@ -70,6 +74,6 @@ jobs:
git add \*.R
git commit -m 'Style'
- uses: r-lib/actions/pr-push@v1
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
28 changes: 24 additions & 4 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
Expand All @@ -15,16 +15,36 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: covr
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: covr::codecov()
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: nseval
Type: Package
Title: Tools for Lazy and Non-Standard Evaluation
Version: 0.4.99
Date: 2022-12-07
Version: 0.5.1
Date: 2023-12-11
Author: Peter Meilstrup <[email protected]>
Maintainer: Peter Meilstrup <[email protected]>
Description: Functions to capture, inspect, manipulate, and create
Expand Down Expand Up @@ -34,5 +34,5 @@ Collate:
'force.R'
'shortcut.R'
'missing.R'
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
Roxygen: list(markdown=TRUE)
7 changes: 3 additions & 4 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ S3method(is_missing_,quotation)
S3method(is_promise_,default)
S3method(is_promise_,dots)
S3method(is_promise_,quotation)
if (getRversion() >= "3.6.0") {
S3method(lazyeval::as.lazy,quotation)
S3method(lazyeval::as.lazy_dots,dots)
}
S3method(lazyeval::as.lazy,quotation)
S3method(lazyeval::as.lazy_dots,dots)
S3method(missing_,default)
S3method(missing_,dots)
S3method(missing_,quotation)
Expand Down Expand Up @@ -134,6 +132,7 @@ export(missing_value)
export(quo)
export(quo_)
export(set_)
export(set_arg)
export(set_arg_)
export(set_dots)
export(set_enclos_)
Expand Down
9 changes: 8 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# nseval 0.5.1 (release date: 2023-12-11)

### Fixes:

* Fix issues raised by CRAN:
* Always cast argument of `printf("%p", ...)` to `(void *)`

# nseval 0.5

# Changes
### Changes

* The representation of quotations has been changed. Quotations are now represented as expressions with a class attribute. This means that you can `eval` a quotation and it will return the same value that a promise would return when forced. This also means that you can `bquote` or `substitute` to place a quotation into an expression, and the resulting expression will evaluate _hygienically_.
* The better to support hygiene, `arg*` will check if there a quotation in the argument expression (as it would be if the call had been done with `bquote`) and transparently unwrap it.
Expand Down
2 changes: 1 addition & 1 deletion R/arg.R
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ arg_list_ <- function(syms, envs) {
.Call("_dotsxp_to_quolist", dts)
}


#' @export
#' @rdname arg
#' @description
#' `set_arg` and set_arg_ create bindings from quotations. They
Expand Down
6 changes: 3 additions & 3 deletions R/format.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ format.dots <- function(x,
FUN=function(x, n, sep) {
glue(
if (is.na(n)) "<NA> = " else if (n == "") "" else paste0(n, " = "),
format.quotation.inner(x,
format_quotation_inner(x,
compact,
show.environments=show.environments,
show.expressions=show.expressions,
Expand Down Expand Up @@ -69,7 +69,7 @@ format.quotation <- function(x,
show.expressions = !compact,
width = NULL,
...) {
chars <- format.quotation.inner(
chars <- format_quotation_inner(
x, compact = compact,
show.environments = show.environments,
show.expressions = show.expressions, width = width)
Expand Down Expand Up @@ -134,7 +134,7 @@ format.name <- function(x, ...) {

oneline <- function(x) structure(x, class=union("oneline", class(x)))

format.quotation.inner <- function(x,
format_quotation_inner <- function(x,
compact = FALSE,
show.environments = !compact,
show.expressions = !compact,
Expand Down
18 changes: 10 additions & 8 deletions R/shortcut.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,16 @@ is_forced_ <- function(syms, envs) {

#' @exportS3Method is_forced_ default
is_forced_.default <- function(syms, envs) {
if (is.null(names(syms)))
names(syms) <- as.character(syms)
mapply(
syms,
if (is.list(envs)) envs else list(envs),
FUN=function(sym, env) {
.Call("_is_forced", env, as.name(sym), FALSE)
})
out <- structure(logical(length(syms)),
names=names(syms) %||% as.character(syms))
if (is.list(envs)) {
for (i in seq_along(syms))
out[[i]] <- .Call("_is_forced", envs[[i]], as.name(syms[[i]]), FALSE)
} else {
for (i in seq_along(syms))
out[[i]] <- .Call("_is_forced", envs, as.name(syms[[i]]), FALSE)
}
out
}

#' @exportS3Method is_forced_ name
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The `nseval` Package: Utilities for Controlling Non-standard Evaluation
======

<!-- badges: start -->
[![R-CMD-check](https://github.com/crowding/nseval/workflows/R-CMD-check/badge.svg)](https://github.com/crowding/nseval/actions)
[![R-CMD-check](https://github.com/crowding/nseval/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/crowding/nseval/actions/workflows/R-CMD-check.yaml)
[![CRAN version badge](http://www.r-pkg.org/badges/version/nseval)](https://cran.r-project.org/package=nseval)[![Codecov test coverage](https://codecov.io/gh/crowding/nseval/branch/main/graph/badge.svg)](https://app.codecov.io/gh/crowding/nseval?branch=main)
<!-- badges: end -->

Expand Down Expand Up @@ -153,5 +153,5 @@ objects are effectively a recreation of
[fexprs](https://en.wikipedia.org/wiki/Fexpr) with lexical scope On
the topic of how to work with fexprs, particularly in combination with
lexical scope and environments, John Shutt's 2010 [PhD
thesis](https://web.wpi.edu/Pubs/ETD/Available/etd-090110-124904/unrestricted/jshutt.pdf)
thesis](https://digital.wpi.edu/concern/etds/ht24wj541?locale=en)
has been helpful.
4 changes: 2 additions & 2 deletions man/compat.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3d85180

Please sign in to comment.