Skip to content

Commit 2a56312

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 092f02d commit 2a56312

10 files changed

Lines changed: 25 additions & 26 deletions

File tree

.github/workflows/build_and_test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -689,8 +689,8 @@ jobs:
689689
apt-get install -y libcurl4-openssl-dev libgit2-dev libssl-dev libxml2-dev \
690690
libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev \
691691
libtiff5-dev libjpeg-dev
692-
Rscript -e "install.packages(c('devtools'), repos='https://cloud.r-project.org/')"
693-
Rscript -e "devtools::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')"
692+
Rscript -e "install.packages(c('remotes'), repos='https://cloud.r-project.org/')"
693+
Rscript -e "remotes::install_version('lintr', version='2.0.1', repos='https://cloud.r-project.org')"
694694
./R/install-dev.sh
695695
- name: Install dependencies for documentation generation
696696
run: |
@@ -708,9 +708,9 @@ jobs:
708708
python3.9 -m pip install 'docutils<0.18.0' # See SPARK-39421
709709
apt-get update -y
710710
apt-get install -y ruby ruby-dev
711-
Rscript -e "install.packages(c('devtools', 'testthat', 'knitr', 'rmarkdown', 'markdown', 'e1071', 'roxygen2', 'ggplot2', 'mvtnorm', 'statmod'), repos='https://cloud.r-project.org/')"
712-
Rscript -e "devtools::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')"
713-
Rscript -e "devtools::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')"
711+
Rscript -e "install.packages(c('remotes', 'testthat', 'knitr', 'rmarkdown', 'markdown', 'e1071', 'roxygen2', 'ggplot2', 'mvtnorm', 'statmod'), repos='https://cloud.r-project.org/')"
712+
Rscript -e "remotes::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')"
713+
Rscript -e "remotes::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')"
714714
gem install bundler -v 2.4.22
715715
cd docs
716716
bundle install

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/ansible-for-test-node/roles/jenkins-worker/tasks/install_spark_build_packages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
loop:
166166
- digest
167167
- knitr
168-
- devtools
168+
- remotes
169169
- plyr
170170
- roxygen2
171171
- rmarkdown
@@ -179,5 +179,5 @@
179179
register: r_check
180180

181181
- name: install lintr v2.0.0
182-
command: /usr/bin/Rscript --no-echo --no-save --no-restore-history -e "devtools::install_github('jimhester/lintr@v2.0.0')"
182+
command: /usr/bin/Rscript --no-echo --no-save --no-restore-history -e "remotes::install_github('jimhester/lintr@v2.0.0')"
183183
when: "'lintr' not in r_check.stdout"

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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ RUN gpg -a --export E084DAB9 | apt-key add -
5252
RUN add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/'
5353
RUN apt update
5454
RUN $APT_INSTALL r-base libcurl4-openssl-dev qpdf libssl-dev zlib1g-dev
55-
RUN Rscript -e "install.packages(c('knitr', 'markdown', 'rmarkdown', 'testthat', 'devtools', 'e1071', 'survival', 'arrow', 'roxygen2', 'xml2'), repos='https://cloud.r-project.org/')"
55+
RUN Rscript -e "install.packages(c('remotes', 'knitr', 'markdown', 'rmarkdown', 'testthat', 'e1071', 'survival', 'arrow', 'roxygen2', 'xml2'), repos='https://cloud.r-project.org/')"
5656

5757
# See more in SPARK-39959, roxygen2 < 7.2.1
5858
RUN apt-get install -y libcurl4-openssl-dev libgit2-dev libssl-dev libxml2-dev \
5959
libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev \
6060
libtiff5-dev libjpeg-dev
61-
RUN Rscript -e "install.packages(c('devtools'), repos='https://cloud.r-project.org/')"
62-
RUN Rscript -e "devtools::install_version('roxygen2', version='7.2.0', repos='https://cloud.r-project.org')"
61+
RUN Rscript -e "install.packages(c('remotes'), repos='https://cloud.r-project.org/')"
62+
RUN Rscript -e "remotes::install_version('roxygen2', version='7.2.0', repos='https://cloud.r-project.org')"
6363

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

docs/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ If you'd like to generate R API documentation, you'll need to [install Pandoc](h
7070
and install these libraries:
7171

7272
```sh
73-
$ sudo Rscript -e 'install.packages(c("knitr", "devtools", "testthat", "rmarkdown"), repos="https://cloud.r-project.org/")'
74-
$ sudo Rscript -e 'devtools::install_version("roxygen2", version = "7.1.2", repos="https://cloud.r-project.org/")'
75-
$ sudo Rscript -e "devtools::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')"
76-
$ sudo Rscript -e "devtools::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')"
73+
$ sudo Rscript -e 'install.packages(c("remotes", "knitr", "testthat", "rmarkdown"), repos="https://cloud.r-project.org/")'
74+
$ sudo Rscript -e 'remotes::install_version("roxygen2", version = "7.1.2", repos="https://cloud.r-project.org/")'
75+
$ sudo Rscript -e "remotes::install_version('pkgdown', version='2.0.1', repos='https://cloud.r-project.org')"
76+
$ sudo Rscript -e "remotes::install_version('preferably', version='0.4', repos='https://cloud.r-project.org')"
7777
```
7878

7979
Note: Other versions of roxygen2 might work in SparkR documentation generation but `RoxygenNote` field in `$SPARK_HOME/R/pkg/DESCRIPTION` is 7.1.2, which is updated if the version is mismatched.

docs/building-spark.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ The run-tests script also can be limited to a specific Python version or a speci
241241

242242
To run the SparkR tests you will need to install the [knitr](https://cran.r-project.org/package=knitr), [rmarkdown](https://cran.r-project.org/package=rmarkdown), [testthat](https://cran.r-project.org/package=testthat), [e1071](https://cran.r-project.org/package=e1071) and [survival](https://cran.r-project.org/package=survival) packages first:
243243

244-
Rscript -e "install.packages(c('knitr', 'rmarkdown', 'devtools', 'testthat', 'e1071', 'survival'), repos='https://cloud.r-project.org/')"
244+
Rscript -e "install.packages(c('knitr', 'rmarkdown', 'testthat', 'e1071', 'survival'), repos='https://cloud.r-project.org/')"
245245

246246
You can run just the SparkR tests using the command:
247247

0 commit comments

Comments
 (0)