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

include Suggests in assess_dependencies #335

Open
Edward-Gillian opened this issue Mar 18, 2024 · 3 comments
Open

include Suggests in assess_dependencies #335

Edward-Gillian opened this issue Mar 18, 2024 · 3 comments

Comments

@Edward-Gillian
Copy link

Edward-Gillian commented Mar 18, 2024

Description

add Suggests in get_package_dependencies

https://github.com/pharmaR/riskmetric/blob/master/R/assess_dependencies.R#L105

and parse_dcf_dependencies

https://github.com/pharmaR/riskmetric/blob/master/R/assess_dependencies.R#L123

Use Case

This will allow for capturing dependency packages that are used in tests, examples, and vignettes

@emilliman5
Copy link
Collaborator

The rationale behind the assess_dependencies is to capture the "true" size of the code base for a packages, while Suggests contributes this, these are not required for normal package function and are typically needed for development. Since they are not required for intended use I do not think it is necessary to include them in the assessment as this would needlesslyo penalize packages for their Suggests and thus penalize packages with, likely, better SDLC practices..

@Edward-Gillian
Copy link
Author

However, packages such as knitr and rmarkdown that are in Suggests are often needed by users to access vignettes.

Also, packages have dependencies listed in Suggests that are used in the code. For example, dplyr lists purrr in Suggests (https://github.com/tidyverse/dplyr/blob/be36acf9c86e5d4c3d97f97b8d3999b713123392/DESCRIPTION#L51) but the function bind-cols uses map_lgl in its code (https://github.com/tidyverse/dplyr/blob/be36acf9c86e5d4c3d97f97b8d3999b713123392/R/bind-cols.R#L35)

@albertopessia
Copy link

However, packages such as knitr and rmarkdown that are in Suggests are often needed by users to access vignettes.

knitr and rmarkdown are not required to access vignettes. Vignettes are created by R CMD build before uploading the package source to CRAN. Building vignettes is not the default even when installing the package from GitHub with remotes::install_github.

Also, packages have dependencies listed in Suggests that are used in the code. For example, dplyr lists purrr in Suggests (https://github.com/tidyverse/dplyr/blob/be36acf9c86e5d4c3d97f97b8d3999b713123392/DESCRIPTION#L51) but the function bind-cols uses map_lgl in its code (https://github.com/tidyverse/dplyr/blob/be36acf9c86e5d4c3d97f97b8d3999b713123392/R/bind-cols.R#L35)

This should really be considered a bug. Anything in Suggests is optional and the package should work without installing packages listed in Suggests.
However, the function map_lgl you reference in your example is not really from purrr but defined here: https://github.com/tidyverse/dplyr/blob/173b4232bff810f563e1739211ea7545ed0651e6/R/import-standalone-purrr.R#L45

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

No branches or pull requests

3 participants