Skip to content

Commit b4f1f4d

Browse files
authored
Define API as public on Julia >= 1.11 (#114)
* Define API as `public` on Julia >= 1.11 * Bump version
1 parent 8eb5aae commit b4f1f4d

File tree

3 files changed

+31
-1
lines changed

3 files changed

+31
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "LogDensityProblems"
22
uuid = "6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c"
33
authors = ["Tamas K. Papp <[email protected]>"]
4-
version = "2.1.2"
4+
version = "2.2.0"
55

66
[deps]
77
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"

src/LogDensityProblems.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ using ArgCheck: @argcheck
1616
using DocStringExtensions: SIGNATURES, TYPEDEF
1717
using Random: AbstractRNG, default_rng
1818

19+
# https://github.com/JuliaLang/julia/pull/50105
20+
@static if VERSION >= v"1.11.0-DEV.469"
21+
eval(
22+
Expr(
23+
:public,
24+
:capabilities,
25+
:LogDensityOrder,
26+
:dimension,
27+
:logdensity,
28+
:logdensity_and_gradient,
29+
:logdensity_gradient_and_hessian,
30+
)
31+
)
32+
end
33+
1934
####
2035
#### interface for problems
2136
####

test/runtests.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,18 @@ end
9090
@test 50 length(failures) 100
9191
@test all(x -> all(x .< 0), failures)
9292
end
93+
94+
####
95+
#### public API
96+
####
97+
98+
@testset "public API" begin
99+
if isdefined(Base, :ispublic)
100+
@test Base.ispublic(LogDensityProblems, :capabilities)
101+
@test Base.ispublic(LogDensityProblems, :LogDensityOrder)
102+
@test Base.ispublic(LogDensityProblems, :dimension)
103+
@test Base.ispublic(LogDensityProblems, :logdensity)
104+
@test Base.ispublic(LogDensityProblems, :logdensity_and_gradient)
105+
@test Base.ispublic(LogDensityProblems, :logdensity_gradient_and_hessian)
106+
end
107+
end

0 commit comments

Comments
 (0)