Skip to content

Commit 84e6954

Browse files
committed
[SPARK-56500][R] Replace devtools to remotes in SparkR
Replaces `devtools` to `remotes` which is lighter. It does not fix CRAN related because we don't release on CRAN anymore. - A lot of usages of `devtools` in our repo is actually deprecated. - Causes many issues like #55216 #55233 #55245 - It fails again because it requires another dependency. No, dev-only. Will minotior the CI. No. Closes #55362 from HyukjinKwon/SPARK-56500. Authored-by: Hyukjin Kwon <gurwls223@apache.org> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
1 parent d188c97 commit 84e6954

12 files changed

Lines changed: 78 additions & 79 deletions

File tree

.github/workflows/build_and_test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -914,8 +914,8 @@ jobs:
914914
apt-get install -y libcurl4-openssl-dev libgit2-dev libssl-dev libxml2-dev \
915915
libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev \
916916
libtiff5-dev libjpeg-dev
917-
Rscript -e "install.packages(c('devtools'), repos='https://cloud.r-project.org/')"
918-
Rscript -e "devtools::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')"
917+
Rscript -e "install.packages(c('remotes'), repos='https://cloud.r-project.org/')"
918+
Rscript -e "remotes::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')"
919919
- name: Install R linter dependencies and SparkR
920920
run: ./R/install-dev.sh
921921
- name: R linter
@@ -1030,9 +1030,9 @@ jobs:
10301030
apt-get update -y
10311031
apt-get install -y libcurl4-openssl-dev pandoc
10321032
apt-get install -y ruby ruby-dev
1033-
Rscript -e "install.packages(c('devtools', 'testthat', 'knitr', 'rmarkdown', 'markdown', 'e1071', 'roxygen2', 'ggplot2', 'mvtnorm', 'statmod'), repos='https://cloud.r-project.org/')"
1034-
Rscript -e "devtools::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')"
1035-
Rscript -e "devtools::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')"
1033+
Rscript -e "install.packages(c('remotes', 'testthat', 'knitr', 'rmarkdown', 'markdown', 'e1071', 'roxygen2', 'ggplot2', 'mvtnorm', 'statmod'), repos='https://cloud.r-project.org/')"
1034+
Rscript -e "remotes::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')"
1035+
Rscript -e "remotes::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')"
10361036
# Should unpin 'sphinxcontrib-*' after upgrading sphinx>5
10371037
python3.9 -m pip install 'sphinx==4.5.0' mkdocs 'pydata_sphinx_theme>=0.13' sphinx-copybutton nbsphinx numpydoc jinja2 markupsafe 'pyzmq<24.0.0' 'sphinxcontrib-applehelp==1.0.4' 'sphinxcontrib-devhelp==1.0.2' 'sphinxcontrib-htmlhelp==2.0.1' 'sphinxcontrib-qthelp==1.0.3' 'sphinxcontrib-serializinghtml==1.1.5'
10381038
python3.9 -m pip install ipython_genutils # See SPARK-38517

