Skip to content

Commit

Permalink
Merge pull request #40 from lionel-/fix-overtake
Browse files Browse the repository at this point in the history
Fix loading issues regarding dplyr hotpatching
  • Loading branch information
lionel- authored Oct 9, 2017
2 parents 41c252c + 5dcca76 commit a811d20
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 53 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tidyselect
Title: Select from a Set of Strings
Version: 0.2.0.9000
Version: 0.2.1
Authors@R: c(
person("Lionel", "Henry", ,"[email protected]", c("aut", "cre")),
person("Hadley", "Wickham", ,"[email protected]", "aut"),
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# tidyselect 0.2.0.9000
# tidyselect 0.2.1

* `-` now supports character vectors in addition to strings. This
makes it easy to unquote column names to exclude from the set:
Expand Down
17 changes: 10 additions & 7 deletions R/tidyselect.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"_PACKAGE"


maybe_overtake_dplyr <- function(...) {
if (!is_installed("dplyr") || utils::packageVersion("dplyr") > "99.9.0") {
maybe_hotpatch_dplyr <- function(...) {
if (!is_installed("dplyr") || env_has(ns_env("dplyr"), "peek_vars")) {
return(FALSE)
}

Expand All @@ -19,13 +19,12 @@ maybe_overtake_dplyr <- function(...) {
nms <- names(fns)

for (i in seq_along(fns)) {
overtake_binding(nms[[i]], fns[[i]], env)
hotpatch_binding(nms[[i]], fns[[i]], env)
}

TRUE
}

overtake_binding <- function(binding, fn, env) {
hotpatch_binding <- function(binding, fn, env) {
unlock <- env_get(base_env(), "unlockBinding")
unlock(binding, env)

Expand All @@ -35,7 +34,11 @@ overtake_binding <- function(binding, fn, env) {
lock(binding, env = env)
}

push_dplyr_hotpatch <- function(...) {
maybe_hotpatch_dplyr()
setHook(packageEvent("dplyr", "onLoad"), maybe_hotpatch_dplyr)
}

.onLoad <- function(...) {
maybe_overtake_dplyr()
setHook(packageEvent("dplyr", "onLoad"), maybe_overtake_dplyr)
setHook(packageEvent("tidyselect", "onLoad"), push_dplyr_hotpatch)
}
7 changes: 5 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

This release attempts to fix the R CMD check warnings that appeared on
some platforms.

## Test environments

* local OS X install, R 3.4.1
Expand All @@ -13,7 +16,7 @@

## Reverse dependencies

I have run R CMD check on the 2 downstream dependencies. (Summary at
I have run R CMD check on the 4 downstream dependencies. (Summary at
https://github.com/tidyverse/tidyselect/tree/master/revdep).

The package tidyr is failing, a hotfix release is on its way.
There were no problems.
38 changes: 17 additions & 21 deletions revdep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,33 @@
|field |value |
|:--------|:----------------------------|
|version |R version 3.4.1 (2017-06-30) |
|os |macOS Sierra 10.12 |
|os |macOS Sierra 10.12.6 |
|system |x86_64, darwin15.6.0 |
|ui |X11 |
|language |(EN) |
|collate |en_US.UTF-8 |
|tz |Europe/Brussels |
|date |2017-08-24 |
|date |2017-10-09 |

# Dependencies

|package |old |new |Δ |
|:----------|:-------|:----------|:--|
|tidyselect |0.1.1 |0.1.1.9000 |* |
|glue |1.1.1 |1.1.1 | |
|purrr |NA |0.2.3 |* |
|Rcpp |0.12.12 |0.12.12 | |
|rlang |0.1.2 |0.1.2 | |
|tibble |NA |1.3.4 |* |
|package |old |new |Δ |
|:----------|:-------|:-------|:--|
|tidyselect |0.2.0 |0.2.1 |* |
|glue |1.1.1 |1.1.1 | |
|purrr |0.2.3 |0.2.3 | |
|Rcpp |0.12.13 |0.12.13 | |
|rlang |0.1.2 |0.1.2 | |
|tibble |1.3.4 |1.3.4 | |

# Revdeps

## Broken (1)
## All (4)

|package |version |error |warning |note |
|:--------------------------|:-------|:------|:-------|:----|
|[tidyr](problems.md#tidyr) |0.7.0 |__+1__ | |1 |

## All (2)

|package |version |error |warning |note |
|:--------------------------|:-------|:------|:-------|:----|
|recipes |0.1.0 | | | |
|[tidyr](problems.md#tidyr) |0.7.0 |__+1__ | |1 |
|package |version |error |warning |note |
|:------------------------------|:-------|:-----|:-------|:----|
|[recipes](problems.md#recipes) |0.1.0 | |1 | |
|[sjstats](problems.md#sjstats) |0.11.2 | | |1 |
|tfruns |1.0 | | | |
|[tidyr](problems.md#tidyr) |0.7.1 | | |1 |

Binary file modified revdep/data.sqlite
Binary file not shown.
43 changes: 22 additions & 21 deletions revdep/problems.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
# tidyr
# recipes

Version: 0.1.0

## In both

* checking whether package ‘recipes’ can be installed ... WARNING
```
Found the following significant warnings:
Warning: package ‘dplyr’ was built under R version 3.4.2
See ‘/Users/lionel/Dropbox/Projects/R/lionel/tidyselect/revdep/checks/recipes/new/recipes.Rcheck/00install.out’ for details.
```
# sjstats
Version: 0.7.0
Version: 0.11.2
## Newly broken
## In both
* checking tests ...
* checking Rd cross-references ... NOTE
```
ERROR
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
> library(testthat)
> library(tidyr)
>
> test_check("tidyr")
1. Failure: errors are raised (@test-drop_na.R#40) -----------------------------
tidyr::drop_na(df, NULL) did not throw an error.
testthat results ================================================================
OK: 215 SKIPPED: 0 FAILED: 1
1. Failure: errors are raised (@test-drop_na.R#40)
Error: testthat unit tests failed
Execution halted
Packages unavailable to check Rd xrefs: ‘sjPlot’, ‘MuMIn’, ‘piecewiseSEM’
```
# tidyr
Version: 0.7.1
## In both
* checking data for non-ASCII characters ... NOTE
Expand Down

0 comments on commit a811d20

Please sign in to comment.