Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically install packages when requested #19

Merged
merged 3 commits into from
Dec 13, 2023
Merged

Automatically install packages when requested #19

merged 3 commits into from
Dec 13, 2023

Conversation

richfitz
Copy link
Member

@richfitz richfitz commented Dec 13, 2023

Small PR which means that users can just install hermod and we'll grab the rest as we need them.

We need to (later, I think) work out how to flag when version numbers are incompatible, that might take some care.

If you want to see this in action:

remove.packages(c("hermod", "hermod.windows", "conan2"))

then from somewhere on the network share:

> hermod::hermod_init(".")
✔ Initialised hermod at '.'
ℹ Next, call 'hermod_configure()'
> hermod::hermod_configure("windows")
ℹ Trying to install 'hermod.windows'
ℹ To prevent this, set options(hermod.no_install_missing = TRUE)
Installing package into ‘/home/rfitzjoh/lib/R/library’
(as ‘lib’ is unspecified)
also installing the dependency ‘conan2’

trying URL 'https://mrc-ide.r-universe.dev/src/contrib/conan2_1.9.90.tar.gz'
Content type 'application/x-gzip' length 1139673 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

trying URL 'https://mrc-ide.r-universe.dev/src/contrib/hermod.windows_0.1.0.tar.gz'
Content type 'application/x-gzip' length 110784 bytes (108 KB)
==================================================
downloaded 108 KB

* installing *source* package ‘conan2’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (conan2)
* installing *source* package ‘hermod.windows’ ...
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (hermod.windows)

The downloaded source packages are in
	‘/tmp/RtmpJAdNQJ/downloaded_packages’
✔ Installation of 'hermod.windows' successful

Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0e52b7c) 100.00% compared to head (722c1ac) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #19   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          357       380   +23     
=========================================
+ Hits           357       380   +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@richfitz richfitz marked this pull request as ready for review December 13, 2023 14:13
Copy link
Contributor

@weshinsley weshinsley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that all looks good - I've suggested changes from
hermod.no_install_missing to hermond.auto_install_missing - although there were a few changes - perhaps I should have done that in a non-web commit...

R/util.R Outdated Show resolved Hide resolved
R/util.R Outdated Show resolved Hide resolved
R/util.R Outdated Show resolved Hide resolved
tests/testthat/test-util.R Outdated Show resolved Hide resolved
tests/testthat/test-util.R Outdated Show resolved Hide resolved
tests/testthat/test-util.R Outdated Show resolved Hide resolved
tests/testthat/setup.R Outdated Show resolved Hide resolved
@weshinsley weshinsley merged commit b1dd7fa into main Dec 13, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants