-
Notifications
You must be signed in to change notification settings - Fork 751
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
devtools::check() running examples with --run-donttest when run_dont_test = FALSE #2216
Comments
I've just noticed that R 4.0.0 has changed R CMD check --as-cran to run \donttest examples (see Utilities section here). "This can be temporarily circumvented during development by setting environment variable |
* see e.g. r-lib/devtools#2216 * if this package were on a CRAN we'd have a bigger problem
* R 4.0 now (stupidly IMHO) runs these by default (see r-lib/devtools#2216)
In case it isn't obvious to anyone landing here how/where to set the environmental variable mentioned above (it wasn't clear to me) you can try the following:
|
I clarified the docs. Generally, now if you don't want to run tests on CRAN |
Behavior of devtools::check() changed in R 4.0 r-lib/devtools#2216 CRAN maintainers prefer \donttest{} for long-running examples over \dontrun{} https://stackoverflow.com/questions/12038160/how-to-not-run-an-example-using-roxygen2
@hadley, I wonder whether you might say a bit more here about your statement "but using \dontrun{} may cause initial submission to fail" in the just-previous comment. Why would using \dontrun{} cause a problem? This is a general question, but in case it's of any interest, I am asking because we have some examples in the I think the choices as
As a user, I often jump to the Examples part of documentation, so I think option 3 is undesirable, although not as bad as option 4. Since option 1 seems destined to fail in the present-day R system, we are left with option 2. Option 2 is what I infer as the best solution, based on https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Marking-text and the purpose of this comment is to ask whether this is correct (in light of your proviso about rejection). My guess is that quite a few folks come upon this issue through web searches, and so it might be very helpful to get a bit of advice posted here. Even a single phrase like "Use \dontrun{} for examples using data not provided with your package" would be enormously helpful to those of us who fear CRAN rejection. |
@dankelley on initial submission (only) CRAN tends to complain if you use |
@hadley thanks very much for the clarification. It helps a lot. Dan. |
devtools::check() seems to be ignoring run_dont_test = FALSE resulting in this output:
I'm unsure as to whether this has anything to do with the R 4.0.0 update, but rcmdcheck doesn't seem to have any open related issues.
Session info
The text was updated successfully, but these errors were encountered: