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

Do not add covr to Suggests in use_coverage() #1851

Merged
merged 3 commits into from Jun 5, 2023

Conversation

Bisaloo
Copy link
Contributor

@Bisaloo Bisaloo commented Jun 5, 2023

Context

At the moment, use_coverage() adds covr to Suggests. This was not always the case but it was added in 2698067, apparently to facilitate coverage computation in travis CI(?).

usethis and the R community have now largely moved away from travis in favour of GitHub Actions. The test-coverage GHA workflow provided by usethis already installs covr in all cases, without needing it to be explicitly listed in Suggests.

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

Homogenizing

This PR proposes to stop automatically including covr in Suggests when running use_coverage() (fix #1844). This is in line with what use_pkgdown() does: pkgdown is not added to Suggests there. Again, it's not necessary because as in the test-coverage workflow, pkgdown is automatically installed without the need to l

Differences with use_pkgdown()

use_pkgdown() does however use check_installed("pkgdown"). I don't believe it's necessary in the case of use_coverage(). The difference is that use_pkgdown() needs to know which pkgdown version is installed to determine the structure of the default _pkgdown.yml config file.

usethis/R/pkgdown.R

Lines 50 to 52 in 00ee947

if (pkgdown_version() >= "1.9000") {
config$template <- list(bootstrap = 5L)
}

(Note that check_installed("pkgdown") could probably be removed here as well though. It was strictly necessary in the past when usethis used pkgdown functions (87a2cb5) but it's not the case anymore as far as I can tell. Version checking could be done conditionally and the bootstrap 5 template could be used by default when pkgdown is not yet installed. It's a different question though and I can open a separate issue if you wish)

@jennybc
Copy link
Member

jennybc commented Jun 5, 2023

Thanks!

@jennybc jennybc merged commit 816df08 into r-lib:main Jun 5, 2023
13 checks passed
@Bisaloo Bisaloo deleted the no-suggests-covr branch June 6, 2023 06:14
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.

Make use_coverage() add covr to Config/Needs/coverage rather Suggests
2 participants