Closed tkelman closed 7 years ago
I see what you're doing, but if someone uses a different version of rcall.jl from the Phylo package that they have installed, I certainly can't guarantee it would work, so I'd be inclined to only work with the package's own rcall.jl file...
Obviously, once the dependency checking stuff works in Julia - as discussed in JuliaLang/julia#6195 - it'll just be part of the package anyway, so the problem will go away...
All this does is makes sure you're loading this file from a relative path to where the test file is. If you have a copy in a location outside Pkg.dir, that you add to LOAD_PATH and run the package from there, Pkg.dir is wrong and won't work.
I do understand what you're doing, but I still can't offer any assurance your code will work if you use a different rcall.jl
from the one that is installed with the package. I understand that I risk people using LOAD_PATH
potentially getting errors, but can you see that your version will get people who have two different copies of the package folder on their computers (like me!) getting errors, as your code will access the wrong one? Anyway, isn't this really a bug in Pkg.dir()
, which should return the package folder when it is provided with a package?
this is using the one installed with the package. why do you think this would ever load the "wrong one" ? it will load a file from src adjacent to the test file that's running
this allows installing and loading the package from elsewhere