-
Notifications
You must be signed in to change notification settings - Fork 761
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 more dependencies to Suggests #962
Conversation
@@ -6,8 +6,7 @@ compile_rcpp_attributes <- function(pkg) { | |||
# Only scan for attributes in packages explicitly linking to Rcpp | |||
if (links_to_rcpp(pkg)) { | |||
|
|||
if (!requireNamespace("Rcpp", quietly = TRUE)) | |||
stop("Rcpp required for building this package") | |||
check_suggested("Rcpp", "0.10.0") | |||
|
|||
# Only compile attributes if we know we have the function available | |||
if (utils::packageVersion("Rcpp") >= "0.10.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check could now go
Where does evaluate get used? In |
The only package I'm hesitant about removing is roxygen2, because I have some vague recollection that we deliberately made it part of devtools. I think it's basically because there's a strong tension in devtools to be batteries included because it makes teaching R package development that much easier. |
Evaluate is from Also removed the extra Rcpp check in 8b94cf4. Unfortunately roxygen2 has dependencies for both stringr and Rcpp, which are the two biggest dependencies for devtools currently, so keeping it in I agree with the batteries included approach to devtools, it just doesn't jive well when it is used for installing packages on CIs. You could always suggest people install devtools with The best solution would be to split out the |
8b94cf4
to
f28c702
Compare
Another option would be to have a batteriesincluded package that just had everything people needed as a dependency. |
For symmetry if we're going to drop roxygen2, I think we should also drop testhat. And could you add a bullet point to NEWS and think about how to change the README to tell people how to get a full environment for package development? |
Whenever ppl try using testthat or roxygen, they could just get a message that it is missing, and it needs to be installed. Potentially devtools could also install them if Btw. as much as I like micropackages, I personally don't like "removing" testthat and roxygen2. Btw.2. slightly related, https://github.com/metacran/description is almost ready. Some more docs would be nice, and validation is mostly missing. Validation is very hard, actually, for some fields, e.g. License. I'll add them, slowly, but it will take a while. |
Actually testthat has nearly always been in Suggests (0a02d83) and is only used for The main issues with just using
I think 1. kind of makes the Re: @gaborcsardi this implementation does generate an error with informative message about the missing packages, but offering to install them isn't a bad idea though, maybe that is the best way to solve this problem... |
e4f1ece adds the a prompt to install the suggested packages if they are not installed, I think it will work well. |
@gaborcsardi I think removing the Rcpp dependency from roxygen2 is going to be hard - it's just a much better tool for parsing stuff than R is. I'd rather push towards moving all the package install stuff out in a separate package. |
@hadley I am not suggesting removing the C++ code, only the Rcpp wrapper. Rcpp is great, but the roxygen C++ code is short and seems straightforward without Rcpp, too. Just an idea, not sure if it is worth the effort. |
jimhester@2db88ba adds a NOTE to news. With e4f1ece if someone doesn't have roxygen2 or testthat installed when they run Another additional thing we could do would be to add installation prompts to |
c0874e1
to
0d96154
Compare
This allows devtools to be installed in less time, such as when it is used only to install packages and dependencies on travis and other CIs.
69222fe
to
8a02e54
Compare
8a02e54
to
7792e8e
Compare
This is now ready jimhester@d7c94be failed only because of GitHub rate limiting on Appveyor and contains only NEWS changes from jimhester@b4bc23e, which passed. |
This looks good but I'm concerned that the version req is now recorded in two places, and the chances are that I'll forget to update one |
Hmm true, I can write a function to read the version number from the |
message(msg, "\nWould you like to install it?") | ||
if (menu(c("Yes", "No")) == 1) { | ||
install.packages(pkg) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this also need a stop()
? (i.e. if they say no)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Fixed with jimhester@ab8bae8. Having the two stop()
calls right after each other looks a little ugly, but modifying the conditional to avoid them would be just as bad in other ways.
Thanks! |
Move more dependencies to Suggests
This allows devtools to be installed in less time, such as when it is
used only to install packages and dependencies on Travis and other CIs.
If a given Suggested dependency is needed for functionality
check_suggested()
prints an informative errorThis should remove the Rcpp dependency and combined with r-lib/httr@7c68198 it should lighten the dependency load for devtools considerably.