Skip to content

Commit 4d9f6dc

Browse files
authored
Merge pull request #54 from ropensci/i51-cran-update
2 parents cb76f76 + 6fc2b17 commit 4d9f6dc

14 files changed

+2384
-13078
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@
1515
^doc$
1616
^Meta$
1717
^\.github$
18+
^revdep$
19+
^docker$

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- {os: windows-latest, r: 'release'}
2626
- {os: macOS-latest, r: 'release'}
2727
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
28+
- {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
2829
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
2930

3031
env:
@@ -53,8 +54,8 @@ jobs:
5354
uses: actions/cache@v2
5455
with:
5556
path: ${{ env.R_LIBS_USER }}
56-
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
57-
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
57+
key: ${{ matrix.config.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
58+
restore-keys: ${{ matrix.config.os }}-${{ hashFiles('.github/R-version') }}-1-
5859

5960
- name: Install system dependencies
6061
if: runner.os == 'Linux'
@@ -82,5 +83,5 @@ jobs:
8283
if: failure()
8384
uses: actions/upload-artifact@main
8485
with:
85-
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
86+
name: ${{ matrix.config.os }}-r${{ matrix.config.r }}-results
8687
path: check

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ js/node_modules
1010
js/bundle*js
1111
doc
1212
Meta
13+
.idea
14+
revdep

DESCRIPTION

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
Package: jsonvalidate
22
Title: Validate 'JSON' Schema
3-
Version: 1.3.1
3+
Version: 1.3.2
44
Authors@R: c(person("Rich", "FitzJohn", role = c("aut", "cre"),
55
email = "[email protected]"),
66
person("Rob", "Ashton", role = "aut"),
7+
person("Alex", "Hill", role = "ctb"),
78
person("Alicia", "Schep", role = "ctb"),
89
person("Ian", "Lyttle", role = "ctb"),
910
person("Kara", "Woo", role = "ctb"),
10-
person("Mathias", "Buus", role = "cph"),
11-
person("Evgeny", "Poberezkin", role = "cph"))
11+
person("Mathias", "Buus", role = c("aut", "cph"),
12+
comment = "Author of bundled imjv library"),
13+
person("Evgeny", "Poberezkin", role = c("aut", "cph"),
14+
comment = "Author of bundled Ajv library"))
1215
Maintainer: Rich FitzJohn <[email protected]>
1316
Description: Uses the node library 'is-my-json-valid' or 'ajv' to
1417
validate 'JSON' against a 'JSON' schema. Drafts 04, 06 and 07 of

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## jsonvalidate 1.3.2
2+
3+
* Always uses ES5 version of Ajv, which allows use in both current and "legacy" V8 (#51)
4+
15
## jsonvalidate 1.3.0
26

37
* Upgrade to ajv version 8.5.0

docker/Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM ubuntu:18.04
2+
RUN apt-get update -qq && \
3+
apt-get install --no-install-recommends -y \
4+
dirmngr \
5+
software-properties-common \
6+
wget && \
7+
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc && \
8+
add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/" && \
9+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
10+
build-essential \
11+
gfortran \
12+
liblapack-dev \
13+
libblas-dev \
14+
libcairo2-dev \
15+
libcurl4-openssl-dev \
16+
libfontconfig1-dev \
17+
libssl-dev \
18+
libv8-dev \
19+
libxml2-dev \
20+
r-base
21+
22+
RUN apt-get install -y --no-install-recommends locales && \
23+
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
24+
locale-gen en_US.utf8 && \
25+
/usr/sbin/update-locale LANG=en_US.UTF-8
26+
27+
ENV LANG=en_US.UTF-8
28+
ENV LC_ALL=en_US.UTF-8
29+
30+
RUN Rscript -e 'install.packages(c("jsonvalidate", "testthat"))'

docker/README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# docker/es5 support
2+
3+
This dockerfile exists to make it easier to test that things still work in an es5 environment, as that is still fairly common (notably Solaris, but also ubuntu 18.04 LTS and RHEL 7).
4+
5+
From the root directory of jsonvalidate source, run
6+
7+
```
8+
docker build --tag richfitz/jsonvalidate:es5 docker
9+
```
10+
11+
to build the image; this should not take that long. It installs the current r-release along with the CRAN versions of jsonvalidate and testthat (which ensures all core dependencies are present).
12+
13+
Once setup, you can bring up a container with:
14+
15+
```
16+
docker run --rm -it -v $PWD:/src:ro richfitz/jsonvalidate:es5 bash
17+
```
18+
19+
which mounts the current directory read-only into the container at `/src`. That version of the source (rather than the CRAN one installed in the base image) can be installed with `R CMD INSTALL /src`
20+
21+
To run the whole test suite run:
22+
23+
```
24+
Rscript -e 'testthat::test_local("/src")'
25+
```
26+
27+
More simply, to just confirm that the bundle is valid you can do
28+
29+
```
30+
Rscript -e 'V8::new_context()$source("/src/inst/bundle.js")'
31+
```
32+
33+
which will error if the bundle is invalid.
34+
35+
To do a full reverse dependencies check with old libv8, you can bring up R in this container:
36+
37+
```
38+
docker run --rm -it -v $PWD:/src:ro richfitz/jsonvalidate:es5 bash
39+
```
40+
41+
Then install revdepcheck itself
42+
43+
```
44+
install.packages("remotes")
45+
remotes::install_github("r-lib/revdepcheck", upgrade = TRUE)
46+
```
47+
48+
Additional packages that we need, for some reason these did not get installed automatically though we'd have expected them to (see [this issue](https://github.com/r-lib/revdepcheck/issues/209))
49+
50+
```
51+
install.packages(c(
52+
"cinterpolate",
53+
"deSolve",
54+
"devtools",
55+
"golem",
56+
"inTextSummaryTable",
57+
"patientProfilesVis",
58+
"reticulate",
59+
"rlist",
60+
"shiny",
61+
"shinyBS",
62+
"shinydashboard",
63+
"shinyjs",
64+
"tableschema.r",
65+
"xml2"))
66+
```
67+
68+
At this point you will need to cycle the R session because the package DB will be corrupted by all the installations.
69+
70+
Finally we can run the reverse dependency check:
71+
72+
```
73+
unlink("/tmp/src", recursive = TRUE)
74+
file.copy("/src", "/tmp", recursive = TRUE)
75+
revdepcheck::revdep_check("/tmp/src", num_workers = 4)
76+
```

0 commit comments

Comments
 (0)