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

Bioc-friendly feature suggestions #1108

Closed
lcolladotor opened this issue Apr 17, 2020 · 3 comments
Closed

Bioc-friendly feature suggestions #1108

lcolladotor opened this issue Apr 17, 2020 · 3 comments

Comments

@lcolladotor
Copy link

Hi,

Based on my recent work for r-lib/actions#84 and at https://github.com/leekgroup/derfinderPlot/blob/master/dev/01_setup.R, I want to make a few small PRs to usethis.

PR idea 1

One of them is basically about mentioning the Bioconductor Support website for .github/SUPPORT.md. Currently I did so at https://github.com/leekgroup/derfinderPlot/blob/master/dev/01_setup.R#L36-L45 but it could be it's own function or editing the tidyverse template (which you might not want to do as it would be a more global change).

## Customize the support message to mention the Bioconductor Support Website
usethis::use_tidy_support()
support <- readLines(".github/SUPPORT.md")
support <-
    gsub(
        "\\[community.rstudio.com\\]\\(https://community.rstudio.com/\\), and/or StackOverflow",
        "the [Bioconductor Support Website](https://support.bioconductor.org/) using the appropriate package tag",
        support
    )
writeLines(support, ".github/SUPPORT.md")

PR idea 2

A second one could be a badge that has a specific message for the GitHub action I'm suggesting at r-lib/actions#84 .

PR idea 3

I also have a more custom issue_template.md https://github.com/leekgroup/derfinderPlot/blob/master/dev/01_setup.R#L47-L51. Since that code uses ::: at some point, maybe a function that allows custom templates would be useful.

Before making any PRs, I wanted to bring these ideas up.

Best,
Leo

lcolladotor added a commit to lcolladotor/biocthis that referenced this issue May 9, 2020
Created both an introductory and a developer's notes vignette, updated README
and docs with examples, added a second biocViews term, fixed some small
bugs/typos.

Related links (as many as I could remember):

* https://rstd.io/tidytools19
* https://twitter.com/CVWickham
* https://twitter.com/hadleywickham
* https://www.rstudio.com/products/rstudio/download
* https://comunidadbioinfo.github.io/post/building-tidy-tools-cdsb-runconf-2019/#.XrbLMxNKiu4
* http://bioconductor.org/
* https://lcolladotor.github.io/pkgs/
* https://stat.ethz.ch/pipermail/bioc-devel/2020-March/016365.html
* https://www.bioconductor.org/help/docker/
* https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016532.html
* https://github.com/features/actions
* https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016650.html
* r-lib/actions#84
* r-lib/usethis#1108
* r-lib/styler#636
* Bioconductor/BiocCheck#57
* Bioconductor/bioconductor.org#54
* http://bioconductor.org/developers/how-to/coding-style/
* https://style.tidyverse.org/
* https://twitter.com/lorenzwalthert
* https://twitter.com/mt_morgan
* https://docs.travis-ci.com/user/languages/r/
* r-lib/pkgdown#1206
* r-lib/pkgdown#1230
* https://twitter.com/jimhester_
* https://www.jimhester.com/talk/2020-rsc-github-actions/
* https://github.com/Bioconductor/BBS
* https://github.com/Bioconductor/packagebuilder
* https://www.appveyor.com/
* r-hub/rhub#52
* r-hub/rhub#38
* https://www.tidyverse.org/blog/2020/04/usethis-1-6-0/
* https://github.com/r-lib/actions/tree/master/examples
* https://yihui.org/en/2018/03/second-pull-request/
* https://github.com/r-lib/actions/blob/master/examples/check-standard.yaml
* https://help.github.com/en/actions
* https://ropenscilabs.github.io/actions_sandbox/
* https://twitter.com/seandavis12
* https://github.com/seandavi/BiocActions/blob/master/.github/workflows/main.yml
* https://twitter.com/CSoneson
* https://github.com/csoneson/dreval/blob/master/.github/workflows/R-CMD-check.yaml
* https://bioc-community.herokuapp.com/
* https://github.com/leekgroup/derfinderPlot/blob/master/.github/workflows/check-bioc.yml
* https://github.com/LieberInstitute/recount3/blob/master/.github/workflows/check-bioc.yml
* https://github.com/hpages
* r-lib/actions#68
* r-lib/actions#85
* https://twitter.com/opencpu
* https://community.rstudio.com/u/const-ae
* https://community.rstudio.com/t/compiler-support-fo-c-14-features-on-windows/57284/4
* r-lib/xml2#296
* r-lib/xml2#302
* https://github.com/r-lib/usethis/blob/master/.github/workflows/R-CMD-check.yaml
* https://github.com/r-lib/usethis/commits/master/.github/workflows/R-CMD-check.yaml
* https://stat.ethz.ch/pipermail/bioc-devel/2020-April/016703.html
* https://stat.ethz.ch/pipermail/bioc-devel/2020-April/thread.html
* r-lib/remotes#296
* r-lib/actions#86
* r-lib/covr#427
* https://github.com/r-lib/actions/blob/master/examples/pr-commands.yaml
* https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-18-04
* r-lib/actions#50
* actions/checkout#238
* https://github.com/rocker-org/rocker-versioned2/blob/master/dockerfiles/Dockerfile_rstudio_4.0.0-ubuntu18.04
* https://twitter.com/niteshturaga
* https://twitter.com/cboettig
* rocker-org/rocker-versioned#208
* https://github.community/t5/GitHub-Actions/bd-p/actions
* https://www.r-consortium.org/blog/2020/03/18/cdsb-diversity-and-outreach-hotspot-in-mexico
* https://github.com/maxheld83
* r-lib/actions#87
* https://github.com/yutannihilation
@lcolladotor
Copy link
Author

