Skip to content

Commit cd9b3e1

Browse files
authored
Merge pull request #917 from mlr-org/depends_only_checks
check with depends only
2 parents 9490408 + b85b263 commit cd9b3e1

File tree

8 files changed

+17
-5
lines changed

8 files changed

+17
-5
lines changed

.github/workflows/r-cmd-check.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
r-cmd-check:
1616
runs-on: ${{ matrix.config.os }}
1717

18-
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
18+
name: ${{ matrix.config.os }} (${{ matrix.config.r }})${{ matrix.config.depends_only && ' – noSuggests' || '' }}
1919

2020
env:
2121
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
@@ -26,6 +26,7 @@ jobs:
2626
config:
2727
- {os: ubuntu-latest, r: 'devel'}
2828
- {os: ubuntu-latest, r: 'release'}
29+
- {os: ubuntu-latest, r: 'release', depends_only: true}
2930

3031
steps:
3132
- uses: actions/checkout@v4
@@ -40,3 +41,6 @@ jobs:
4041
needs: check
4142

4243
- uses: r-lib/actions/check-r-package@v2
44+
env:
45+
_R_CHECK_DEPENDS_ONLY_: ${{ matrix.config.depends_only && 'TRUE' || '' }}
46+
NOT_CRAN: ${{ matrix.config.depends_only && 'FALSE' || 'TRUE' }}

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Config/testthat/parallel: true
109109
NeedsCompilation: no
110110
Roxygen: list(markdown = TRUE, r6 = FALSE)
111111
RoxygenNote: 7.3.2
112-
VignetteBuilder: knitr
112+
VignetteBuilder: knitr, rmarkdown
113113
Collate:
114114
'CnfAtom.R'
115115
'CnfClause.R'

R/preproc.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#' of [`TaskSupervised`][mlr3::TaskSupervised] will not work with these input types for `indata`.
4343
#'
4444
#' @export
45-
#' @examples
45+
#' @examplesIf requireNamespace("rpart")
4646
#' library("mlr3")
4747
#' task = tsk("iris")
4848
#' pop = po("pca")

man/preproc.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test_GraphLearner.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,7 @@ test_that("GraphLearner hashes", {
938938
})
939939

940940
test_that("validation, internal_valid_scores", {
941+
skip_if_not_installed("rpart")
941942
expect_error(as_pipeop(lrn("classif.debug", validate = 0.3)), "must either be")
942943
# None of the Learners can do validation -> NULL
943944
glrn1 = as_learner(as_graph(lrn("classif.rpart")))$train(tsk("iris"))
@@ -966,6 +967,7 @@ test_that("validation, internal_valid_scores", {
966967
})
967968

968969
test_that("internal_tuned_values", {
970+
skip_if_not_installed("rpart")
969971
# no internal tuning support -> NULL
970972
task = tsk("iris")
971973
glrn1 = as_learner(as_graph(lrn("classif.rpart")))$train(task)
@@ -1074,6 +1076,7 @@ test_that("marshal", {
10741076
})
10751077

10761078
test_that("marshal has no effect when nothing needed marshaling", {
1079+
skip_if_not_installed("rpart")
10771080
task = tsk("iris")
10781081
glrn = as_learner(as_graph(lrn("classif.rpart")))
10791082
glrn$train(task)

tests/testthat/test_pipeop_learnercv.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ test_that("marshal", {
140140
})
141141

142142
test_that("marshal multiplicity", {
143+
skip_if_not_installed("rpart")
144+
skip_if_not_installed("bbotk")
143145
po = po("learner_cv", learner = lrn("classif.debug"))
144146
po$train(list(Multiplicity(tsk("iris"), tsk("sonar"))))
145147
s = po$state

tests/testthat/test_pipeop_tunethreshold.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ test_that("threshold works with cost measure", {
240240

241241

242242
test_that("threshold graph transparency", {
243-
243+
skip_if_not_installed("rpart")
244+
skip_if_not_installed("bbotk")
244245
lrn_prob = as_learner(
245246
po("learner_cv", lrn("classif.rpart", predict_type = "prob")) %>>%
246247
po("tunethreshold")

tests/testthat/test_preproc.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
context("preproc")
22

33
test_that("preproc - basic sanity checks", {
4+
skip_if_not_installed("smotefamily")
45
task = tsk("iris")
56
op = po("scale")
67
graph = as_graph(op)

0 commit comments

Comments
 (0)