Skip to contents
library(EPACmodel)
#> 
#> Attaching package: 'EPACmodel'
#> The following object is masked from 'package:stats':
#> 
#>     simulate

This article is intended for developers of this package. It document developer workflows as well as quirks of this project.

{renv}

This package uses {renv} to manage dependencies.

In order to ensure the development environment is properly tracked, please use the dev=TRUE option in renv functions. For instance, to check the status of your environment, use renv::status(dev=TRUE). To log packages, use renv::snapshot(dev=TRUE). (renv::restore() does not use this flag.)

Note that at project startup, renv::status(dev=FALSE) will execute first, reporting that the project is out-of-sync. After, the project is set up to automatically run renv::status(dev=TRUE), so consult this second output to check the true status of the project.

Creating a new release

  1. Create a feature-specific branch and make changes to the code as desired.
  2. Once the work is completed, increment the package version number in DESCRIPTION and create a pull request and, summarizing changes to the package. Follow semantic versioning rules to select a version number. Namely, version numbers should be of form a.b.c, where:
  • a is a major version (changes in how the user interfaces with the software, will likely break old code)
  • b is a minor version (new features that are backwards compatible, i.e., won’t break old code)
  • c is a patch version (bug fixes that are backwards compatible)
  1. Once the pull request is accepted and merged into main, pull all changes to origin/main onto your local instance of the repo.
  2. Open a git-enabled terminal (like Git Bash) and ensure you’re on the main branch (e.g. with git branch)
  3. Create an annotated git tag for this version with git tag -a [[VERSION]] -m "[[SUMMARY]]". Here, replace [[VERSION]] with the version number (in format va.b.c–this will be the tag name) and [[SUMMARY]] with a short summary of what’s new in this version of the code.
  4. Push your tag up to the origin repo with git push origin [[VERSION]]. Note that by default, git push will not push up tags.
  5. Go to the EPACModel GitHub page and click the “Releases” link in the right sidebar.
  6. Select the “Draft a new release” button. Choose the tag you just created and then select “Generate release notes”. Add any missing details to the autogenerated release notes. Ensure this release is set as the latest release. Click “Publish release” to finish.

Now the package can be installed with something like remotes::install_github('phac-nml-phrsd/EPACmodel@va.b.c') (or using renv::install()).