Skip to content

Commit 0a631ad

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> (cherry picked from commit 84e6954) Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
1 parent c89c7ad commit 0a631ad

12 files changed

Lines changed: 42 additions & 43 deletions

File tree

.github/workflows/build_and_test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -890,8 +890,8 @@ jobs:
890890
apt-get install -y libcurl4-openssl-dev libgit2-dev libssl-dev libxml2-dev \
891891
libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev \
892892
libtiff5-dev libjpeg-dev
893-
Rscript -e "install.packages(c('devtools'), repos='https://cloud.r-project.org/')"
894-
Rscript -e "devtools::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')"
893+
Rscript -e "install.packages(c('remotes'), repos='https://cloud.r-project.org/')"
894+
Rscript -e "remotes::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')"
895895
- name: Install R linter dependencies and SparkR
896896
run: ./R/install-dev.sh
897897
- name: R linter
@@ -970,9 +970,9 @@ jobs:
970970
apt-get update -y
971971
apt-get install -y libcurl4-openssl-dev pandoc
972972
apt-get install -y ruby ruby-dev
973-
Rscript -e "install.packages(c('devtools', 'testthat', 'knitr', 'rmarkdown', 'markdown', 'e1071', 'roxygen2', 'ggplot2', 'mvtnorm', 'statmod'), repos='https://cloud.r-project.org/')"
974-
Rscript -e "devtools::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')"
975-
Rscript -e "devtools::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')"
973+
Rscript -e "install.packages(c('remotes', 'testthat', 'knitr', 'rmarkdown', 'markdown', 'e1071', 'roxygen2', 'ggplot2', 'mvtnorm', 'statmod'), repos='https://cloud.r-project.org/')"
974+
Rscript -e "remotes::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')"
975+
Rscript -e "remotes::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')"
976976
# Should unpin 'sphinxcontrib-*' after upgrading sphinx>5
977977
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'
978978
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
@@ -68,10 +68,10 @@ RUN apt-get update && apt-get install -y \
6868

6969

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

7676
# See more in SPARK-39735
7777
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
@@ -59,10 +59,10 @@ RUN apt-get update && apt-get install -y \
5959
zlib1g-dev \
6060
&& rm -rf /var/lib/apt/lists/*
6161

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

6767
# See more in SPARK-39735
6868
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)