Skip to content

Commit

Permalink
[R-package] [docs] remove devtools dependency for docs builds (fixes #…
Browse files Browse the repository at this point in the history
…3036) (#3072)

* [R-package] [docs] remove devtools dependency for docs builds

* linting

* updating docs conda env

* empty roxygenize()

* env for R libraries

* get logs

* remove comment

* added pkgdown URLs

* more paths

* fix incorrect YAML keys

* update DESCRIPTION URL link

* more URL changes

* revert DESCRIPTION changes

* remove ca-certificates

* empty commit

* Update docs/conf.py

Co-authored-by: Nikita Titov <[email protected]>

* empty commit

* remove outdated line in build_r.R

Co-authored-by: Nikita Titov <[email protected]>
  • Loading branch information
jameslamb and StrikerRUS authored May 14, 2020
1 parent 3caf359 commit 9085f4e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 19 deletions.
7 changes: 7 additions & 0 deletions R-package/pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ site:
root: ''
title: LightGBM, Light Gradient Boosting Machine

repo:
url:
home: https://github.com/microsoft/LightGBM/
source: https://github.com/microsoft/LightGBM/tree/master/R-package/
issue: https://github.com/microsoft/LightGBM/issues/
user: https://github.com/

development:
mode: unreleased

Expand Down
6 changes: 0 additions & 6 deletions R-package/pkgdown/extra.js

This file was deleted.

1 change: 0 additions & 1 deletion build_r.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ result <- file.copy(
)
.handle_result(result)

# Build the package (do not touch this line!)
# NOTE: --keep-empty-dirs is necessary to keep the deep paths expected
# by CMake while also meeting the CRAN req to create object files
# on demand
Expand Down
13 changes: 7 additions & 6 deletions build_r_site.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
library(pkgdown)
library(roxygen2)

setwd("lightgbm_r")
if (!dir.exists("docs")) {
dir.create("docs")
}

devtools::document()
clean_site()
init_site()
build_home(preview = FALSE, quiet = FALSE)
build_reference(
roxygen2::roxygenize(load = "installed")
pkgdown::clean_site()
pkgdown::init_site()
pkgdown::build_home(preview = FALSE, quiet = FALSE)
pkgdown::build_reference(
lazy = FALSE
, document = FALSE
, devel = FALSE
, examples = TRUE
, run_dont_run = FALSE
, seed = 42L
Expand Down
10 changes: 4 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,20 +227,18 @@ def generate_r_docs(app):
echo 'options(repos = "https://cran.rstudio.com")' > $HOME/.Rprofile
/home/docs/.conda/bin/conda create -q -y -n r_env \
r-base=3.5.1=h1e0a451_2 \
r-devtools=1.13.6=r351h6115d3f_0 \
r-jsonlite=1.5=r351h96ca727_0 \
r-matrix=1.2_14=r351h96ca727_0 \
r-testthat=2.0.0=r351h29659fb_0 \
cmake=3.14.0=h52cb24c_0 \
ca-certificates=2019.11.27=0
cmake=3.14.0=h52cb24c_0
/home/docs/.conda/bin/conda install -q -y -n r_env -c conda-forge \
r-data.table=1.12.8=r35hcdcec82_0 \
r-pkgdown=1.3.0=r35h6115d3f_1001 \
r-roxygen2=6.1.1=r35h0357c0b_1001
r-pkgdown=1.5.1=r35h6115d3f_0 \
r-roxygen2=7.1.0=r35h0357c0b_0
source /home/docs/.conda/bin/activate r_env
export TAR=/bin/tar
cd {0}
sed -i'.bak' '/# Build the package (do not touch this line!)/q' build_r.R
export R_LIBS="$CONDA_PREFIX/lib/R/library"
Rscript build_r.R
Rscript build_r_site.R
""".format(os.path.join(CURR_PATH, os.path.pardir))
Expand Down

0 comments on commit 9085f4e

Please sign in to comment.