Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] Release v3.3.3 #5525

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 3.3.2.99.{build}
version: 3.3.3.{build}

image: Visual Studio 2015
platform: x64
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ jobs:
compiler: gcc
python_version: "3.10"
cuda_version: "9.0"
task: cuda
- method: source
compiler: gcc
python_version: "3.8"
cuda_version: "11.7.1"
task: cuda_exp
- method: pip
compiler: clang
python_version: "3.9"
cuda_version: "10.0"
task: cuda_exp
# task: cuda
# - method: source
# compiler: gcc
# python_version: "3.8"
# cuda_version: "11.7.1"
# task: cuda_exp
# - method: pip
# compiler: clang
# python_version: "3.9"
# cuda_version: "10.0"
# task: cuda_exp
steps:
- name: Setup or update software on host machine
run: |
Expand Down
10 changes: 6 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
version: 2
build:
os: "ubuntu-20.04"
tools:
python: "miniconda3-4.7"
conda:
environment: docs/env.yml
formats:
- pdf
python:
version: 3
install:
- requirements: docs/requirements.txt
sphinx:
builder: html
configuration: docs/conf.py
Expand Down
18 changes: 9 additions & 9 deletions R-package/configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for lightgbm 3.3.2.
# Generated by GNU Autoconf 2.69 for lightgbm 3.3.3.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -576,8 +576,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='lightgbm'
PACKAGE_TARNAME='lightgbm'
PACKAGE_VERSION='3.3.2'
PACKAGE_STRING='lightgbm 3.3.2'
PACKAGE_VERSION='3.3.3'
PACKAGE_STRING='lightgbm 3.3.3'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -1182,7 +1182,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures lightgbm 3.3.2 to adapt to many kinds of systems.
\`configure' configures lightgbm 3.3.3 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1244,7 +1244,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of lightgbm 3.3.2:";;
short | recursive ) echo "Configuration of lightgbm 3.3.3:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1311,7 +1311,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
lightgbm configure 3.3.2
lightgbm configure 3.3.3
generated by GNU Autoconf 2.69

Copyright (C) 2012 Free Software Foundation, Inc.
Expand All @@ -1328,7 +1328,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by lightgbm $as_me 3.3.2, which was
It was created by lightgbm $as_me 3.3.3, which was
generated by GNU Autoconf 2.69. Invocation command line was

$ $0 $@
Expand Down Expand Up @@ -2398,7 +2398,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by lightgbm $as_me 3.3.2, which was
This file was extended by lightgbm $as_me 3.3.3, which was
generated by GNU Autoconf 2.69. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -2451,7 +2451,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
lightgbm config.status 3.3.2
lightgbm config.status 3.3.3
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

Expand Down
25 changes: 14 additions & 11 deletions R-package/src/install.libs.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# User options
use_gpu <- FALSE
make_args_from_build_script <- character(0L)

# For Windows, the package will be built with Visual Studio
# unless you set one of these to TRUE
Expand All @@ -22,6 +23,11 @@ if (!(R_int_UUID == "0310d4b8-ccb1-4bb8-ba94-d36a55f60262"
warning("Warning: unmatched R_INTERNALS_UUID, may not run normally.")
}

# Get some paths
source_dir <- file.path(R_PACKAGE_SOURCE, "src", fsep = "/")
build_dir <- file.path(source_dir, "build", fsep = "/")
inst_dir <- file.path(R_PACKAGE_SOURCE, "inst", fsep = "/")

# system() will not raise an R exception if the process called
# fails. Wrapping it here to get that behavior.
#
Expand All @@ -31,7 +37,7 @@ if (!(R_int_UUID == "0310d4b8-ccb1-4bb8-ba94-d36a55f60262"
on_windows <- .Platform$OS.type == "windows"
has_processx <- suppressMessages({
suppressWarnings({
require("processx") # nolint
require("processx") # nolint: undesirable_function
})
})
if (has_processx && on_windows) {
Expand Down Expand Up @@ -64,7 +70,8 @@ if (!(R_int_UUID == "0310d4b8-ccb1-4bb8-ba94-d36a55f60262"
# try to generate Visual Studio build files
.generate_vs_makefiles <- function(cmake_args) {
vs_versions <- c(
"Visual Studio 16 2019"
"Visual Studio 17 2022"
, "Visual Studio 16 2019"
, "Visual Studio 15 2017"
, "Visual Studio 14 2015"
)
Expand Down Expand Up @@ -94,18 +101,14 @@ if (!(R_int_UUID == "0310d4b8-ccb1-4bb8-ba94-d36a55f60262"

# Move in CMakeLists.txt
write_succeeded <- file.copy(
"../inst/bin/CMakeLists.txt"
file.path(inst_dir, "bin", "CMakeLists.txt")
, "CMakeLists.txt"
, overwrite = TRUE
)
if (!write_succeeded) {
stop("Copying CMakeLists.txt failed")
}

# Get some paths
source_dir <- file.path(R_PACKAGE_SOURCE, "src", fsep = "/")
build_dir <- file.path(source_dir, "build", fsep = "/")

# Prepare building package
dir.create(
build_dir
Expand All @@ -120,7 +123,7 @@ use_visual_studio <- !(use_mingw || use_msys2)
# to create R.def from R.dll
if (WINDOWS && use_visual_studio) {
write_succeeded <- file.copy(
"../../inst/make-r-def.R"
file.path(inst_dir, "make-r-def.R")
, file.path(build_dir, "make-r-def.R")
, overwrite = TRUE
)
Expand All @@ -132,7 +135,7 @@ if (WINDOWS && use_visual_studio) {
# Prepare installation steps
cmake_args <- NULL
build_cmd <- "make"
build_args <- "_lightgbm"
build_args <- c("_lightgbm", make_args_from_build_script)
lib_folder <- file.path(source_dir, fsep = "/")

# add in command-line arguments
Expand Down Expand Up @@ -194,7 +197,7 @@ if (WINDOWS) {
cmake_args <- c(cmake_args, "-G", shQuote(windows_makefile_generator))
.run_shell_command("cmake", c(cmake_args, ".."), strict = FALSE)
build_cmd <- windows_build_tool
build_args <- "_lightgbm"
build_args <- c("_lightgbm", make_args_from_build_script)
} else {
visual_studio_succeeded <- .generate_vs_makefiles(cmake_args)
if (!isTRUE(visual_studio_succeeded)) {
Expand All @@ -203,7 +206,7 @@ if (WINDOWS) {
cmake_args <- c(cmake_args, "-G", shQuote(windows_makefile_generator))
.run_shell_command("cmake", c(cmake_args, ".."), strict = FALSE)
build_cmd <- windows_build_tool
build_args <- "_lightgbm"
build_args <- c("_lightgbm", make_args_from_build_script)
} else {
build_cmd <- "cmake"
build_args <- c("--build", ".", "--target", "_lightgbm", "--config", "Release")
Expand Down
13 changes: 12 additions & 1 deletion R-package/tests/testthat/test_basic.R
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,18 @@ test_that("lgb.train() supports non-ASCII feature names", {
data = matrix(rnorm(400L), ncol = 4L)
, label = rnorm(100L)
)
feature_names <- c("F_零", "F_一", "F_二", "F_三")
# content below is equivalent to
#
# feature_names <- c("F_零", "F_一", "F_二", "F_三")
#
# but using rawToChar() to avoid weird issues when {testthat}
# sources files and converts their encodings prior to evaluating the code
feature_names <- c(
rawToChar(as.raw(c(0x46, 0x5f, 0xe9, 0x9b, 0xb6)))
, rawToChar(as.raw(c(0x46, 0x5f, 0xe4, 0xb8, 0x80)))
, rawToChar(as.raw(c(0x46, 0x5f, 0xe4, 0xba, 0x8c)))
, rawToChar(as.raw(c(0x46, 0x5f, 0xe4, 0xb8, 0x89)))
)
bst <- lgb.train(
data = dtrain
, nrounds = 5L
Expand Down
4 changes: 4 additions & 0 deletions R-package/tests/testthat/test_dataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ test_that("lgb.Dataset: Dataset should be able to construct from matrix and retu
})

test_that("cpp errors should be raised as proper R errors", {
testthat::skip_if(
Sys.getenv("COMPILER", "") == "MSVC" && as.integer(R.Version()[["major"]]) < 4L
, message = "Skipping on R 3.x and Visual Studio"
)
data(agaricus.train, package = "lightgbm")
train <- agaricus.train
dtrain <- lgb.Dataset(
Expand Down
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.2
3.3.3
2 changes: 1 addition & 1 deletion build-cran-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
set -e

# Default values of arguments
BUILD_VIGNETTES=true
BUILD_VIGNETTES=false
LGB_R_EXECUTABLE=R

while [ $# -gt 0 ]; do
Expand Down
2 changes: 1 addition & 1 deletion build_r.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ TEMP_SOURCE_DIR <- file.path(TEMP_R_DIR, "src")
}
parsed_args <- .parse_args(args)

SKIP_VIGNETTES <- "--no-build-vignettes" %in% parsed_args[["flags"]]
SKIP_VIGNETTES <- TRUE
USING_GPU <- "--use-gpu" %in% parsed_args[["flags"]]
USING_MINGW <- "--use-mingw" %in% parsed_args[["flags"]]
USING_MSYS2 <- "--use-msys2" %in% parsed_args[["flags"]]
Expand Down
40 changes: 19 additions & 21 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from shutil import copytree
from subprocess import PIPE, Popen
from typing import Any, List
from unittest.mock import Mock

import sphinx
from docutils.nodes import reference
Expand All @@ -40,12 +39,6 @@

INTERNAL_REF_REGEX = compile(r"(?P<url>\.\/.+)(?P<extension>\.rst)(?P<anchor>$|#)")

# -- mock out modules
MOCK_MODULES = ['numpy', 'scipy', 'scipy.sparse',
'sklearn', 'matplotlib', 'pandas', 'graphviz', 'dask', 'dask.distributed']
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock()


class InternalRefTransform(Transform):
"""Replaces '.rst' with '.html' in all internal links like './[Something].rst[#anchor]'."""
Expand Down Expand Up @@ -99,7 +92,22 @@ def run(self) -> List:
"inherited-members": True,
"show-inheritance": True,
}

# mock out modules
autodoc_mock_imports = [
'dask',
'dask.distributed',
'datatable',
'graphviz',
'matplotlib',
'numpy',
'pandas',
'scipy',
'scipy.sparse',
]
try:
import sklearn
except ImportError:
autodoc_mock_imports.append('sklearn')
# hide type hints in API docs
autodoc_typehints = "none"

Expand Down Expand Up @@ -142,7 +150,7 @@ def run(self) -> List:
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down Expand Up @@ -254,18 +262,6 @@ def generate_r_docs(app: Sphinx) -> None:
The application object representing the Sphinx process.
"""
commands = f"""
/home/docs/.conda/bin/conda create \
-q \
-y \
-c conda-forge \
-n r_env \
r-base=4.1.0=hb67fd72_2 \
r-data.table=1.14.0=r41hcfec24a_0 \
r-jsonlite=1.7.2=r41hcfec24a_0 \
r-matrix=1.3_4=r41he454529_0 \
r-pkgdown=1.6.1=r41hc72bb7e_0 \
r-roxygen2=7.1.1=r41h03ef668_0
source /home/docs/.conda/bin/activate r_env
export TAR=/bin/tar
cd {CURR_PATH.parent}
export R_LIBS="$CONDA_PREFIX/lib/R/library"
Expand All @@ -290,6 +286,7 @@ def generate_r_docs(app: Sphinx) -> None:
cd {CURR_PATH.parent}
"""
try:
print("Building R-package documentation")
# Warning! The following code can cause buffer overflows on RTD.
# Consider suppressing output completely if RTD project silently fails.
# Refer to https://github.com/svenevs/exhale
Expand All @@ -303,6 +300,7 @@ def generate_r_docs(app: Sphinx) -> None:
raise RuntimeError(output)
else:
print(output)
print("Done building R-package documentation")
except BaseException as e:
raise Exception(f"An error has occurred while generating documentation for R-package\n{e}")

Expand Down
18 changes: 18 additions & 0 deletions docs/env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: docs-env
channels:
- nodefaults
- conda-forge
dependencies:
- breathe
- python=3.9
- r-base=4.1.3
- r-data.table=1.14.2
- r-jsonlite=1.7.2
- r-knitr=1.37
- r-matrix=1.4_0
- r-pkgdown=1.6.1
- r-rmarkdown=2.11
- r-roxygen2=7.2.1
- scikit-learn
- sphinx
- "sphinx_rtd_theme>=0.5"