miraisolutions / SmaRP

Shiny app for projecting retirement funds / benefits
https://mirai-solutions.ch/gallery/smarp
20 stars 9 forks source link

Missing automatic cleanup of config-created data/ #119

Closed riccardoporreca closed 5 years ago

riccardoporreca commented 5 years ago

The automatic package configuration of SmaRP creates the data in the data/ folder using the setup provided by configure and the script tools/config/configure.R.

We should let the data be automatically cleaned-up in the tools/config/cleanup.R script.

If we don't, when we do a build+install including a preliminary installation for building vignettes, a warning is issued, which is treated as error by the remotes::install_*() functions.

E.g.

remotes::install_github("miraisolutions/SmaRP", "v1.1.1", build_opts = "")

(note that build_opts = "" is used to include building vignettes, there is no build_vignettes argument, see #120, r-lib/remotes#353)

Downloading GitHub repo miraisolutions/SmaRP@v1.1.1
✔  checking for file ‘/tmp/Rtmpec6zsv/remotes194c3445e3d4/miraisolutions-SmaRP-75b6fc9/DESCRIPTION’ ...
─  preparing ‘SmaRP’:
  ✔  checking DESCRIPTION meta-information ...
─  running ‘cleanup’
─  installing the package to build vignettes
✔  creating vignettes (3.5s)
─  running ‘cleanup’
─  checking for LF line-endings in source and make files and shell scripts
─  checking for empty or unneeded directories
─  looking to see if a ‘data/datalist’ file should be added
─  building ‘SmaRP_1.1.1.tar.gz’

Installing package into ‘/home/mirai/R/x86_64-pc-linux-gnu-library/3.5-MRAN-2018-12-20’
(as ‘lib’ is unspecified)
* installing *source* package ‘SmaRP’ ...
** preparing to configure package 'SmaRP' ...
Error in dir.create("data") : 
  (converted from warning) 'data' already exists
Calls: source_file -> eval -> eval -> dir.create
Execution halted
ERROR: configuration failed for package ‘SmaRP’

It also makes sense to add data to .Rbuildignore in case we are building the package from a local checkout where the configuration script has been run (e.g. by INSTALLing the package)