openpharma / staged.dependencies

R package to implement development stages for package development
https://openpharma.github.io/staged.dependencies/
MIT License
12 stars 3 forks source link

Add renv lockfiles into object and use renv::install for external deps if inside renv environment #145

Closed nikolas-burkoff closed 2 years ago

nikolas-burkoff commented 2 years ago

Closes: https://github.com/openpharma/staged.dependencies/issues/147 and closes #146

image

To test #147:

x <- dependency_table("openpharma/stageddeps.house", "repo@host", ref = "renv@main")
print(x$renv_files$stageddeps.house)
print(x$renv_files$stageddeps.food)
# test a profile which only exists on stageddeps.house:
x <- dependency_table("openpharma/stageddeps.house", "repo@host", ref = "profiles@renv@main", renv_profile = "example")
print(x$renv_files$stageddeps.house)
print(x$renv_files$stageddeps.food)

To test #146

First run - outside of an renv environment:

x <- dependency_table("openpharma/stageddeps.house", "repo@host", ref = "renv@main") # could use "main" 
install_deps(x)

Then create an renv environment and make sure Bioconductor repos are in options("repos") and run the same command and you'll see the dependencies coming from the cache (or being installed into the cache if they are not already in the cache)

github-actions[bot] commented 2 years ago

R CMD check for R vlatest

R CMD check resulted in Status: OK

Click here to show full output ```R * using log directory '/__w/staged.dependencies/staged.dependencies/staged.dependencies.Rcheck' * using R version 4.1.0 (2021-05-18) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option '--no-manual' * checking for file 'staged.dependencies/DESCRIPTION' ... OK * checking extension type ... Package * this is package 'staged.dependencies' version '0.2.4' * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package 'staged.dependencies' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \\usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking examples ... OK * checking for unstated dependencies in 'tests' ... OK * checking tests ... OK Running 'testthat.R' * DONE Status: OK ```

Pusher: @nikolas-burkoff, Action: pull_request

github-actions[bot] commented 2 years ago

Unit Tests Summary

    1 files    13 suites   12s :stopwatch:   68 tests   68 :heavy_check_mark: 0 :zzz: 0 :x: 205 runs  205 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit 967569dd.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 2 years ago

Unit Test Details

🙌 All tests passed!

pawelru commented 2 years ago

I can see that there are a lot of dynamic creation of files/dirs paths. Have you seen renv::paths already? You might find there something you are trying to create on your own.

nikolas-burkoff commented 2 years ago

can see that there are a lot of dynamic creation of files/dirs paths. Have you seen renv::paths already? You might find there something you are trying to create on your own.

So if you run dependency_table("openpharma/x", "repo@host", ref = "main") then a cloned copy of each repo, including "openpharma/x" is checked out into the cache which is fine - but if you run the addin or start from a local copy of a repo (i.e dependency_table("../my_files/x") then staged.deps copies your local copy of the repo into the cache.

When we copy we don't want to copy the whole renv library as that is huge and takes ages but we do want to copy over all the renv.lock files (some of which are in renv/profiles/something/ directory) (these are there if you did a fresh clone) - hence the messing around with paths to make sure the right things are copied over