Unverified Commit 9085f4e2 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[R-package] [docs] remove devtools dependency for docs builds (fixes #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: default avatarNikita Titov <nekit94-08@mail.ru>

* empty commit

* remove outdated line in build_r.R
Co-authored-by: default avatarNikita Titov <nekit94-08@mail.ru>
parent 3caf359a
......@@ -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
......
$(function() {
if(window.location.pathname.toLocaleLowerCase().indexOf('/r/reference') != -1) {
/* Replace '/R/' with '/R-package/R/' in all external links to .R files of LightGBM GitHub repo */
$('a[href^="https://github.com/Microsoft/LightGBM/blob/master/R"][href*=".R"]').attr('href', (i, val) => { return val.replace('/R/', '/R-package/R/'); });
}
});
......@@ -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
......
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
......
......@@ -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))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment