diff --git a/CHANGELOG.md b/CHANGELOG.md index a230e641b5..20c315b32c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ * ![Bugfix][badge-bugfix] A bad `repo` argument to `deploydocs` containing a protocol now throws an error instead of being misinterpreted. ([#1531][github-1531], [#1533][github-1533]) +* ![Maintenance][badge-maintenance] Documenter is no longer compatible with IOCapture v0.1 and now requires IOCapture v0.2. ([#1549][github-1549]) + ## Version `v0.26.3` * ![Maintenance][badge-maintenance] The internal naming of the temporary modules used to run doctests changed to accommodate upcoming printing changes in Julia. ([JuliaLang/julia#39841][julia-39841], [#1540][github-1540]) @@ -765,6 +767,7 @@ [github-1531]: https://github.com/JuliaDocs/Documenter.jl/issues/1531 [github-1533]: https://github.com/JuliaDocs/Documenter.jl/pull/1533 [github-1540]: https://github.com/JuliaDocs/Documenter.jl/pull/1540 +[github-1549]: https://github.com/JuliaDocs/Documenter.jl/pull/1549 [github-1551]: https://github.com/JuliaDocs/Documenter.jl/pull/1551 [julia-38079]: https://github.com/JuliaLang/julia/issues/38079 diff --git a/Project.toml b/Project.toml index dee18a3060..bdb18a5e44 100644 --- a/Project.toml +++ b/Project.toml @@ -18,7 +18,7 @@ Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [compat] DocStringExtensions = "0.4, 0.5, 0.6, 0.7, 0.8" -IOCapture = "0.1" +IOCapture = "0.2" JSON = "0.19, 0.20, 0.21" julia = "1" diff --git a/src/DocTests.jl b/src/DocTests.jl index 25ec3d0dbe..51de19bd3d 100644 --- a/src/DocTests.jl +++ b/src/DocTests.jl @@ -216,7 +216,7 @@ function eval_repl(block, sandbox, meta::Dict, doc::Documents.Document, page) # see https://github.com/JuliaLang/julia/pull/33864 ex = REPL.softscope!(ex) end - c = IOCapture.iocapture(throwerrors = :interrupt) do + c = IOCapture.capture(rethrow = InterruptException) do Core.eval(sandbox, ex) end Core.eval(sandbox, Expr(:global, Expr(:(=), :ans, QuoteNode(c.value)))) @@ -243,7 +243,7 @@ function eval_script(block, sandbox, meta::Dict, doc::Documents.Document, page) output = lstrip(output, '\n') result = Result(block, input, output, meta[:CurrentFile]) for (ex, str) in Utilities.parseblock(input, doc, page; keywords = false, raise=false) - c = IOCapture.iocapture(throwerrors = :interrupt) do + c = IOCapture.capture(rethrow = InterruptException) do Core.eval(sandbox, ex) end result.value = c.value @@ -326,7 +326,7 @@ end function error_to_string(buf, er, bt) # Remove unimportant backtrace info. bt = remove_common_backtrace(bt, backtrace()) - # Remove everything below the last eval call (which should be the one in IOCapture.iocapture) + # Remove everything below the last eval call (which should be the one in IOCapture.capture) index = findlast(ptr -> Base.ip_matches_func(ptr, :eval), bt) bt = (index === nothing) ? bt : bt[1:(index - 1)] # Print a REPL-like error message. diff --git a/src/Expanders.jl b/src/Expanders.jl index f38fee6a8e..c83dd6b311 100644 --- a/src/Expanders.jl +++ b/src/Expanders.jl @@ -550,7 +550,7 @@ function Selectors.runner(::Type{ExampleBlocks}, x, page, doc) code = x.code end for (ex, str) in Utilities.parseblock(code, doc, page; keywords = false) - c = IOCapture.iocapture(throwerrors = :interrupt) do + c = IOCapture.capture(rethrow = InterruptException) do cd(page.workdir) do Core.eval(mod, ex) end @@ -611,7 +611,7 @@ function Selectors.runner(::Type{REPLBlocks}, x, page, doc) # see https://github.com/JuliaLang/julia/pull/33864 ex = REPL.softscope!(ex) end - c = IOCapture.iocapture(throwerrors = :interrupt) do + c = IOCapture.capture(rethrow = InterruptException) do cd(page.workdir) do Core.eval(mod, ex) end diff --git a/test/TestUtilities.jl b/test/TestUtilities.jl index 735d2834fd..0932795a74 100644 --- a/test/TestUtilities.jl +++ b/test/TestUtilities.jl @@ -19,7 +19,7 @@ function Base.showerror(io::IO, e::QuietlyException) end function _quietly(f, expr, source) - c = IOCapture.iocapture(f; throwerrors = :interrupt) + c = IOCapture.capture(f; rethrow = InterruptException) haskey(ENV, "DOCUMENTER_TEST_QUIETLY") && open(QUIETLY_LOG; write=true, append=true) do io println(io, "@quietly: c.error = $(c.error) / $(sizeof(c.output)) bytes of output captured") println(io, "@quietly: $(source.file):$(source.line)") diff --git a/test/doctests/doctestapi.jl b/test/doctests/doctestapi.jl index fd5cf1aecd..dd675716dc 100644 --- a/test/doctests/doctestapi.jl +++ b/test/doctests/doctestapi.jl @@ -15,7 +15,7 @@ import IOCapture # ------------------------------------ function run_doctest(f, args...; kwargs...) (result, success, backtrace, output) = - c = IOCapture.iocapture(throwerrors = :interrupt) do + c = IOCapture.capture(rethrow = InterruptException) do # Running inside a Task to make sure that the parent testsets do not interfere. t = Task(() -> doctest(args...; kwargs...)) schedule(t) diff --git a/test/doctests/doctests.jl b/test/doctests/doctests.jl index 2558a0307b..036351cdb7 100644 --- a/test/doctests/doctests.jl +++ b/test/doctests/doctests.jl @@ -33,7 +33,7 @@ function run_makedocs(f, mdfiles, modules=Module[]; kwargs...) # page" warning. touch(joinpath(srcdir, "index.md")) - c = IOCapture.iocapture(throwerrors = :interrupt) do + c = IOCapture.capture(rethrow = InterruptException) do makedocs( sitename = " ", root = dir,