r-lib / devtools

Tools to make an R developer's life easier
https://devtools.r-lib.org
Other
2.37k stars 755 forks source link

[BUG] Issue in document(): Files 'DESCRIPTION' and 'DESCRIPTION.in' are missing. #2512

Closed jmrothen closed 1 year ago

jmrothen commented 1 year ago

Is your feature request related to a problem? Please describe. When creating the documentation for a new project of mine, I keep running into the following error when attempting to view the .Rd files in the man folder;

ℹ Rendering development documentation for "function_name_here" Error in .get_package_metadata(pkgdir) : Files 'DESCRIPTION' and 'DESCRIPTION.in' are missing.

Describe the solution you'd like I imagine this is a new bug as of R 4.3.0 (which I am currently using). There is a DESCRIPTION file in the project, which has been created by the docu

Additional context R 4.3.0 devtools 2.4.5

jmrothen commented 1 year ago

deleted description file, went back and rewrote all my roxygen chunks, and then was able to get everything to work correctly after a devtools::document()

shirewoman2 commented 1 year ago

I'm having the same issue. When you say that you "rewrote" all the roxygen chunks, how did you go about doing that? Manually? I tried deleting everything in my "man" folder since it was all automatically generated by roxygen2 and then re-ran document(), but that didn't fix the issue. If I delete the "DESCRIPTION" file in the project root directory, then R doesn't recognize it as being part of a package, so I'm not sure how I would do that.

jmrothen commented 1 year ago

Strange. I'm not sure if it will help much, but here's the project that I was having this issue with. Try comparing our description files (and other roxygen chunks) and see if there are any differences that could be causing the issue.

shirewoman2 commented 1 year ago

Thanks! I really appreciate the example! I don't see any obvious differences between your DESCRIPTION file and mine or between how you and I have set up the man pages. I did find that a one-off error I was seeing was due to having a carriage return between @export and @examples on one of the package functions because it went away when I deleted that. (I had export and then examples; I see you've got examples and then export, but I don't think that should matter.) Here's the repo for my package. This definitely is a difference between R versions because this works fine on a machine I use with version 4.2.3 but fails with a machine I use with version 4.3.0.