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

Update deprecations for breaking release #1793

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions src/Deprecations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@
# ALL aliases here are only a temporary measure to allow for a smooth transition downstream.
# they will be replaced by deprecations eventually

# renamed in 0.42.3
@alias FreeAssAlgebra FreeAssociativeAlgebra
@alias FreeAssAlgElem FreeAssociativeAlgebraElem

# renamed in 0.42.6
@alias addeq! add!
#= currently nothing here =#

###############################################################################
#
Expand All @@ -26,12 +21,16 @@
# By calling this macro from the respective packages, we can ensure that the deprecated bindings are available there.
macro include_deprecated_bindings()
return esc(quote
# deprecated in 0.42
# deprecated in 0.42.0
Base.@deprecate_binding FreeModule free_module
Base.@deprecate_binding VectorSpace vector_space
Base.@deprecate_binding UniversalPolynomialRing universal_polynomial_ring
Base.@deprecate_binding is_finiteorder is_finite_order

# renamed in 0.43.0
Base.@deprecate_binding FreeAssAlgebra FreeAssociativeAlgebra
Base.@deprecate_binding FreeAssAlgElem FreeAssociativeAlgebraElem
Base.@deprecate_binding addeq! add!
end)
end

Expand Down Expand Up @@ -60,7 +59,7 @@ import .Generic: set_exponent_vector!; @deprecate set_exponent_vector!(a::Generi
import .Generic: is_gen; @deprecate is_gen(x::Generic.MPoly{T}, ::Type{Val{ord}}) where {T <: RingElement, ord} is_gen(x, Val(ord))
import .Generic: degree; @deprecate degree(f::Generic.MPoly{T}, i::Int, ::Type{Val{ord}}) where {T <: RingElement, ord} degree(f, i, Val(ord))

# will become deprecated in 0.43.0
change_base_ring(p::MPolyRingElem{T}, g, new_polynomial_ring) where {T<:RingElement} = map_coefficients(g, p, parent = new_polynomial_ring)
mulmod(a::S, b::S, mod::Vector{S}) where {S <: MPolyRingElem} = Base.divrem(a * b, mod)[2]
var"@attr"(__source__::LineNumberNode, __module__::Base.Module, expr::Expr) = var"@attr"(__source__, __module__, :Any, expr) # delegate `@attr functionexpression` to `@attr Any functionexpression` (macros are just functions with this weird extra syntax)
# deprecated in 0.43.0
@deprecate change_base_ring(p::MPolyRingElem{T}, g, new_polynomial_ring) where {T<:RingElement} map_coefficients(g, p, parent = new_polynomial_ring)
@deprecate mulmod(a::S, b::S, mod::Vector{S}) where {S <: MPolyRingElem} Base.divrem(a * b, mod)[2]
@deprecate var"@attr"(__source__::LineNumberNode, __module__::Base.Module, expr::Expr) var"@attr"(__source__, __module__, :Any, expr) # delegate `@attr functionexpression` to `@attr Any functionexpression` (macros are just functions with this weird extra syntax)
4 changes: 2 additions & 2 deletions test/Attributes-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ end
# the following tests need the improved `@macroexpand` from Julia 1.7
@testset "@attr error handling" begin
# wrong number of arguments
@test_throws ArgumentError @macroexpand @attr foo() = 1
@test_throws ArgumentError @macroexpand @attr foo(x::Int, y::Int) = 1
@test_throws ArgumentError @macroexpand @attr Any foo() = 1
@test_throws ArgumentError @macroexpand @attr Any foo(x::Int, y::Int) = 1
@test_throws ArgumentError @macroexpand @attr Int foo() = 1
@test_throws ArgumentError @macroexpand @attr Int foo(x::Int, y::Int) = 1
@test_throws MethodError @macroexpand @attr Int foo(x::Int) = 1 Any
Expand Down
Loading