Skip to content

[R-pkg-devel] Installing "Additional" Packages During Tests

4 messages · brodie gaslam, Uwe Ligges

#
1. You should never install packages without asking the user.

2. a package should never write to the user file space or default 
libraries unless the user akss for it explicitly.
In tests, use tempdir().

3. You cannot expect that the library is writeable. It is not in many 
network installations.

Best,
Uwe Ligges
On 18.03.2019 16:48, brodie gaslam via R-package-devel wrote:
#
I believe your first point makes the alternate workflow below illegal, but the subsequent ones add just enough ambiguity that I'd like to makes sure.? How about:
0. Only during the running of tests
1. Create a temporary directory tmplib using tempfile()/dircreate().
2. Install dummy package to that temporary directory using `lib=tmplib`: install.packages(srcdir, type='src', repos=NULL, lib=tmplib).
3. In the tests, use library(testpkg, lib.loc=tmplib)4. unload / remove / unlink temp directory on.exit
This is only in the test running.? None of the code in the package proper that the user would invoke in normal use installs packages.? It only happens if the user installs and runs the tests, and with the above modification, it would only be into a temporary library directory.
Thank you for your patience and attention.
Best,
Brodie.
On Monday, March 18, 2019, 11:56:55 AM EDT, Uwe Ligges <ligges at statistik.tu-dortmund.de> wrote:
1. You should never install packages without asking the user.

2. a package should never write to the user file space or default 
libraries unless the user akss for it explicitly.
In tests, use tempdir().

3. You cannot expect that the library is writeable. It is not in many 
network installations.

Best,
Uwe Ligges
On 18.03.2019 16:48, brodie gaslam via R-package-devel wrote:

  
  
#
Simply resubmit such a package, we will lookninto the details and the 
team will decide.

Best,
Uwe  Ligges
On 18.03.2019 17:28, brodie gaslam wrote:
#
On 18.03.2019 17:28, brodie gaslam wrote:
Please submit following these suggestions and the CRAN team will look 
into the details and decide.

Best,
Uwe