robertzk / lockbox

Bundler-style dependency management for R
MIT License
49 stars 11 forks source link

Lockbox appears to have unstated dependency on methods::is() #112

Closed russellpierce closed 7 years ago

russellpierce commented 7 years ago

~/data-science-env/lockfiles/lockfile-v0.1.0.yml

packages:
  -
    name: plumber
    version: 0.3.2
    load: false

moo.R:

library(lockbox)
lockbox('~/data-science-env/lockfiles/lockfile-v0.1.0.yml')
print("moo")
library(plumber)

Console:

> Rscript moo.R
Retrieving dependency info...
Error in is(obj, "locked_package") : could not find function "is"
Calls: lockbox ... withCallingHandlers -> suppressMessages -> withCallingHandlers
Execution halted
robertzk commented 7 years ago

Thanks! We've had to explicitly load library(methods) in batch situations before. I'll try to hunt down the stray calls.

russellpierce commented 7 years ago

I'd tried tweaking the doc string and Namespace for @importFrom for methods::is() but that didn't work. If you have spare time and a thought as to why doesn't work, I'd love to hear it. Is it just that package:methods is special?

robertzk commented 7 years ago

The NAMESPACE file that's generated from the roxygen @importFrom should copy is into the package's namespace. It probably has something to do with the fact that the methods package is built in, although I'd have to dig in a bit to understand why.