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

usethis-style internal package to setup pkg workflow #6

Open
malcolmbarrett opened this issue Jul 8, 2019 · 6 comments
Open

usethis-style internal package to setup pkg workflow #6

malcolmbarrett opened this issue Jul 8, 2019 · 6 comments

Comments

@malcolmbarrett
Copy link

malcolmbarrett commented Jul 8, 2019

It might be worth thinking about developing an internal package to implement many of the best practices we have here. usethis covers a lot of it but this could wrap a few functions as well as add a few specialty workflows, like a function that automatically adds https://github.com/USCbiostats/software-dev/blob/master/templates/r-package.md to the repo's issue. If feasible, it might be a good place to put wrapper functions for connecting to HPC etc.

Plus we can finally make a USC ggplot2 theme ;)

package name idea: uscthis

@gvegayon
Copy link
Member

gvegayon commented Jul 8, 2019

I love the pkgname!

@malcolmbarrett
Copy link
Author

malcolmbarrett commented Jul 9, 2019

A few notes to myself after thinking about this.

The main function could look like

create_usc_package <- function(path, usc_github = TRUE, bioconductor = FALSE) {
  {check if has access to uscbiostats repo, otherwise use user's GitHub}
  {do a bunch of usethis stuff to set up packge, git, repo, README, roxygen rmd, etc} 
  {post issue template}
  {open project}
}

Related to #4, if we do a blogdown site, we could also have a set of functions to streamline posts based on the PR helper functions in usethis

create_usc_post <- function(title, author, date) {
  {usethis pr functions to fork and open project}
  {create new Rmd file using a template with guidelines on posting about a package}
}

usc_post_push <- function() {
  {submit PR with post to main repo}
}

@pmarjora
Copy link
Contributor

pmarjora commented Jul 9, 2019 via email

@malcolmbarrett
Copy link
Author

malcolmbarrett commented Jul 20, 2019

I set up the ymlthis Travis to automatically deploy a pkgdown site to GitHub pages; the .travis.yml file created by create_usc_package() could be set up to do so by default: https://github.com/r-lib/ymlthis/blob/master/.travis.yml. Would need to include instructions for including a secure GitHub PAT

@gvegayon
Copy link
Member

I set up the ymlthis Travis to automatically deploy a pkgdown site to GitHub pages; the .travis.yml file created by create_usc_package() could be set up to do so by default: https://github.com/rstudio-education/ymlthis/blob/master/.travis.yml. Would need to include instructions for including a secure GitHub PAT

Dude, this is 404! Yes, that works great. I recently did the same with ergmito:

before_deploy: Rscript -e 'remotes::install_cran("pkgdown")'
deploy:
  provider: script
  script: Rscript -e 'pkgdown::deploy_site_github()'
  skip_cleanup: true
  on:
    branch: master
    condition: $TRAVIS_OS_NAME = linux

I did had to make sure that the site was only deployed on the master branch on linux :).

@malcolmbarrett
Copy link
Author

Oops, we moved it to r-lib yesterday! It's updated.

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