-
-
Notifications
You must be signed in to change notification settings - Fork 878
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
Move the markdown package from Imports to Suggests #1864
Comments
… package containing vignettes based on the knitr::knitr engine
hi I got this from win-builder:
my vignette uses
which I think does not require markdown (even in suggests), if I understand your discussion above correctly. so it seems strange that I would need to add markdown in suggests. do I really have to? |
Yes, you have to. |
ok |
I think I'm getting a false positive warning on the CRAN Winbuilder. I've got all my vignettes set to %\VignetteEngine{knitr::rmarkdown} If I have not set in
I'm getting no warnings locally (
The missing package, however, is |
@mschubert I need a reproducible example. Could you provide a link to your package (presumably on Github?)? Thanks! |
Package was |
@mschubert In your case, you are using the vignette engine |
Yes, that's what I tried to say - sorry if that was not clear. My comment was that the error message of "missing Perhaps a better error message would be to add whatever markdown builder you use to |
@mschubert Yes, I definitely agree the messages were confusing in this case. I'll think more about it and try to make it clearer. Thanks a lot for your feedback! |
Experienced the following in winbuild * checking re-building of vignette outputs ... [1s] WARNING Error(s) in re-building vignettes: --- re-building 'introduction.Rmd' using rmarkdown Warning in engine$weave(file, quiet = quiet, encoding = enc) : The vignette engine knitr::rmarkdown is not available, because the rmarkdown package is not installed. Please install it. Error: processing vignette 'introduction.Rmd' failed with diagnostics: The 'markdown' package should be declared as a dependency of the 'tableone' package (e.g., in the 'Suggests' field of DESCRIPTION), because it contains vignette(s) built with the 'markdown' package. Please see yihui/knitr#1864 for more information. --- failed re-building 'introduction.Rmd' --- re-building 'smd.Rmd' using rmarkdown Warning in engine$weave(file, quiet = quiet, encoding = enc) : The vignette engine knitr::rmarkdown is not available, because the rmarkdown package is not installed. Please install it. Error: processing vignette 'smd.Rmd' failed with diagnostics: The 'markdown' package should be declared as a dependency of the 'tableone' package (e.g., in the 'Suggests' field of DESCRIPTION), because it contains vignette(s) built with the 'markdown' package. Please see yihui/knitr#1864 for more information. --- failed re-building 'smd.Rmd' SUMMARY: processing the following files failed: 'introduction.Rmd' 'smd.Rmd' Error: Vignette re-building failed.
I agree with @mschubert. I had the same situation. I was about to add 'markdown' to suggests because of the message, when I really should have added 'rmarkdown' to suggests, because I use |
…the vignette engine knitr::rmarkdown is used (#1864)
* creating vignettes ... ERROR --- re-building 'dataRetrieval.Rmd' using rmarkdown Warning in engine$weave(file, quiet = quiet, encoding = enc) : The vignette engine knitr::rmarkdown is not available because the rmarkdown package is not available. Did you forget to add it to Suggests in DESCRIPTION? Please see yihui/knitr#1864 for more information. Loading required namespace: sf --- finished re-building 'dataRetrieval.Rmd'
With knitr 1.30 (the current latest version on CRAN), the message should tell you to add |
Any idea when the actual moving to suggests may happen? |
@jangorecki It may happen relatively soon. I'm talking to CRAN and if they could forgive me for breaking (potentially a small number of) packages that didn't declare markdown in |
Is there a way to get around this issue? This error is preventing us from submitting two packages to Bioconductor... |
@dnadave Yes, please do what the error message told you to do. |
…an be built correctly. Context: yihui/knitr#1864
@jangorecki I talked to CRAN maintainers last month and about 470 CRAN packages will be broken if I moved markdown to |
C.f. yihui/knitr#1864 R currently looks for both pandoc and pandoc-citeproc, but the latter is deprecated upstream.
@yihui this may have been the wrong issue to post on but what I'm concerned with it how to reproduce the ERROR we were seeing on the Bioconductor build report since it has disappeared with knitr1.33.8? As this seemed to be a real ERROR that you wanted corrected and we were able to see the ERROR with knitr 1.33.3. My understanding was the work around was a temporary fix since the original updated was right before the Bioconductor release and breaking numerous packages; now we wanted the ERROR to appear so maintainers would correct? |
@lshep Looking at the changes from 1.33.3 to 1.33.8 (ae6ab6e...fad3ead), I can't think of a possible reason why the error could have disappeared in 1.33.8. The only possibly relevant commit is 93720d3, which was @hpages's suggestion from #1864 (comment), but that shouldn't make the error disappear. I don't know why 1.33.3 could cause the error, either... |
@yihui Correction: we were using knitr 1.33.5 on our build machines, which was raising the So for example, a package like RMassBank (which uses rmarkdown to build its vignette) was getting an We've contacted many developers to let them know about these errors and ask them to fix their package. Now they're getting back to us telling us they don't know what we're talking about because they don't see the error on our daily build report. What should we tell them? Thanks |
…ON or throw an error (#1864) this will break a number of CRAN packages, but is what CRAN tells me to do
@hpages I'm confused now. Neither v1.33.5 nor v1.33.8 should cause an error on Bioc, because both markdown and rmarkdown are available on Bioc. If I understood you correctly last time (93720d3), you have set That said, I just committed 0dcd462, which completely removed the possibility of build error as long as markdown is available (which is true on Bioc). |
@yihui We only use
Both markdown and rmarkdown have always been available on our build machines and yet we were getting these
The message complains that markdown should be declared as a dependency. AFAIK the fact that a package needs to declare another package as a dependency has nothing to do with what's installed on the system where the package is being tested. So if knitr considers it is a mistake that markdown or rmarkdow are not listed as a dependency, this is a fact that remains true whether these packages are installed or not. With knitr v1.33.9, |
Okay, that's the (new) behavior that I expect on Bioc now. Once CRAN submission is re-opened, I'll try to submit a new version of knitr to CRAN. Thanks! |
Focusing on the behavior on Bioc is not that helpful. When Bioc developers run Even though this new check by knitr came as a surprise in April and broke hundreds of Bioconductor packages a few days before the BioC 3.13 release (see #1864 (comment)), we embraced it in BioC 3.14 and have been working all these months with our developers to help them fix their package. But now it seems that you've changed your mind. Are you saying that knitr will no longer consider that it's an error when a package uses markdown or rmarkdown to build its vignette and doesn't depend on it? Just want to make sure so we can clarify the situation with our developers. Thanks! |
Yes. I'm following your original suggestion in #1864 (comment), i.e., "let things happen naturally." I will no longer throw an error on my side. If the build/check platform (e.g., CRAN) thinks it is an error not to declare the dependency, I'll just let the platform throw the error. The previous error on my side was meant to serve as a precaution and avoid future breakages on CRAN. Now that I have gotten the permission from CRAN (and was even strongly encouraged by them) that it's time to break packages that still haven't made the correction, I'll just let them break, although personally I really hope to give them more time. |
Thanks for clarifying. I know, it was my suggestion to let things happen naturally. More generally I don't think a package should meddle too much in what its reverse deps do with their |
…but rmarkdown/markdown/Pandoc is not available (#1864) this is like a trolley problem to me---I still can't accept the consequence that I'm going to kill 200 packages on CRAN if I throw an error when the package author didn't declare dependence on rmarkdown or markdown
Andrew Heiss (1): fix #2038: add ability to pass arguments to dvisvgm through engine.opts (#2039) Christophe Dervieux (3): fix #1993: ignore some values of `fig.keep` (e.g., fig.keep = 'last') when there is only one figure in a chunk (#1996) Throw an error if inline result cannot be coerced to character (#2007) `include_*` David C Hall (1): Use `conditionMessage()` to render conditions (#2016) Jamie Lentin (1): utils-vignettes: Don't disable vtangle if .Rout.save exists (#2018) Kenneth Blake Vernon (1): fix #1935: make collapse and strip.white = TRUE independent (#2011) Will Landau (1): Add a new targets engine (#2031) Yihui Xie (19): start the next version stop() early on CI servers if Pandoc is not found before building R Markdown vignettes: yihui/knitr#1864 (comment) use the chunk option engine.opts$classoption to customize the class options of `standalone` for the tikz engine: yihui/knitr#1985 (comment) close #1992 (originally reported at #492): allow customizing the tilde symbol ~ with the package option latex.tilde add the attribute data=external="1" to <iframe> generated by include_url() so that Pandoc won't base64 encode the URL: https://stackoverflow.com/q/67477667/559676 close #1997: remove the duplicate \format{} on the help page ?opts_chunk use a dedicated env var to decide whether to check DESCRIPTION: yihui/knitr#1864 (comment) fix rstudio/rmarkdown#2165: emit a message instead of a warning when building rmarkdown vignettes without pandoc remove the code that was for backward compatibility with a very old version of knitr remove is_abs_path from knitr, which is no longer used in bookdown >= v0.22 (rstudio/bookdown@0098721) signal an error when buiding rmarkdown vignettes but Pandoc is not available, unless the vignette is build during R CMD check (in which case a message is emitted instead) specify the package name in \link[] `write_bib()` only uses the first URL if multiple are found in a package (#2028) close #1864: move markdown to Suggests (#2020) no longer test the declaration of dependency on markdown in DESCRIPTION or throw an error (#1864) update URLs do not throw an error in R CMD check when checking a package on CRAN but rmarkdown/markdown/Pandoc is not available (#1864) respect the env var R_CRANDALF: yihui/crandalf@d5949e5 CRAN release v1.34 christophe dervieux (1): re-document. Trailing whitespace are removed in code now. knokknok (1): cache.globals = FALSE means detecting all variables in a code chunk (#1898)
…SparkR package ### What changes were proposed in this pull request? Declare the markdown package as a dependency of the SparkR package ### Why are the changes needed? If we didn't install pandoc locally, running make-distribution.sh will fail with the following message: ``` — re-building ‘sparkr-vignettes.Rmd’ using rmarkdown Warning in engine$weave(file, quiet = quiet, encoding = enc) : Pandoc (>= 1.12.3) not available. Falling back to R Markdown v1. Error: processing vignette 'sparkr-vignettes.Rmd' failed with diagnostics: The 'markdown' package should be declared as a dependency of the 'SparkR' package (e.g., in the 'Suggests' field of DESCRIPTION), because the latter contains vignette(s) built with the 'markdown' package. Please see yihui/knitr#1864 for more information. — failed re-building ‘sparkr-vignettes.Rmd’ ``` ### Does this PR introduce _any_ user-facing change? Yes. Workaround for R packaging. ### How was this patch tested? Manually test. After the fix, the command `sh dev/make-distribution.sh -Psparkr -Phadoop-2.7 -Phive -Phive-thriftserver -Pyarn` in the environment without pandoc will pass. Closes apache#32270 from xuanyuanking/SPARK-35171. Authored-by: Yuanjian Li <[email protected]> Signed-off-by: HyukjinKwon <[email protected]> (cherry picked from commit 8e9e700) Signed-off-by: Dongjoon Hyun <[email protected]>
Solution based on discussion in yihui/knitr#1864
Add markdown to suggests, along with knitr and rmarkdown following guidance in yihui/knitr#1864 and error message trying to build vignette in install_github
For the record, I continue getting this message, despite both rmarkdown and markdown being declared in Suggests or Imports of my package, as well as having both of them installed in the environment. |
@stefanoborini If you get the message even if you declare them in Imports, then there must be something else wrong. Chances are your |
@yihui I use |
@stefanoborini I don't know why (I'm not the author of either of them), but my experience is that R commands (such as |
see <yihui/knitr#1864> for mor information
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
For package authors who use R Markdown vignettes based on the vignette engine
knitr::knitr
(orknitr::docco_linear
,knitr::docco_classic
, etc.), you should declare the (soft) dependency on markdown, e.g., in the package DESCRIPTION:Previously they didn't need to do this because markdown has been a hard dependency of knitr (in
Imports
), so the availability of markdown is guaranteed by knitr, but I want to make markdown a soft dependency of knitr in the future.I think most packages use the vignette engine
knitr::rmarkdown
to write vignettes now, but there may still be a few vignettes using theknitr::knitr
engine, which depends on markdown. If I move markdown toSuggests
in knitr, users have to make sure markdown is available toR CMD check
. To achieve that, they have to add markdown toSuggests
to theirDESCRIPTION
files.Similarly, if your vignette is based on the vignette engine
knitr::rmarkdown
, you have to declare the dependency on rmarkdown, e.g.,The error message when building the source package via
R CMD build
should tell you if you need to add markdown or rmarkdown toSuggests
, which looks like this:If you are a package author affected by this issue, but not clear about what you need to do, please reply below and I'll be glad to help. I recommend that you skip the replies below. Thanks!
The text was updated successfully, but these errors were encountered: