From 51e55ef2c9ee6baeb0a398937ac963e99313a7c2 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Mon, 3 Feb 2025 19:35:24 +0300 Subject: [PATCH 1/8] dev --- .ci/test.sh | 12 ++-- .github/workflows/static_analysis.yml | 97 ++++++++++++++------------- .pre-commit-config.yaml | 4 ++ 3 files changed, 59 insertions(+), 54 deletions(-) diff --git a/.ci/test.sh b/.ci/test.sh index a33851205176..c1ec65739f42 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -117,12 +117,12 @@ if [[ $TASK == "lint" ]]; then source activate "${CONDA_ENV}" echo "Linting Python and bash code" bash ./.ci/lint-python-bash.sh || exit 1 - echo "Linting R code" - Rscript ./.ci/lint-r-code.R "${BUILD_DIRECTORY}" || exit 1 - echo "Linting C++ code" - bash ./.ci/lint-cpp.sh || exit 1 - echo "Linting JavaScript code" - bash ./.ci/lint-js.sh || exit 1 + # echo "Linting R code" + # Rscript ./.ci/lint-r-code.R "${BUILD_DIRECTORY}" || exit 1 + # echo "Linting C++ code" + # bash ./.ci/lint-cpp.sh || exit 1 + # echo "Linting JavaScript code" + # bash ./.ci/lint-js.sh || exit 1 exit 0 fi diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 69b5b8df004d..062afb1fd87e 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -6,6 +6,7 @@ on: push: branches: - master + - ci/pyproject-lint pull_request: branches: - master @@ -31,7 +32,7 @@ jobs: matrix: include: - task: lint - - task: check-docs + # - task: check-docs steps: - name: Checkout repository uses: actions/checkout@v4 @@ -47,50 +48,50 @@ jobs: export PATH=${CONDA}/bin:$HOME/.local/bin:${PATH} $GITHUB_WORKSPACE/.ci/setup.sh || exit 1 $GITHUB_WORKSPACE/.ci/test.sh || exit 1 - r-check-docs: - name: r-package-check-docs - timeout-minutes: 60 - runs-on: ubuntu-latest - container: rocker/verse - steps: - - name: Trust git cloning LightGBM - run: | - git config --global --add safe.directory "${GITHUB_WORKSPACE}" - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 5 - submodules: true - - name: Install packages - shell: bash - # yamllint disable rule:line-length - run: | - Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())" - sh build-cran-package.sh || exit 1 - R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit 1 - # yamllint enable rule:line-length - - name: Test documentation - shell: bash --noprofile --norc {0} - run: | - Rscript --vanilla -e "roxygen2::roxygenize('R-package/', load = 'installed')" || exit 1 - num_doc_files_changed=$( - git diff --name-only | grep --count -E "\.Rd|NAMESPACE" - ) - if [[ ${num_doc_files_changed} -gt 0 ]]; then - echo "Some R documentation files have changed. Please re-generate them and commit those changes." - echo "" - echo " sh build-cran-package.sh" - echo " R CMD INSTALL --with-keep.source lightgbm_*.tar.gz" - echo " Rscript -e \"roxygen2::roxygenize('R-package/', load = 'installed')\"" - echo "" - exit 1 - fi - all-static-analysis-jobs-successful: - if: always() - runs-on: ubuntu-latest - needs: [test, r-check-docs] - steps: - - name: Note that all tests succeeded - uses: re-actors/alls-green@v1.2.2 - with: - jobs: ${{ toJSON(needs) }} + # r-check-docs: + # name: r-package-check-docs + # timeout-minutes: 60 + # runs-on: ubuntu-latest + # container: rocker/verse + # steps: + # - name: Trust git cloning LightGBM + # run: | + # git config --global --add safe.directory "${GITHUB_WORKSPACE}" + # - name: Checkout repository + # uses: actions/checkout@v4 + # with: + # fetch-depth: 5 + # submodules: true + # - name: Install packages + # shell: bash + # # yamllint disable rule:line-length + # run: | + # Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())" + # sh build-cran-package.sh || exit 1 + # R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit 1 + # # yamllint enable rule:line-length + # - name: Test documentation + # shell: bash --noprofile --norc {0} + # run: | + # Rscript --vanilla -e "roxygen2::roxygenize('R-package/', load = 'installed')" || exit 1 + # num_doc_files_changed=$( + # git diff --name-only | grep --count -E "\.Rd|NAMESPACE" + # ) + # if [[ ${num_doc_files_changed} -gt 0 ]]; then + # echo "Some R documentation files have changed. Please re-generate them and commit those changes." + # echo "" + # echo " sh build-cran-package.sh" + # echo " R CMD INSTALL --with-keep.source lightgbm_*.tar.gz" + # echo " Rscript -e \"roxygen2::roxygenize('R-package/', load = 'installed')\"" + # echo "" + # exit 1 + # fi + # all-static-analysis-jobs-successful: + # if: always() + # runs-on: ubuntu-latest + # needs: [test, r-check-docs] + # steps: + # - name: Note that all tests succeeded + # uses: re-actors/alls-green@v1.2.2 + # with: + # jobs: ${{ toJSON(needs) }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 56dfec23b088..cd51dfd7b16e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -44,3 +44,7 @@ repos: - id: typos args: ["--force-exclude"] exclude: (\.gitignore$)|(^\.editorconfig$) + - repo: https://github.com/henryiii/validate-pyproject-schema-store + rev: 2025.01.20 + hooks: + - id: validate-pyproject From 9937084adc4ea746dce2be21a8bcf4dd8027a4bd Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Mon, 3 Feb 2025 19:42:42 +0300 Subject: [PATCH 2/8] dev --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cd51dfd7b16e..683aaf6e2ccb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,5 +46,6 @@ repos: exclude: (\.gitignore$)|(^\.editorconfig$) - repo: https://github.com/henryiii/validate-pyproject-schema-store rev: 2025.01.20 + files: python-package/pyproject.toml$ hooks: - id: validate-pyproject From 04ecd905ce94f9b95ecbe4a3eddb7a8bfc4f9ed3 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Mon, 3 Feb 2025 19:45:22 +0300 Subject: [PATCH 3/8] dev --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 683aaf6e2ccb..951d5fde0796 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -46,6 +46,6 @@ repos: exclude: (\.gitignore$)|(^\.editorconfig$) - repo: https://github.com/henryiii/validate-pyproject-schema-store rev: 2025.01.20 - files: python-package/pyproject.toml$ hooks: - id: validate-pyproject + files: python-package/pyproject.toml$ From 8e5f8c5d8e6344731c0bae7c4cb6ee1d42fb6b2d Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Mon, 3 Feb 2025 19:47:54 +0300 Subject: [PATCH 4/8] dev --- python-package/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python-package/pyproject.toml b/python-package/pyproject.toml index 1e93fc61f679..e30437f46c6f 100644 --- a/python-package/pyproject.toml +++ b/python-package/pyproject.toml @@ -1,6 +1,6 @@ [project] -classifiers = [ +classifierss = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", From 1b57c05422020a72f623cf0018adf7ebb63c5770 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Mon, 3 Feb 2025 19:56:47 +0300 Subject: [PATCH 5/8] dev --- .github/workflows/static_analysis.yml | 96 +++++++++++++-------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index 062afb1fd87e..b288f8b506ad 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -32,7 +32,7 @@ jobs: matrix: include: - task: lint - # - task: check-docs + - task: check-docs steps: - name: Checkout repository uses: actions/checkout@v4 @@ -48,50 +48,50 @@ jobs: export PATH=${CONDA}/bin:$HOME/.local/bin:${PATH} $GITHUB_WORKSPACE/.ci/setup.sh || exit 1 $GITHUB_WORKSPACE/.ci/test.sh || exit 1 - # r-check-docs: - # name: r-package-check-docs - # timeout-minutes: 60 - # runs-on: ubuntu-latest - # container: rocker/verse - # steps: - # - name: Trust git cloning LightGBM - # run: | - # git config --global --add safe.directory "${GITHUB_WORKSPACE}" - # - name: Checkout repository - # uses: actions/checkout@v4 - # with: - # fetch-depth: 5 - # submodules: true - # - name: Install packages - # shell: bash - # # yamllint disable rule:line-length - # run: | - # Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())" - # sh build-cran-package.sh || exit 1 - # R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit 1 - # # yamllint enable rule:line-length - # - name: Test documentation - # shell: bash --noprofile --norc {0} - # run: | - # Rscript --vanilla -e "roxygen2::roxygenize('R-package/', load = 'installed')" || exit 1 - # num_doc_files_changed=$( - # git diff --name-only | grep --count -E "\.Rd|NAMESPACE" - # ) - # if [[ ${num_doc_files_changed} -gt 0 ]]; then - # echo "Some R documentation files have changed. Please re-generate them and commit those changes." - # echo "" - # echo " sh build-cran-package.sh" - # echo " R CMD INSTALL --with-keep.source lightgbm_*.tar.gz" - # echo " Rscript -e \"roxygen2::roxygenize('R-package/', load = 'installed')\"" - # echo "" - # exit 1 - # fi - # all-static-analysis-jobs-successful: - # if: always() - # runs-on: ubuntu-latest - # needs: [test, r-check-docs] - # steps: - # - name: Note that all tests succeeded - # uses: re-actors/alls-green@v1.2.2 - # with: - # jobs: ${{ toJSON(needs) }} + r-check-docs: + name: r-package-check-docs + timeout-minutes: 60 + runs-on: ubuntu-latest + container: rocker/verse + steps: + - name: Trust git cloning LightGBM + run: | + git config --global --add safe.directory "${GITHUB_WORKSPACE}" + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 5 + submodules: true + - name: Install packages + shell: bash + # yamllint disable rule:line-length + run: | + Rscript -e "install.packages(c('R6', 'data.table', 'jsonlite', 'knitr', 'markdown', 'Matrix', 'RhpcBLASctl', 'roxygen2', 'testthat'), repos = 'https://cran.rstudio.com', Ncpus = parallel::detectCores())" + sh build-cran-package.sh || exit 1 + R CMD INSTALL --with-keep.source lightgbm_*.tar.gz || exit 1 + # yamllint enable rule:line-length + - name: Test documentation + shell: bash --noprofile --norc {0} + run: | + Rscript --vanilla -e "roxygen2::roxygenize('R-package/', load = 'installed')" || exit 1 + num_doc_files_changed=$( + git diff --name-only | grep --count -E "\.Rd|NAMESPACE" + ) + if [[ ${num_doc_files_changed} -gt 0 ]]; then + echo "Some R documentation files have changed. Please re-generate them and commit those changes." + echo "" + echo " sh build-cran-package.sh" + echo " R CMD INSTALL --with-keep.source lightgbm_*.tar.gz" + echo " Rscript -e \"roxygen2::roxygenize('R-package/', load = 'installed')\"" + echo "" + exit 1 + fi + all-static-analysis-jobs-successful: + if: always() + runs-on: ubuntu-latest + needs: [test, r-check-docs] + steps: + - name: Note that all tests succeeded + uses: re-actors/alls-green@v1.2.2 + with: + jobs: ${{ toJSON(needs) }} From cb192170540f41babc443f77a9c163b7425ae68b Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Mon, 3 Feb 2025 19:58:28 +0300 Subject: [PATCH 6/8] dev --- .ci/test.sh | 12 ++++++------ .github/workflows/static_analysis.yml | 1 - python-package/pyproject.toml | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.ci/test.sh b/.ci/test.sh index c1ec65739f42..a33851205176 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -117,12 +117,12 @@ if [[ $TASK == "lint" ]]; then source activate "${CONDA_ENV}" echo "Linting Python and bash code" bash ./.ci/lint-python-bash.sh || exit 1 - # echo "Linting R code" - # Rscript ./.ci/lint-r-code.R "${BUILD_DIRECTORY}" || exit 1 - # echo "Linting C++ code" - # bash ./.ci/lint-cpp.sh || exit 1 - # echo "Linting JavaScript code" - # bash ./.ci/lint-js.sh || exit 1 + echo "Linting R code" + Rscript ./.ci/lint-r-code.R "${BUILD_DIRECTORY}" || exit 1 + echo "Linting C++ code" + bash ./.ci/lint-cpp.sh || exit 1 + echo "Linting JavaScript code" + bash ./.ci/lint-js.sh || exit 1 exit 0 fi diff --git a/.github/workflows/static_analysis.yml b/.github/workflows/static_analysis.yml index b288f8b506ad..69b5b8df004d 100644 --- a/.github/workflows/static_analysis.yml +++ b/.github/workflows/static_analysis.yml @@ -6,7 +6,6 @@ on: push: branches: - master - - ci/pyproject-lint pull_request: branches: - master diff --git a/python-package/pyproject.toml b/python-package/pyproject.toml index e30437f46c6f..1e93fc61f679 100644 --- a/python-package/pyproject.toml +++ b/python-package/pyproject.toml @@ -1,6 +1,6 @@ [project] -classifierss = [ +classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", From 838314bb31064e2e0b773c0de6034150d8782994 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Mon, 3 Feb 2025 20:10:26 +0300 Subject: [PATCH 7/8] dev --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 951d5fde0796..b3702718e8c8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,7 +45,7 @@ repos: args: ["--force-exclude"] exclude: (\.gitignore$)|(^\.editorconfig$) - repo: https://github.com/henryiii/validate-pyproject-schema-store - rev: 2025.01.20 + rev: 2025.01.27 hooks: - id: validate-pyproject files: python-package/pyproject.toml$ From 0a4d5edebe9c8478bcbf0177f0b3e7449aeab246 Mon Sep 17 00:00:00 2001 From: Nikita Titov Date: Wed, 5 Feb 2025 03:32:20 +0300 Subject: [PATCH 8/8] bump version --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b3702718e8c8..d9b23d8798f4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -45,7 +45,7 @@ repos: args: ["--force-exclude"] exclude: (\.gitignore$)|(^\.editorconfig$) - repo: https://github.com/henryiii/validate-pyproject-schema-store - rev: 2025.01.27 + rev: 2025.02.03 hooks: - id: validate-pyproject files: python-package/pyproject.toml$