-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Unify the method name to get library versions #23323
Conversation
6046cae
to
1387ea9
Compare
NEWS.md
Outdated
@@ -312,6 +312,10 @@ Deprecated or removed | |||
* `Base.cpad` has been removed; use an appropriate combination of `rpad` and `lpad` | |||
instead ([#23187]). | |||
|
|||
* `GMP.gmp_version()` and `GMP.GMP_VERSION` have been renamed to `GMP.version()` and | |||
`GMP.VERSION`, respectively. Similarly, `MPFR.get_version()`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps nix the comma following MPFR.get_version()
?
@@ -26,7 +26,7 @@ function version() | |||
minor = Ref{Cint}(0) | |||
patch = Ref{Cint}(0) | |||
ccall((:git_libgit2_version, :libgit2), Void, | |||
(Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), major, minor, patch) | |||
(Ref{Cint}, Ref{Cint}, Ref{Cint}), major, minor, patch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated? Perhaps better in a separate pull request as such?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, but since this is related to version
might as well just do it here. THis is in any case a very trivial change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm modulo the minor comments! :)
@Sacha0 thanks for the review! |
base/gmp.jl
Outdated
gmp_bits_per_limb() = Int(unsafe_load(cglobal((:__gmp_bits_per_limb, :libgmp), Cint))) | ||
|
||
const GMP_VERSION = gmp_version() | ||
const VERSION = version() | ||
const GMP_BITS_PER_LIMB = gmp_bits_per_limb() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like the GMP_
and gmp_
prefixes are also a bit redundant with the module name here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should those be done in the same PR? Will they also need a deprecation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should those be done in the same PR?
Sure, why not? :)
Will they also need a deprecation?
Sure, why not? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
fba7f29
to
0853a07
Compare
base/deprecated.jl
Outdated
@@ -1701,6 +1701,12 @@ export hex2num | |||
# issue #17886 | |||
# deprecations for filter[!] with 2-arg functions are in associative.jl | |||
|
|||
@eval GMP @deprecate gmp_version() version() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all of these should have a false
at the end, since none of them are currently exported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True (although they don't seem to be exported, but better be safe )
unrelated libgit2 error on macos |
Nice more conflicts to rebase ... :P |
base/deprecated.jl
Outdated
@@ -1696,14 +1696,6 @@ export hex2num | |||
@deprecate ctranspose adjoint | |||
@deprecate ctranspose! adjoint! | |||
|
|||
@deprecate convert(::Type{Vector{UInt8}}, s::AbstractString) Vector{UInt8}(s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebase mistake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uggh, very strange. The online tool is kinda terrible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. It's probably a good idea to test the deprecations if you haven't already – they're easy to get wrong.
Updated with LAPACK as well. I tested the deprecations and they work, but you only get the error once, which is weird. See below (this seems unrelated) _ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: https://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.7.0-DEV.1458 (2017-08-23 14:26 UTC)
_/ |\__'_|_|_|\__'_| | ver/9e3931c (fork: 15 commits, 0 days)
|__/ | x86_64-linux-gnu
julia> Base.MPFR.get_version()
WARNING: get_version() is deprecated, use version() instead.
Stacktrace:
[1] depwarn at ./deprecated.jl:68 [inlined]
[2] get_version() at ./deprecated.jl:56
[3] eval(::Module, ::Expr) at ./repl/REPL.jl:3
[4] eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./repl/REPL.jl:69
[5] macro expansion at ./repl/REPL.jl:100 [inlined]
[6] (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:96
while loading no file, in expression starting on line 0
v"3.1.5+r11590"
julia> Base.GMP.gmp_version()
v"6.1.2"
julia> ^C
julia>
mus@mus-laptop:~/julia$ ./julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: https://docs.julialang.org
_ _ _| |_ __ _ | Type "?help" for help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.7.0-DEV.1458 (2017-08-23 14:26 UTC)
_/ |\__'_|_|_|\__'_| | ver/9e3931c (fork: 15 commits, 0 days)
|__/ | x86_64-linux-gnu
julia> Base.GMP.gmp_version()
WARNING: gmp_version() is deprecated, use version() instead.
Stacktrace:
[1] depwarn at ./deprecated.jl:68 [inlined]
[2] gmp_version() at ./deprecated.jl:56
[3] eval(::Module, ::Expr) at ./repl/REPL.jl:3
[4] eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./repl/REPL.jl:69
[5] macro expansion at ./repl/REPL.jl:100 [inlined]
[6] (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:96
while loading no file, in expression starting on line 0
v"6.1.2"
julia> Base.MPFR.get_version()
v"3.1.5+r11590"
|
Can we merge this now? Osx had a spawn failure before the rebasing. Thanks. |
Thanks! |
No problem. Thanks for doing it! |
@eval GMP @deprecate gmp_bits_per_limb() bits_per_limb() false | ||
@eval GMP @Base.deprecate_binding GMP_BITS_PER_LIMB BITS_PER_LIMB false | ||
@eval MPFR @deprecate get_version() version() false | ||
@eval LinAlg.LAPACK @deprecate laver() version() false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to give the same behavior as the previous function this deprecation should return a tuple
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true (anyone mind fixing this? I don't have time to do it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the best way to fix this is to leave laver
as it was before this change and just add version
since, generally, our LAPACK wrappers are pretty thin and don't add much Julia abstraction on top of LAPACK.
addresses #23314