Skip to content

Commit a05003c

Browse files
authored
Update dependency and fix deprecation (#43)
I just noticed that TerminalLoggers holds back LeftChildRightSiblingTrees. This PR bumps the dependency and adds a CompatHelper setup to automate such updates in the future. Moreover, when running the tests a deprecation warning turned up which I fixed.
1 parent 037403c commit a05003c

File tree

4 files changed

+54
-6
lines changed

4 files changed

+54
-6
lines changed

.github/workflows/CompatHelper.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CompatHelper
2+
on:
3+
schedule:
4+
- cron: 0 0 * * *
5+
workflow_dispatch:
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
jobs:
10+
CompatHelper:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check if Julia is already available in the PATH
14+
id: julia_in_path
15+
run: which julia
16+
continue-on-error: true
17+
- name: Install Julia, but only if it is not already available in the PATH
18+
uses: julia-actions/setup-julia@v1
19+
with:
20+
version: '1'
21+
arch: ${{ runner.arch }}
22+
if: steps.julia_in_path.outcome != 'success'
23+
- name: "Add the General registry via Git"
24+
run: |
25+
import Pkg
26+
ENV["JULIA_PKG_SERVER"] = ""
27+
Pkg.Registry.add("General")
28+
shell: julia --color=yes {0}
29+
- name: "Install CompatHelper"
30+
run: |
31+
import Pkg
32+
name = "CompatHelper"
33+
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
34+
version = "3"
35+
Pkg.add(; name, uuid, version)
36+
shell: julia --color=yes {0}
37+
- name: "Run CompatHelper"
38+
run: |
39+
import CompatHelper
40+
CompatHelper.main()
41+
shell: julia --color=yes {0}
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TerminalLoggers"
22
uuid = "5d786b92-1e48-4d6f-9151-6b4477ca9bed"
33
authors = ["Chris Foster <[email protected]>"]
4-
version = "0.1.5"
4+
version = "0.1.6"
55

66
[deps]
77
LeftChildRightSiblingTrees = "1d6d02ad-be62-4b6b-8a6d-2f90e265016e"
@@ -12,7 +12,7 @@ ProgressLogging = "33c8b6b6-d38a-422a-b730-caa89a2f386c"
1212
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
1313

1414
[compat]
15-
LeftChildRightSiblingTrees = "0.1.1"
15+
LeftChildRightSiblingTrees = "0.1.1, 0.2"
1616
ProgressLogging = "0.1.1"
1717
julia = "1"
1818

src/TerminalLogger.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ end
151151
function showvalue(io, key, msg)
152152
if key === :exception && msg isa Vector && length(msg) > 1 && msg[1] isa Tuple{Exception,Any}
153153
if VERSION >= v"1.2"
154-
# Ugly code path to support passing exception=Base.catch_stack() We
155-
# don't have a useful "Exception Stack" type to look for here until
156-
# https://github.com/JuliaLang/julia/pull/29901 gets unstuck.
154+
# Ugly code path to support passing exception=Base.catch_stack()
155+
# `Base.ExceptionStack` was only introduced in Julia 1.7.0-DEV.1106
156+
# https://github.com/JuliaLang/julia/pull/29901 (dispatched on below).
157157
Base.show_exception_stack(io, msg)
158158
else
159159
# v1.0 and 1.1 don't have Base.show_exception_stack

test/TerminalLogger.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,11 @@ end
205205
try
206206
error("An exception")
207207
catch
208-
Base.catch_stack()
208+
if VERSION >= v"1.7.0-DEV.1106"
209+
current_exceptions()
210+
else
211+
Base.catch_stack()
212+
end
209213
end
210214
end
211215
@test occursin(r"An exception.*Stacktrace.*caused by.*Root cause.*Stacktrace"s,

0 commit comments

Comments
 (0)