Skip to content

Commit 4e672cf

Browse files
committed
[SPARK-56500][R] Replace devtools to remotes in SparkR
### What changes were proposed in this pull request? Replaces `devtools` to `remotes` which is lighter. It does not fix CRAN related because we don't release on CRAN anymore. ### Why are the changes needed? - 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. ### Does this PR introduce _any_ user-facing change? No, dev-only. ### How was this patch tested? Will minotior the CI. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #55362 from HyukjinKwon/SPARK-56500. Authored-by: Hyukjin Kwon <gurwls223@apache.org> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
1 parent 22d63c7 commit 4e672cf

File tree

12 files changed

+42
-43
lines changed

12 files changed

+42
-43
lines changed

.github/workflows/build_and_test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,8 +1000,8 @@ jobs:
10001000
apt-get install -y libcurl4-openssl-dev libgit2-dev libssl-dev libxml2-dev \
10011001
libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev \
10021002
libtiff5-dev libjpeg-dev
1003-
Rscript -e "install.packages(c('devtools'), repos='https://cloud.r-project.org/')"
1004-
Rscript -e "devtools::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')"
1003+
Rscript -e "install.packages(c('remotes'), repos='https://cloud.r-project.org/')"
1004+
Rscript -e "remotes::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')"
10051005
- name: Install R linter dependencies and SparkR
10061006
run: ./R/install-dev.sh
10071007
- name: R linter
@@ -1116,9 +1116,9 @@ jobs:
11161116
apt-get update -y
11171117
apt-get install -y libcurl4-openssl-dev pandoc
11181118
apt-get install -y ruby ruby-dev
1119-
Rscript -e "install.packages(c('devtools', 'testthat', 'knitr', 'rmarkdown', 'markdown', 'e1071', 'roxygen2', 'ggplot2', 'mvtnorm', 'statmod'), repos='https://cloud.r-project.org/')"
1120-
Rscript -e "devtools::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')"
1121-
Rscript -e "devtools::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')"
1119+
Rscript -e "install.packages(c('remotes', 'testthat', 'knitr', 'rmarkdown', 'markdown', 'e1071', 'roxygen2', 'ggplot2', 'mvtnorm', 'statmod'), repos='https://cloud.r-project.org/')"
1120+
Rscript -e "remotes::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')"
1121+
Rscript -e "remotes::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')"
11221122
# Should unpin 'sphinxcontrib-*' after upgrading sphinx>5
11231123
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'
11241124
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: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ RUN apt-get update && apt-get install -y \
7272
&& rm -rf /var/lib/apt/lists/*
7373

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

8080
# See more in SPARK-39735
8181
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
@@ -64,10 +64,10 @@ RUN apt-get update && apt-get install -y \
6464
&& apt-get clean \
6565
&& rm -rf /var/lib/apt/lists/*
6666

67-
RUN Rscript -e "install.packages(c('devtools', 'knitr', 'markdown', 'rmarkdown', 'testthat', 'remotes'), repos='https://cloud.r-project.org/')" \
68-
&& Rscript -e "devtools::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')" \
69-
&& Rscript -e "devtools::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')" \
70-
&& Rscript -e "devtools::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')"
67+
RUN Rscript -e "install.packages(c('remotes', 'knitr', 'markdown', 'rmarkdown', 'testthat'), repos='https://cloud.r-project.org/')" \
68+
&& Rscript -e "remotes::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')" \
69+
&& Rscript -e "remotes::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')" \
70+
&& Rscript -e "remotes::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')"
7171

7272
# See more in SPARK-39735
7373
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)