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
Add support for MOI.SolverVersion #71
Comments
I never liked this though You could also parse the TOML file |
Hmm there is PkgVersion.jl - see https://github.com/KlausC/PkgVersion.jl/blob/main/src/PkgVersion.jl |
There is https://discourse.julialang.org/t/how-to-find-out-the-version-of-a-package-from-its-module/37755/16?u=chriscoey but it only works on 1.9+ |
@odow could we use some combination of
if the julia version < 1.9, and |
Is it really necessary? This was mainly intended for solvers which have upstream versions that are unrelated their Julia package version. But presumably something like @static if VERSION < v"1.9"
import TOML
function MOI.get(model::Optimizer, ::MOI.SolverVersion)
project = TOML.parsefile(joinpath(pkgdir(@__MODULE__), "Project.toml"))
return VersionNumber(project["version"])
end
else
MOI.get(model::Optimizer, ::MOI.SolverVersion) = pkgversion(@__MODULE__)
end |
If the standard procedure is not to support MOI.SolverVersion in cases like this (pure Julia solvers), then it's OK to close this issue without a fix. I can just use |
The above worked for my use case so I'll close |
@odow do you know how to get the version of the active package, so we can return it as a string?
The text was updated successfully, but these errors were encountered: