Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pkg.installed() misdocumented or misbehave #19436

Closed
DANA-Laboratory opened this issue Nov 27, 2016 · 4 comments
Closed

Pkg.installed() misdocumented or misbehave #19436

DANA-Laboratory opened this issue Nov 27, 2016 · 4 comments
Labels
docs This change adds or pertains to documentation packages Package management and loading

Comments

@DANA-Laboratory
Copy link
Contributor

DANA-Laboratory commented Nov 27, 2016

Refer to this doc paragraph:

installed(pkg) → Void | VersionNumber

If pkg is installed, return the installed version number, otherwise return nothing.

and also this relate QA:

Pkg.installed("anInvalidPackage") function should return nothing but it throws an error:

julia> VERSION
v"0.5.0"
julia> Pkg.installed("anInvalidPackage")
ERROR: anInvalidPackage is not a package (not registered or installed)
 in installed(::String) at .\pkg\entry.jl:123
 in (::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#installed,Tuple{String}})
() at .\pkg\dir.jl:31
 in cd(::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#installed,Tuple{String}
}, ::String) at .\file.jl:48
 in #cd#1 at .\pkg\dir.jl:31
 in installed(::String) at .\pkg\pkg.jl:129

I think one of those, documentation or Pkg.installed() function behavior needs review.

@kshyatt kshyatt added the packages Package management and loading label Nov 27, 2016
@StefanKarpinski
Copy link
Member

IIRC, this is intentional so this should be a doc fix:

  • if the package is installed, return its version
  • if the package exists but is not installed, return nothing
  • if the package does not exist, raise an error.

@StefanKarpinski StefanKarpinski added the docs This change adds or pertains to documentation label Nov 28, 2016
@DANA-Laboratory
Copy link
Contributor Author

same issue for Pkg.available()
related to:
#18206

@alexmorley
Copy link
Contributor

alexmorley commented Dec 4, 2016

Should be fixed by #19435 ?

@martinholters
Copy link
Member

Yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation packages Package management and loading
Projects
None yet
Development

No branches or pull requests

5 participants