[R] [ci] remove dependency on {devtools} (#8563)

This commit is contained in:
James Lamb 2022-12-08 11:21:28 -06:00 committed by GitHub
parent fbe40d00d8
commit ffee35e0f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 7 deletions

View File

@ -65,4 +65,5 @@ Imports:
data.table (>= 1.9.6),
jsonlite (>= 1.0),
RoxygenNote: 7.2.2
Encoding: UTF-8
SystemRequirements: GNU make, C++14

View File

@ -1,5 +1,4 @@
# install development version of caret library that contains xgboost models
devtools::install_github("topepo/caret/pkg/caret")
require(caret)
require(xgboost)
require(data.table)

View File

@ -3,7 +3,9 @@
## inconsistent is found.
pkgs <- c(
## CI
"devtools",
"caret",
"pkgbuild",
"roxygen2",
"XML",
"cplm",
"e1071",

View File

@ -16,7 +16,7 @@ The parameter `nthread` controls the number of cores to run on, please set it to
To install the R-package of xgboost, please run
```r
devtools::install_github('tqchen/xgboost',subdir='R-package')
install.packages("xgboost", repos = "https://cran.r-project.org")
```
Windows users may need to install [RTools](http://cran.r-project.org/bin/windows/Rtools/) first.

View File

@ -313,7 +313,7 @@ Installing the development version (Linux / Mac OSX)
Make sure you have installed git and a recent C++ compiler supporting C++11 (See above
sections for requirements of building C++ core).
Due to the use of git-submodules, ``devtools::install_github`` can no longer be used to
Due to the use of git-submodules, ``remotes::install_github()`` cannot be used to
install the latest version of R package. Thus, one has to run git to check out the code
first, see :ref:`get_source` on how to initialize the git repository for XGBoost. The
simplest way to install the R package after obtaining the source code is:

View File

@ -152,15 +152,16 @@ def check_rmarkdown() -> None:
assert system() != "Windows", "Document test doesn't support Windows."
env = os.environ.copy()
env.update({"MAKEFLAGS": f"-j{os.cpu_count()}"})
print("Checking R document with devtools.")
print("Checking R documentation.")
bin_dir = os.path.dirname(R)
rscript = os.path.join(bin_dir, "Rscript")
subprocess.check_call([rscript, "-e", "devtools::document()"], env=env)
subprocess.check_call([rscript, "-e", "roxygen2::roxygenize()"], env=env)
output = subprocess.run(["git", "diff", "--name-only"], capture_output=True)
if len(output.stdout.decode("utf-8").strip()) != 0:
output = subprocess.run(["git", "diff"], capture_output=True)
raise ValueError(
"Please run `devtools::document()`. Diff:\n", output.stdout.decode("utf-8")
"Please run `roxygen2::roxygenize()`. Diff:\n",
output.stdout.decode("utf-8"),
)