Skip to content
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

Improve version requirements in is_installed() and check_installed() #1332

Merged
merged 13 commits into from
Dec 16, 2021

Conversation

lionel-
Copy link
Member

@lionel- lionel- commented Dec 15, 2021

Branched from #1331.

  • DESCRIPTION-style requirements are now supported, e.g. is_installed("rlang (>= 1.0.0)".
  • New compare argument to supply requirement info programmatically.
  • When < or <= is used, check_installed() doesn't prompt for install.

This will allow support for check_installed() in pkgload, so that we get install prompts on missing deps.

@lionel- lionel- requested a review from hadley December 15, 2021 14:42
@lionel-
Copy link
Member Author

lionel- commented Dec 15, 2021

@hadley In pkgload, a failing version requirement only issues a warning instead of an error, this way the package can be loaded anyway. I just want to check this is still the behaviour we want to support since that might be slightly tricky to implement. (Probably we need to signal a classed condition before calling invokeRestart("abort").)

@hadley
Copy link
Member

hadley commented Dec 15, 2021

In pkgload, I think we can just protect with some tryCatch()s, like we need to do for namespace imports.

@hadley
Copy link
Member

hadley commented Dec 15, 2021

Oh but the idea is to now use check_installed() directly in pkgload, so we'd be replacing the warning with a prompt to install the package; I think that's ok.

@lionel-
Copy link
Member Author

lionel- commented Dec 16, 2021

Oh but the idea is to now use check_installed() directly in pkgload, so we'd be replacing the warning with a prompt to install the package; I think that's ok.

ok cool, that will make things simpler!

We now take an optional action callback that is called when the user chooses to update/install dependencies.

@lionel- lionel- changed the base branch from is-character-values to main December 16, 2021 14:19
@lionel- lionel- merged commit bba8f05 into main Dec 16, 2021
@lionel- lionel- deleted the check-pkg-input branch December 16, 2021 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants