Skip to content

Commit 7a22640

Browse files
committed
Trying to fix windows vignette compilation on GHA
1 parent 8dc6cd4 commit 7a22640

2 files changed

Lines changed: 32 additions & 10 deletions

File tree

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ including examples on how to use it on its own or to develop new R packages.
3434

3535
## Contents
3636

37-
* `extern` - Git submodule for `tskit` and instructions on obtaining the latest version and copying the `tskit` C code into `RcppTskit` directory. `extern` is saved outside of the `RcppTskit` directory because `R CMD CHECK` complains otherwise.
37+
* `extern` - Git submodule for `tskit` and instructions on
38+
obtaining the latest version and copying the `tskit` C code into
39+
`RcppTskit` directory.
40+
`extern` is saved outside of the `RcppTskit` directory
41+
because `R CMD CHECK` complains otherwise.
3842

3943
* `RcppTskit` - R package `RcppTskit`.
4044

@@ -64,18 +68,16 @@ https://mac.r-project.org/tools for macOS tools.
6468
```
6569
# install.packages("remotes") # If you don't have it already
6670
67-
# Release (TODO)
71+
# Release
6872
# TODO: Tag a release #15
6973
# https://github.com/HighlanderLab/RcppTskit/issues/15
7074
# remotes::install_github("HighlanderLab/RcppTskit/RcppTskit")
7175
7276
# Main branch
73-
remotes::install_github("HighlanderLab/RcppTskit/RcppTskit")
77+
remotes::install_github("HighlanderLab/RcppTskit/RcppTskit@main")
7478
7579
# Development branch
76-
# TODO: Create a devel branch #16
77-
# https://github.com/HighlanderLab/RcppTskit/issues/16
78-
# remotes::install_github("HighlanderLab/RcppTskit/RcppTskit@devel")
80+
remotes::install_github("HighlanderLab/RcppTskit/RcppTskit@devel")
7981
```
8082

8183
## Development
@@ -90,7 +92,8 @@ git clone https://github.com/HighlanderLab/RcppTskit.git
9092

9193
### Pre-commit install
9294

93-
We use [pre-commit](https://pre-commit.com) hooks to ensure code quality. Specifically, we use:
95+
We use [pre-commit](https://pre-commit.com) hooks to ensure code quality.
96+
Specifically, we use:
9497
* [air](https://github.com/posit-dev/air) to format R code,
9598
* [jarl](https://github.com/etiennebacher/jarl) to lint R code,
9699
* [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to format C/C++ code, and
@@ -108,7 +111,8 @@ If you plan to update `tskit`, follow instructions in `extern/README.md`.
108111

109112
### RcppTskit
110113

111-
Then open `RcppTskit` package directory in your favourite R IDE (Positron, RStudio, text-editor-of-your-choice, etc.) and implement your changes.
114+
Then open `RcppTskit` package directory in your favourite R IDE
115+
(Positron, RStudio, text-editor-of-your-choice, etc.) and implement your changes.
112116

113117
You should routinely check your changes (in R):
114118

@@ -158,6 +162,8 @@ pre-commit run --all-files
158162

159163
### Continuous integration
160164

161-
We use Github Actions to run continuous integration (CI) checks on each push and pull request. Specifically, we run:
165+
We use Github Actions to run continuous integration (CI) checks
166+
on each push and pull request.
167+
Specifically, we run:
162168
* [R CMD check](.github/workflows/R-CMD-check.yaml) on multiple platforms and
163169
* [covr test coverage](.github/workflows/covr.yaml).

RcppTskit/vignettes/RcppTskit_intro.qmd

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,26 @@ that can write C++ code.
165165

166166
First install `RcppTskit` from CRAN and load it.
167167

168+
```{r}
169+
#| label: pre-setup
170+
#| include: false
171+
# Had issues on Windows (reporting that RcppTskit is not installed, which is odd).
172+
# This tries to get library path "back".
173+
lib_env <- Sys.getenv("R_LIBS")
174+
if (nzchar(lib_env)) {
175+
.libPaths(unique(c(strsplit(lib_env, .Platform$path.sep)[[1]], .libPaths())))
176+
}
177+
```
178+
168179
```{r}
169180
#| label: setup
170181
# install.packages("RcppTskit")
171-
library(RcppTskit)
182+
183+
test <- require(RcppTskit)
184+
if (!test) {
185+
message("RcppTskit not available; skipping vignette execution.")
186+
knitr::opts_chunk$set(eval = FALSE)
187+
}
172188
```
173189

174190
### 1) Load a tree sequence into R and summarise it

0 commit comments

Comments
 (0)