Hi,

In the end, I made a new R package called biocthis at https://lcolladotor.github.io/biocthis/ that builds upon usethis to do all the things I had suggested here and a bit more. See https://lcolladotor.github.io/biocthis/articles/biocthis.html#biocthis-functions-overview for the list of functions.

biocthis relies on several un-exported functions from usethis as noted at https://github.com/lcolladotor/biocthis/runs/659819160?check_suite_focus=true#step:10:64. If in the future there's a new package for expanding usethis (image an rlang but for usethis) or these functions become exported, I'll update biocthis accordingly.

I also noticed that usethis::use_bioc_badge() only works for Bioconductor software packages (experiment, annotation and workflow packages are different) on the Bioc-release branch. Anyway, most Bioconductor packages are software ones so there's likely no real need to expand usethis::use_bioc_badge(), specially since usethis::use_badge() is flexible to support new scenarios. However, if you do decide to expand usethis::use_bioc_badge() let me know and I'll help.

Best,
Leo

@jennybc
Copy link
Member

jennybc commented May 10, 2020

Nice work! I think it is best to approach the way you have, i.e. a bioc-flavored extension of usethis.

I see a lot of calls of this form in the function overview:

withr::with_dir(pkgdir, {
    usethis::use_git()
})

In case you haven't found them yet, I think a better fit for your intention might be usethis::with_project() and usethis::local_project(), instead of with::with_dir().

Would it be possible to write that overview assuming that someone is in their source package? It would seem to be a reasonable assumption and would put the focus on the biocthis functions vs. the withr::with_dir() wrapping.

@lcolladotor
Copy link
Author

Hi Jenny,

Thank you! And thanks for the feedback! I indeed was not familiar with usethis::with_project() and usethis::local_project() and at lcolladotor/biocthis@e89f16d I am no longer using them, so the vignette looks cleaner like you anticipated.

For styler::style_pkg() I ended up using the path argument since it wanted to use the main directory instead of following what usethis::local_project() had set.

Thanks again! The GHA workflow is currently running, but I ran a test on my computer so it should all go well in a couple of minutes.

Best,
Leo

lcolladotor added a commit to lcolladotor/biocthis that referenced this issue May 10, 2020
Second time writing this commit message since it got lost the first time =( I'm
now writing this commit on a text editor window just to be safe.

I see that `usethis::local_project()` runs `usethis::proj_set()` twice: first
for the new `path`, then inside a `withr::defer()` call that restores the
original path. I don't fully understand `withr::defer()`, but it seems to be
triggered earlier that I would like it to. That's why I'm seeing on the
README, some examples, and the vignette after
r-lib/usethis#1108 (comment)
paths that are not the one I expected (the one equivalent to
`file.path(tempdir(), "biocthisexample")`).

One option would be to rely on `usethis::with_project()` to get a similar
behavior to what I had with `withr::with_dir()`, however like Jenny Bryan
point out, this makes the code confusing for a new user to understand. That's
why it seems to me that `usethis::proj_set()` is the better option to use
in the examples, README and vignette code.

I'm also now using a second example package name in the vignette to avoid
clashing with the examples. The code doesn't overwrite the files by default,
so if you run the code with the same example twice you don't get to see the
output messages the second time.
lcolladotor added a commit to lcolladotor/biocthis that referenced this issue May 10, 2020
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

2 participants