R/DOCUMENTATION.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ SparkR documentation is generated by using in-source comments and annotated by u
2222
[`roxygen2`](https://cran.r-project.org/package=roxygen2). After making changes to the documentation and generating man pages,
2323
you can run the following from an R console in the SparkR home directory
2424
```R
25-
library(devtools)
26-
devtools::document(pkg="./pkg", roclets=c("rd"))
25+
roxygen2::roxygenize(package.dir="./pkg", roclets=c("rd"))
2726
```
2827
You can verify if your changes are good by running
2928

R/create-docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#
1919

2020
# Script to create API docs and vignettes for SparkR
21-
# This requires `devtools`, `knitr` and `rmarkdown` to be installed on the machine.
21+
# This requires `roxygen2`, `knitr`, `rmarkdown`, and `pkgdown` to be installed on the machine.
2222

2323
# After running this script the html docs can be found in
2424
# $SPARK_HOME/R/pkg/html

R/create-rd.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ FWDIR="$(cd "`dirname "${BASH_SOURCE[0]}"`"; pwd)"
3333
pushd "$FWDIR" > /dev/null
3434
. "$FWDIR/find-r.sh"
3535

36-
# Generate Rd files if devtools is installed
37-
"$R_SCRIPT_PATH/Rscript" -e ' if(requireNamespace("devtools", quietly=TRUE)) { setwd("'$FWDIR'"); devtools::document(pkg="./pkg", roclets="rd") }'
36+
# Generate Rd files if roxygen2 is installed
37+
"$R_SCRIPT_PATH/Rscript" -e ' if(requireNamespace("roxygen2", quietly=TRUE)) { setwd("'$FWDIR'"); roxygen2::roxygenize(package.dir="./pkg", roclets=c("rd")) }'

R/pkg/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Once you have made your changes, please include unit tests for them and run exis
5353

5454
#### Generating documentation
5555

56-
The SparkR documentation (Rd files and HTML files) are not a part of the source repository. To generate them you can run the script `R/create-docs.sh`. This script uses `devtools` and `knitr` to generate the docs and these packages need to be installed on the machine before using the script. Also, you may need to install these [prerequisites](https://github.com/apache/spark/tree/master/docs#prerequisites). See also, `R/DOCUMENTATION.md`
56+
The SparkR documentation (Rd files and HTML files) are not a part of the source repository. To generate them you can run the script `R/create-docs.sh`. This script uses `roxygen2`, `knitr`, and `rmarkdown` to generate the docs and these packages need to be installed on the machine before using the script. Also, you may need to install these [prerequisites](https://github.com/apache/spark/tree/master/docs#prerequisites). See also, `R/DOCUMENTATION.md`
5757

5858
### Examples, Unit tests
5959

dev/create-release/spark-rm/Dockerfile.base

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ RUN echo 'deb https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/' >> /et
9191

9292
# Install R packages (same versions across all branches)
9393
# See more in SPARK-39959, roxygen2 < 7.2.1
94-
RUN Rscript -e "install.packages(c('devtools', 'remotes', 'knitr', 'markdown', \
94+
RUN Rscript -e "install.packages(c('remotes', 'knitr', 'markdown', \
9595
'rmarkdown', 'testthat', 'e1071', 'survival', 'arrow', \
9696
'ggplot2', 'mvtnorm', 'statmod', 'xml2'), repos='https://cloud.r-project.org/')" && \
97-
Rscript -e "devtools::install_version('roxygen2', version='7.2.0', repos='https://cloud.r-project.org')" && \
98-
Rscript -e "devtools::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')" && \
99-
Rscript -e "devtools::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')" && \
100-
Rscript -e "devtools::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')"
97+
Rscript -e "remotes::install_version('roxygen2', version='7.2.0', repos='https://cloud.r-project.org')" && \
98+
Rscript -e "remotes::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')" && \
99+
Rscript -e "remotes::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')" && \
100+
Rscript -e "remotes::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')"
101101

102102
# See more in SPARK-39735
103103
ENV R_LIBS_SITE="/usr/local/lib/R/site-library:${R_LIBS_SITE}:/usr/lib/R/library"

dev/infra/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ RUN gpg -a --export E084DAB9 | apt-key add -
7474
RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/'
7575

7676
# See more in SPARK-39959, roxygen2 < 7.2.1
77-
RUN Rscript -e "install.packages(c('devtools', 'knitr', 'markdown', \
78-
'rmarkdown', 'testthat', 'devtools', 'e1071', 'survival', 'arrow', \
79-
'ggplot2', 'mvtnorm', 'statmod', 'xml2', 'remotes'), repos='https://cloud.r-project.org/')" && \
80-
Rscript -e "devtools::install_version('roxygen2', version='7.2.0', repos='https://cloud.r-project.org')" && \
81-
Rscript -e "devtools::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')" && \
82-
Rscript -e "devtools::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')" && \
83-
Rscript -e "devtools::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')"
77+
RUN Rscript -e "install.packages(c('remotes', 'knitr', 'markdown', \
78+
'rmarkdown', 'testthat', 'e1071', 'survival', 'arrow', \
79+
'ggplot2', 'mvtnorm', 'statmod', 'xml2'), repos='https://cloud.r-project.org/')" && \
80+
Rscript -e "remotes::install_version('roxygen2', version='7.2.0', repos='https://cloud.r-project.org')" && \
81+
Rscript -e "remotes::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')" && \
82+
Rscript -e "remotes::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')" && \
83+
Rscript -e "remotes::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')"
8484

8585
# See more in SPARK-39735
8686
ENV R_LIBS_SITE="/usr/local/lib/R/site-library:${R_LIBS_SITE}:/usr/lib/R/library"

dev/spark-test-image/docs/Dockerfile

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -30,49 +30,49 @@ ENV DEBIAN_FRONTEND=noninteractive
3030
ENV DEBCONF_NONINTERACTIVE_SEEN=true
3131

