[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), data.table (>= 1.9.6),
jsonlite (>= 1.0), jsonlite (>= 1.0),
RoxygenNote: 7.2.2 RoxygenNote: 7.2.2
Encoding: UTF-8
SystemRequirements: GNU make, C++14 SystemRequirements: GNU make, C++14

View File

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

View File

@ -3,7 +3,9 @@
## inconsistent is found. ## inconsistent is found.
pkgs <- c( pkgs <- c(
## CI ## CI
"devtools", "caret",
"pkgbuild",
"roxygen2",
"XML", "XML",
"cplm", "cplm",
"e1071", "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 To install the R-package of xgboost, please run
```r ```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. 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 Make sure you have installed git and a recent C++ compiler supporting C++11 (See above
sections for requirements of building C++ core). 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 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 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: 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." assert system() != "Windows", "Document test doesn't support Windows."
env = os.environ.copy() env = os.environ.copy()
env.update({"MAKEFLAGS": f"-j{os.cpu_count()}"}) env.update({"MAKEFLAGS": f"-j{os.cpu_count()}"})
print("Checking R document with devtools.") print("Checking R documentation.")
bin_dir = os.path.dirname(R) bin_dir = os.path.dirname(R)
rscript = os.path.join(bin_dir, "Rscript") 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) output = subprocess.run(["git", "diff", "--name-only"], capture_output=True)
if len(output.stdout.decode("utf-8").strip()) != 0: if len(output.stdout.decode("utf-8").strip()) != 0:
output = subprocess.run(["git", "diff"], capture_output=True) output = subprocess.run(["git", "diff"], capture_output=True)
raise ValueError( raise ValueError(
"Please run `devtools::document()`. Diff:\n", output.stdout.decode("utf-8") "Please run `roxygen2::roxygenize()`. Diff:\n",
output.stdout.decode("utf-8"),
) )