I am beginning to use Julia 1.0. Pkg.dir() no longer seems to work (and has no docs). What has replaced it? Pkg.status() works differently. Alas, these are just minor questions. I have a reason for posting to development"
Should the default on Pkg.add() be to do the first-time compilation right away, too? Who would want to add a package and not run it? Is there a reason?
Do packages have a variable that tells the package manager whether they have been ported/tested on a particular julia version? (This is not just a minimum Julia version.) I am asking because Glob and TimeSeries have a successful Pkg.add(), but both flunk on first-time compilation (and I have a fresh julia 1.0). So I am wondering whether these two packages [as examples] have made the jump from 0.6 to 1.0. if they have, then not very successfully so. if they have not, then the Pkg.add() should have told me this.
In 99.5% of cases you can replace it with @__DIR__ usage. Otherwise there is Base.pathof.
If you plan to add an extra package after it might be that you need to recompile anyway, so you do double work.
No, and in theory/in the future the package manager should not install packages, unless the package declares that it works. For example, when Julia v2.0 is released, packages that don’t explicitly support this will not be installable. See https://docs.julialang.org/en/latest/stdlib/Pkg/#Compatibility-1
@__DIR__ just gives the cwd for me. It does not tell me where the (local) packages for this version are installed for me. can you please give an example of Base.pathof() usage?
still can’t figure out how to obtain the version number of a package.
julia> using DataFrames
julia> Base.pathof(DataFrames)
"/Users/me/.julia/packages/DataFrames/utxEh/src/DataFrames.jl"
I need something like 0.11.3. I tried to
# grep -R -i version /Users/ivo/.julia/packages/DataFrames/utxEh/src/
to see if I could find a version string in a place, but failed.
On reflection, it would make sense to make an immediate compilation the default for Pkg.add(), especially in the REPL; but an optional keyword can suppress it .
I think the request is for a snippet that, from within another package, obtains the version number of some specific installed package (or nothing if not installed).