Skip to content

fix: avoid Suggests-only packages in tests and examples#449

Merged
schloerke merged 3 commits into
mainfrom
schloerke/fix-missing-markdown-pkg
May 27, 2026
Merged

fix: avoid Suggests-only packages in tests and examples#449
schloerke merged 3 commits into
mainfrom
schloerke/fix-missing-markdown-pkg

Conversation

@schloerke

@schloerke schloerke commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix two failures in the depends-only R CMD check, where only Depends/Imports packages are installed:

  • tests/testthat/test-print.R: skip the CRLF is properly handled test when the Suggests-only markdown package isn't installed (the test calls includeMarkdown(), which requires it).
  • R/tags.R: guard the withr::with_options() call in the tagFunction() example with if (requireNamespace("withr", quietly = TRUE)) so the example runs when withr is available and is skipped otherwise.

Also regenerates the man pages with roxygen2 8.0.0 (replacing RoxygenNote with Config/roxygen2/version in DESCRIPTION).

Test plan

  • R-CMD-check / check-depends-only passes
  • Other R-CMD-check matrix jobs pass

schloerke added 2 commits May 27, 2026 13:33
The CRLF test calls includeMarkdown(), which requires the Suggests-only
markdown package. Skip the test in environments where it isn't available
(e.g. the depends-only GHA check).
@schloerke schloerke force-pushed the schloerke/fix-missing-markdown-pkg branch from 3891cfe to c994806 Compare May 27, 2026 20:40
The depends-only R CMD check installs only Depends/Imports, so the
example errored with 'no package called withr'. Wrap the
withr::with_options() call in requireNamespace("withr") so the
example runs when the Suggested package is available and is skipped
otherwise.
@schloerke schloerke force-pushed the schloerke/fix-missing-markdown-pkg branch from c994806 to 4093ff1 Compare May 27, 2026 20:40
@schloerke schloerke changed the title Skip CRLF test when markdown is unavailable fix: avoid Suggests-only packages in tests and examples May 27, 2026
@schloerke schloerke merged commit 365b575 into main May 27, 2026
17 checks passed
@schloerke schloerke deleted the schloerke/fix-missing-markdown-pkg branch May 27, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant