Testing

micro: devtools::load_all() and interactively running tests mezzo: testthat::test_file("tests/testthat/mytest.R") macro: devtools::test() macro+: devtools::check()

rhub::rhub_check(branch = "develop") [choose 1,2,3,4]

Force-installing new version to re-build vignette & check tests

R CMD build --no-build-vignettes R CMD check --no-build-vignettes --no-tests (run R CMD check --help for more options) Alternatively: install current version with devtools::install() or Ctrl+Shift+B OR devtools::build_rmd("vignettes/my-vignette.Rmd")

Old approach

R CMD build gcplyr R CMD check gcplyr_X.X.X.tar.gz R CMD INSTALL gcplyr_X.X.X.tar.gz

Every new version

  1. Save & commit all changes to code
  2. Run checks: devtools::check() rhub::rhub_check(branch = "develop") [choose 1,2,3,4] Note that 2 and 3 usually fail because they fail to install rjava dependency devtools::check_win_devel()
  3. Organize, edit, and proofread NEWS.md. Commit.
  4. Decide new version number, update DESCRIPTION version (dropping .9000) and date, commit
  5. devtools::install()
  6. Re-build vignettes (see code in vignette to re-build all formats at once). Commit
  7. Re-knit README.Rmd and index.Rmd. Save & commit newly generated README.md files in bash: git commit -m "commit msg here" --no-verify
  8. Push
  9. git checkout master
  10. git merge develop
  11. git push
  12. git checkout develop
  13. Update DESCRIPTION to development version number (add .9000 at end of previous version)
  14. Add header to NEWS.md for development version number
  15. Add release on GitHub

Releasing to CRAN

  1. run process above, make sure you're back on master branch
  2. edit cran-comments.md
  3. devtools::release(args = "--compact-vignettes=gs+qpdf")

Managing master & develop branches:

https://stackoverflow.com/questions/39478482/how-to-create-development-branch-from-master-on-github

Creating a git develop branch

You can list all of your current branches like this:

git branch -a

This shows all of the local and remote branches. Assuming you only have a single master branch, you'd see the following:

* master
  remotes/origin/master

The * means the current branch.

To create a new branch named develop, use the following command:

git checkout -b develop

The -b flag creates the branch. Listing the branches now should show:

* develop
  master
  remotes/origin/master

Changing branches

You shouldn't commit anything directly to the master branch. Instead do all your work on the develop branch and then merge develop into master whenever you have a new public release.

You are already in your develop branch, but if you weren't, the way to switch is as follows:

git checkout develop

That's the same way you create a branch but without the -b.

Making changes on develop

When making changes, add and commit as usual:

git add .
git commit -m "whatever"

The first time you push to your remote do it like so:

git push -u origin develop

The -u flag stands for --set-upstream. After the first time you only need to do it like this:

git push

Merging develop to master

Once your develop is ready to merge into master you can do it like so:

First switch to your local master branch:

git checkout master

To merge develop into master do the following:

git merge develop

Then push the changes in local master to the remote master:

git push

Done.

Deleting a branch

If you don't need the develop branch anymore, or you just want to delete it and start over, you can do the following:

Delete the remote develop branch:

git push -d origin develop

Then delete the local branch:

git branch -d develop

The -d means delete.



mikeblazanin/gcplyr documentation built on Jan. 18, 2025, 11:40 a.m.