EcoJulia / Phylo.jl

Simple phylogenetic trees in Julia to work with Diversity.jl - https://github.com/EcoJulia/Diversity.jl
BSD 2-Clause "Simplified" License
34 stars 13 forks source link

use dirname(@__FILE__) instead of Pkg.dir #2

Closed tkelman closed 7 years ago

tkelman commented 7 years ago

this allows installing and loading the package from elsewhere

richardreeve commented 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...

tkelman commented 7 years ago

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.

richardreeve commented 7 years ago

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?

tkelman commented 7 years ago

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