3232
RUN apt-get update && apt-get install -y \
33-
build-essential \
34-
ca-certificates \
35-
cmake \
36-
curl \
37-
gfortran \
38-
git \
39-
gnupg \
40-
libcurl4-openssl-dev \
41-
libfontconfig1-dev \
42-
libfreetype6-dev \
43-
libfribidi-dev \
44-
libgit2-dev \
45-
libharfbuzz-dev \
46-
libjpeg-dev \
47-
liblapack-dev \
48-
libopenblas-dev \
49-
libpng-dev \
50-
libpython3-dev \
51-
libssl-dev \
52-
libtiff5-dev \
53-
libwebp-dev \
54-
libxml2-dev \
55-
nodejs \
56-
npm \
57-
openjdk-17-jdk-headless \
58-
pandoc \
59-
pkg-config \
60-
qpdf \
61-
tzdata \
62-
r-base \
63-
ruby \
64-
ruby-dev \
65-
software-properties-common \
66-
wget \
67-
zlib1g-dev \
68-
&& rm -rf /var/lib/apt/lists/*
33+
build-essential \
34+
ca-certificates \
35+
cmake \
36+
curl \
37+
gfortran \
38+
git \
39+
gnupg \
40+
libcurl4-openssl-dev \
41+
libfontconfig1-dev \
42+
libfreetype6-dev \
43+
libfribidi-dev \
44+
libgit2-dev \
45+
libharfbuzz-dev \
46+
libjpeg-dev \
47+
liblapack-dev \
48+
libopenblas-dev \
49+
libpng-dev \
50+
libpython3-dev \
51+
libssl-dev \
52+
libtiff5-dev \
53+
libwebp-dev \
54+
libxml2-dev \
55+
nodejs \
56+
npm \
57+
openjdk-17-jdk-headless \
58+
pandoc \
59+
pkg-config \
60+
qpdf \
61+
tzdata \
62+
r-base \
63+
ruby \
64+
ruby-dev \
65+
software-properties-common \
66+
wget \
67+
zlib1g-dev \
68+
&& rm -rf /var/lib/apt/lists/*
6969

7070

7171
# See more in SPARK-39959, roxygen2 < 7.2.1
72-
RUN Rscript -e "install.packages(c('devtools', 'knitr', 'markdown', 'rmarkdown', 'testthat', 'remotes'), repos='https://cloud.r-project.org/')" && \
73-
Rscript -e "devtools::install_version('roxygen2', version='7.2.0', repos='https://cloud.r-project.org')" && \
74-
Rscript -e "devtools::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')" && \
75-
Rscript -e "devtools::install_version('preferably', version='0.4', repos='https://cloud.r-project.org', upgrade='never')"
72+
RUN Rscript -e "install.packages(c('remotes', 'knitr', 'markdown', 'rmarkdown', 'testthat'), repos='https://cloud.r-project.org/')" && \
73+
Rscript -e "remotes::install_version('roxygen2', version='7.2.0', repos='https://cloud.r-project.org')" && \
74+
Rscript -e "remotes::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')" && \
75+
Rscript -e "remotes::install_version('preferably', version='0.4', repos='https://cloud.r-project.org', upgrade='never')"
7676

7777
# See more in SPARK-39735
7878
ENV R_LIBS_SITE="/usr/local/lib/R/site-library:${R_LIBS_SITE}:/usr/lib/R/library"

dev/spark-test-image/lint/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ RUN apt-get update && apt-get install -y \
6060
zlib1g-dev \
6161
&& rm -rf /var/lib/apt/lists/*
6262

63-
RUN Rscript -e "install.packages(c('devtools', 'knitr', 'markdown', 'rmarkdown', 'testthat', 'remotes'), repos='https://cloud.r-project.org/')" \
64-
&& Rscript -e "devtools::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')" \
65-
&& Rscript -e "devtools::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')" \
66-
&& Rscript -e "devtools::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')"
63+
RUN Rscript -e "install.packages(c('remotes', 'knitr', 'markdown', 'rmarkdown', 'testthat'), repos='https://cloud.r-project.org/')" \
64+
&& Rscript -e "remotes::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')" \
65+
&& Rscript -e "remotes::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')" \
66+
&& Rscript -e "remotes::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')"
6767

6868
# See more in SPARK-39735
6969
ENV R_LIBS_SITE="/usr/local/lib/R/site-library:${R_LIBS_SITE}:/usr/lib/R/library"

dev/spark-test-image/sparkr/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ RUN gpg -a --export E084DAB9 | apt-key add -
6767
RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/'
6868

6969
# See more in SPARK-39959, roxygen2 < 7.2.1
70-
RUN Rscript -e "install.packages(c('devtools', 'knitr', 'markdown', \
71-
'rmarkdown', 'testthat', 'devtools', 'e1071', 'survival', 'arrow', \
72-
'ggplot2', 'mvtnorm', 'statmod', 'xml2', 'remotes'), repos='https://cloud.r-project.org/')" && \
73-
Rscript -e "devtools::install_version('roxygen2', version='7.2.0', repos='https://cloud.r-project.org')" && \
74-
Rscript -e "devtools::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')" && \
75-
Rscript -e "devtools::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')" && \
76-
Rscript -e "devtools::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')"
70+
RUN Rscript -e "install.packages(c('remotes', 'knitr', 'markdown', \
71+
'rmarkdown', 'testthat', 'e1071', 'survival', 'arrow', \
72+
'ggplot2', 'mvtnorm', 'statmod', 'xml2'), repos='https://cloud.r-project.org/')" && \
73+
Rscript -e "remotes::install_version('roxygen2', version='7.2.0', repos='https://cloud.r-project.org')" && \
74+
Rscript -e "remotes::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')" && \
75+
Rscript -e "remotes::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')" && \
76+
Rscript -e "remotes::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')"
7777

7878
# See more in SPARK-39735
7979
ENV R_LIBS_SITE="/usr/local/lib/R/site-library:${R_LIBS_SITE}:/usr/lib/R/library"

0 commit comments

Comments
 (0)