mitchelloharawild / distributional

Vectorised distributions for R
https://pkg.mitchelloharawild.com/distributional
GNU General Public License v3.0
97 stars 15 forks source link

Use of `|>` introduces a dependency on R >= 4.1 #128

Open sbfnk opened 2 weeks ago

sbfnk commented 2 weeks ago

Version 0.5.0 has introduced the use of |> and thus a dependency on R >= 4.1. This could be made explicitly in the DESCRIPTION file or else re-coded (full-text search suggests this only occurs in a few places).

Sorry, no reprex but we see this in GHA for R 4.0 at https://github.com/epiforecasts/scoringutils/actions/runs/10924084855/job/30322278227?pr=915#step:5:3194

  ℹ Building distributional 0.5.0
  ✖ Failed to build distributional 0.5.0 (326ms)
  Error: 
  ! error in pak subprocess
  Caused by error in `stop_task_build(state, worker)`:
  ! Failed to build source package distributional.
  Full installation output:
  * installing *source* package ‘distributional’ ...
  ** package ‘distributional’ successfully unpacked and MD5 sums checked
  staged installation is only possible with locking
  ** using non-staged installation
  ** R
  Error in parse(outFile) : 
    /tmp/Rtmp95ruht/R.INSTALL15992b0796f9/distributional/R/mixture.R:31:41: unexpected '>'
  30: format.dist_mixture <- function(x, width = getOption("width"), ...){
  31:   dists <- lapply(x[["dist"]], format) |>
                                              ^
  ERROR: unable to collate and parse R files for package ‘distributional’
  * removing ‘/tmp/RtmpQt73QS/pkg-lib129017cd62f1/distributional’
  ---
  Backtrace:
  1. pak::lockfile_install(".github/pkg.lock")
  2. pak:::remote(function(...) { …
  3. err$throw(res$error)
  ---
  Subprocess backtrace:
   1. base::withCallingHandlers(cli_message = function(msg) { …
   2. get("lockfile_install_internal", asNamespace("pak"))(...)
   3. plan$install()
   4. pkgdepends::install_package_plan(plan, lib = private$library, num_workers = nw, …
   5. base::withCallingHandlers({ …
   6. pkgdepends:::handle_events(state, events)
   7. pkgdepends:::handle_event(state, i)
   8. pkgdepends:::stop_task(state, worker)
   9. pkgdepends:::stop_task_build(state, worker)
  10. base::throw(pkg_error("Failed to build source package {.pkg {pkg}}.", …
  11. | base::signalCondition(cond)
  12. global (function (e) …
  Execution halted
  Error: Process completed with exit code 1.