-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Update DESCRIPTION #175
Update DESCRIPTION #175
Conversation
- Config/Needs/verdepcheck entries in new line - add `bioc::` for packages from Bioconductor Signed-off-by: Pawel Rucki <[email protected]>
Code Coverage Summary
Diff against main
Results for commit: 520d737 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this.
The r.pkg.template/.github/workflows/version-bump.yaml
action will always refactor the Config/Needs/verdepcheck
to single line though (with NORMALIZE = TRUE
option).
note: scheduled
action was triggered manually and runs successfully: https://github.com/insightsengineering/teal.data/actions/runs/6533445688/job/17738647791
Good find! Can you please make a PR then? |
Sure can, but @pawelru this will have a side effect that packages within fields won't be sorted or whitespace being "normalized". That is a nice feature to have. We correct the diff --git a/.github/workflows/version-bump.yaml b/.github/workflows/version-bump.yaml
index 0d41874..a8941a1 100644
--- a/.github/workflows/version-bump.yaml
+++ b/.github/workflows/version-bump.yaml
@@ -63,7 +63,23 @@ jobs:
- name: Bump version in DESCRIPTION 📜
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || inputs.vbump-after-release == true }}
- run: desc::desc_bump_version("dev", normalize = TRUE)
+ run: |
+ desc::desc_bump_version("dev", normalize = TRUE)
+ # verdepcheck with 1 line per package
+ d <- desc::description$new("dev")
+ desc_field_name <- "Config/Needs/verdepcheck"
+ if (d$has_fields(field_name) && !identical(d$get_field(field_name), "")) {
+ desc_field_sep <- "\n "
+ desc_field_normalized <- paste0(
+ field_sep,
+ paste(
+ strsplit(d$get_field(field_name), ", ")[[1]],
+ collapse = field_sep
+ )
+ )
+ d$set(field_name, desc_field_normalized)
+ d$write(file = "dev")
+ }
shell: Rscript {0}
working-directory: ${{ inputs.package-subdirectory }}
|
Thanks for checking. That's quite a lot of custom code :/ Let's leave that then. |
That would be best, I'll raise that issue |
I managed to reduce the code to fewer lines. There was already an issue being tracked on r-lib/desc#122 diff --git a/.github/workflows/version-bump.yaml b/.github/workflows/version-bump.yaml
index 0d41874..f258d28 100644
--- a/.github/workflows/version-bump.yaml
+++ b/.github/workflows/version-bump.yaml
@@ -63,7 +63,14 @@ jobs:
- name: Bump version in DESCRIPTION 📜
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || inputs.vbump-after-release == true }}
- run: desc::desc_bump_version("dev", normalize = TRUE)
+ run: |
+ desc::desc_bump_version("dev", normalize = TRUE)
+ # verdepcheck splitting into new lines
+ d <- desc::description$new("dev")
+ desc_field_name <- "Config/Needs/verdepcheck"
+ if (desc$has_fields(desc_field_name)) {
+ desc$set_list(desc_field_name, desc$get_list(desc_field_name), sep = ",\n\t\t")
+ }
shell: Rscript {0}
working-directory: ${{ inputs.package-subdirectory }} Exampletf <- tempfile()
text <- "Package: test\nImports: tdplyr, tibble\nConfig/Needs/website: tidyverse/tidytemplate, r-lib/desc"
desc <- desc::description$new(text = text)
desc$normalize()
desc_field_name <- "Config/Needs/website"
if (desc$has_fields(desc_field_name)) {
desc$set_list(desc_field_name, desc$get_list(desc_field_name), sep = ",\n ")
}
desc$write(file = tf)
readLines(tf) |> paste0(collapse = "\n") |> cat()
#> Package: test
#> Imports:
#> tdplyr,
#> tibble
#> Config/Needs/website: tidyverse/tidytemplate,
#> r-lib/desc Created on 2023-10-25 with reprex v2.0.2 |
bioc::
for packages from Bioconductor