-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
Suggestion of new function: get_dep_version()
#793
Comments
This would be great, but maybe we don't need a separate exported function? Do folks need to check dep version outside of this case? Maybe just add the min version check internally to check_if_installed()? |
Yes, this sounds like a cool feature. I agree with Brenton that this should be added as a feature to |
Great, thanks! I'll submit a PR with the modified |
Is it possible to avoid naming the package from where the function is called? Cf |
Yes @strengejacke, in #795 this is now automatic :) |
Context
insight::check_if_installed()
is a great alternative torlang::is_installed()
.During the review of my rempsyc paper at JOSS, it was pointed out that for suggested packages, the wrong package versions were checked. I assumed these functions were smart enough to check the DESCRIPTION document for the correct version, but this is not the case. So we need to specify the minimal version manually using the
minimum_version
orversion
arguments.Problem and Solution
This is suboptimal because it creates additional maintenance: we have to update the version numbers not only in the DESCRIPTION file but also in every function that depends on those suggested packages (crazy I know!).
For this purpose, I created a function,
get_dep_version()
, that automatically detects the minimal version of a given package from the DESCRIPTION file.Reprex:
Created on 2023-08-05 with reprex v2.0.2
This is useful because it can be directly integrated with
insight::check_if_installed()
:Created on 2023-08-05 with reprex v2.0.2
In fact, this could be the default, should we want it. This would allow us to reduce maintenance in all easystats packages by changing the required version number only once: where it belongs in the DESCRIPTION file. Furthermore, making this the default in
insight::check_if_installed()
would show a CLEAR benefit ofinsight::check_if_installed()
overrlang::is_installed()
.Would you like this function to migrate from
rempsyc
toinsight
?The text was updated successfully, but these errors were encountered: