Skip to content

Commit bf4f03e

Browse files
authored
Require Julia >= 1.10 (#1959)
1 parent 05a7875 commit bf4f03e

File tree

9 files changed

+12
-62
lines changed

9 files changed

+12
-62
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
version:
26-
- '1.3'
26+
- 'min'
2727
- '1'
2828
- pre
2929
os:
@@ -35,8 +35,6 @@ jobs:
3535
- uses: julia-actions/setup-julia@v2
3636
with:
3737
version: ${{ matrix.version }}
38-
# ARM64 on macos-latest is neither supported by older Julia versions nor setup-julia
39-
arch: ${{ matrix.os == 'macos-latest' && matrix.version != '1.3' && 'aarch64' || 'x64' }}
4038
show-versioninfo: true
4139
- uses: julia-actions/cache@v2
4240
- uses: julia-actions/julia-buildpkg@v1

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ DistributionsTestExt = "Test"
3232

3333
[compat]
3434
AliasTables = "1"
35-
Aqua = "0.8"
35+
Aqua = "0.8.9"
3636
Calculus = "0.5"
3737
ChainRulesCore = "1"
3838
ChainRulesTestUtils = "1"
@@ -57,7 +57,7 @@ StatsAPI = "1.6"
5757
StatsBase = "0.32, 0.33, 0.34"
5858
StatsFuns = "0.9.15, 1"
5959
Test = "<0.0.1, 1"
60-
julia = "1.3"
60+
julia = "1.10"
6161

6262
[extras]
6363
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"

src/Distributions.jl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,6 @@ include("statsapi.jl")
322322
# Testing utilities for other packages which implement distributions.
323323
include("test_utils.jl")
324324

325-
# Extensions: Implementation of DensityInterface and ChainRulesCore API
326-
if !isdefined(Base, :get_extension)
327-
include("../ext/DistributionsChainRulesCoreExt/DistributionsChainRulesCoreExt.jl")
328-
include("../ext/DistributionsDensityInterfaceExt.jl")
329-
include("../ext/DistributionsTestExt.jl")
330-
end
331-
332325
include("deprecates.jl")
333326

334327
"""

src/univariate/continuous/triangular.jl

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,6 @@ function quantile(d::TriangularDist, p::Real)
125125
b - sqrt(b_m_a * (b - c) * (1 - p))
126126
end
127127

128-
_expm1(x::Number) = expm1(x)
129-
if VERSION < v"1.7.0-DEV.1172"
130-
# expm1(::Float16) is not defined in older Julia versions
131-
_expm1(x::Float16) = Float16(expm1(Float32(x)))
132-
function _expm1(x::Complex{Float16})
133-
xr, xi = reim(x)
134-
yr, yi = reim(expm1(complex(Float32(xr), Float32(xi))))
135-
return complex(Float16(yr), Float16(yi))
136-
end
137-
end
138-
139128
"""
140129
_phi2(x::Real)
141130
@@ -146,7 +135,7 @@ Compute
146135
with the correct limit at ``x = 0``.
147136
"""
148137
function _phi2(x::Real)
149-
res = 2 * (_expm1(x) - x) / x^2
138+
res = 2 * (expm1(x) - x) / x^2
150139
return iszero(x) ? one(res) : res
151140
end
152141
function mgf(d::TriangularDist, t::Real)
@@ -181,7 +170,7 @@ with the correct limit at ``x = 0``.
181170
"""
182171
function _cisphi2(x::Real)
183172
z = x * im
184-
res = -2 * (_expm1(z) - z) / x^2
173+
res = -2 * (expm1(z) - z) / x^2
185174
return iszero(x) ? one(res) : res
186175
end
187176
function cf(d::TriangularDist, t::Real)

test/aqua.jl

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,5 @@ using Test
44
import Aqua
55

66
@testset "Aqua" begin
7-
# Test ambiguities separately without Base and Core
8-
# Ref: https://github.com/JuliaTesting/Aqua.jl/issues/77
9-
Aqua.test_all(
10-
Distributions;
11-
ambiguities = false,
12-
# On older Julia versions, installed dependencies are quite old
13-
# Thus unbound type parameters show up that are fixed in newer versions
14-
unbound_args = VERSION >= v"1.6",
15-
)
16-
# Tests are not reliable on older Julia versions and
17-
# show ambiguities in loaded packages
18-
if VERSION >= v"1.6"
19-
Aqua.test_ambiguities(Distributions)
20-
end
7+
Aqua.test_all(Distributions)
218
end

test/matrixreshaped.jl

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,6 @@ using Distributions, Test, Random, LinearAlgebra
33

44
rng = MersenneTwister(123456)
55

6-
if VERSION >= v"1.6.0-DEV.254"
7-
_redirect_stderr(f, ::Base.DevNull) = redirect_stderr(f, devnull)
8-
else
9-
function _redirect_stderr(f, ::Base.DevNull)
10-
nulldev = @static Sys.iswindows() ? "NUL" : "/dev/null"
11-
open(nulldev, "w") do io
12-
redirect_stderr(f, io)
13-
end
14-
end
15-
end
16-
176
function test_matrixreshaped(rng, d1, sizes)
187
@testset "MatrixReshaped $(nameof(typeof(d1))) tests" begin
198
x1 = rand(rng, d1)
@@ -117,7 +106,7 @@ end
117106
μ = rand(rng, 16)
118107
d1 = MvNormal(μ, σ * σ')
119108
sizes = [(4, 4), (8, 2), (2, 8), (1, 16), (16, 1), (4,)]
120-
_redirect_stderr(devnull) do
109+
redirect_stderr(devnull) do
121110
test_matrixreshaped(rng, d1, sizes)
122111
end
123112
end
@@ -127,7 +116,7 @@ end
127116
α = rand(rng, 36) .+ 1 # mode is only defined if all alpha > 1
128117
d1 = Dirichlet(α)
129118
sizes = [(6, 6), (4, 9), (9, 4), (3, 12), (12, 3), (1, 36), (36, 1), (6,)]
130-
_redirect_stderr(devnull) do
119+
redirect_stderr(devnull) do
131120
test_matrixreshaped(rng, d1, sizes)
132121
end
133122
end

test/multivariate/mvlogitnormal.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ end
143143
@test kldivergence(d1, d2) kldivergence(d1.normal, d2.normal)
144144
end
145145

146-
VERSION v"1.8" && @testset "show" begin
146+
@testset "show" begin
147147
d = MvLogitNormal([1.0, 2.0, 3.0], Diagonal([4.0, 5.0, 6.0]))
148148
@test sprint(show, d) === """
149149
MvLogitNormal{DiagNormal}(

test/testutils.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,8 @@ function test_cgf(dist, ts)
5050
d(f) = Base.Fix1(ForwardDiff.derivative, f)
5151
κ₁ = d(Base.Fix1(cgf, dist))(0)
5252
@test κ₁ mean(dist)
53-
if VERSION >= v"1.4"
54-
κ₂ = d(d(Base.Fix1(cgf, dist)))(0)
55-
@test κ₂ var(dist)
56-
end
53+
κ₂ = d(d(Base.Fix1(cgf, dist)))(0)
54+
@test κ₂ var(dist)
5755
for t in ts
5856
val = @inferred cgf(dist, t)
5957
@test isfinite(val)

test/univariate/continuous/tdist.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@ using Test
55

66
@testset "TDist" begin
77
@testset "Type stability of `rand` (#1614)" begin
8-
if VERSION >= v"1.9.0-DEV.348"
9-
# randn(::BigFloat) was only added in https://github.com/JuliaLang/julia/pull/44714
10-
@inferred(rand(TDist(big"1.0")))
11-
end
8+
@inferred(rand(TDist(big"1.0")))
129
@inferred(rand(TDist(ForwardDiff.Dual(1.0))))
13-
1410
end
1511

1612
for T in (Float32, Float64)

0 commit comments

Comments
 (0)