-
Notifications
You must be signed in to change notification settings - Fork 76
add rlang::check_installed()
to assert_package()
#331
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
Conversation
I do like the menu, and I appreciate how much pain it takes away from the user. However, Lines 98 to 103 in 8b10d76
These custom error classes help |
Assuming we solve that, please add Line 23 in 8b10d76
|
Ah, I see! For my own interest, can you point me to a spot where targets is checking such classed conditions? I have a growing interest in them after seeing some cool use cases. Anyway, I did a simple catch of the error, replaced it with |
I tested this out, and
I mostly use it for tests, as you may have seen with Line 54 in 1e4dfe1
Lines 199 to 205 in 1e4dfe1
|
Yes, it's a much more pleasant approach! I was happy to find it. For context, we're now using targets as our default project structure, but we also use renv by default. Sometimes renv doesn't have a package cached that you otherwise have on your machine, so this workflow is much smoother. We use an explicit, Thanks also for the example! That's interesting and exactly the sort of use case I think is compelling. Anyway, all updated. Let me know if there's anything else |
Looks great, thanks again. FWIW, |
Awesome, thanks! I didn't know about |
…and bump rlang requirement
Prework
PR
This PR modifies
assert_package()
to userlang::check_installed()
which is a recent, very ergonomic package check that offers to install the package(s) for you. It's also vectorized. This did require a small bump in the required rlang version, as it's a new feature.On my machine, for instance, I now get this message with
tar_watch()
: