Skip to content

Commit

Permalink
Update dependency and fix deprecation (#43)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
devmotion authored Sep 5, 2022
1 parent 037403c commit a05003c
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 6 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Check if Julia is already available in the PATH
id: julia_in_path
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@v1
with:
version: '1'
arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TerminalLoggers"
uuid = "5d786b92-1e48-4d6f-9151-6b4477ca9bed"
authors = ["Chris Foster <[email protected]>"]
version = "0.1.5"
version = "0.1.6"

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

[compat]
LeftChildRightSiblingTrees = "0.1.1"
LeftChildRightSiblingTrees = "0.1.1, 0.2"
ProgressLogging = "0.1.1"
julia = "1"

Expand Down
6 changes: 3 additions & 3 deletions src/TerminalLogger.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ end
function showvalue(io, key, msg)
if key === :exception && msg isa Vector && length(msg) > 1 && msg[1] isa Tuple{Exception,Any}
if VERSION >= v"1.2"
# Ugly code path to support passing exception=Base.catch_stack() We
# don't have a useful "Exception Stack" type to look for here until
# https://github.com/JuliaLang/julia/pull/29901 gets unstuck.
# Ugly code path to support passing exception=Base.catch_stack()
# `Base.ExceptionStack` was only introduced in Julia 1.7.0-DEV.1106
# https://github.com/JuliaLang/julia/pull/29901 (dispatched on below).
Base.show_exception_stack(io, msg)
else
# v1.0 and 1.1 don't have Base.show_exception_stack
Expand Down
6 changes: 5 additions & 1 deletion test/TerminalLogger.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,11 @@ end
try
error("An exception")
catch
Base.catch_stack()
if VERSION >= v"1.7.0-DEV.1106"
current_exceptions()
else
Base.catch_stack()
end
end
end
@test occursin(r"An exception.*Stacktrace.*caused by.*Root cause.*Stacktrace"s,
Expand Down

2 comments on commit a05003c

@c42f
Copy link
Member

@c42f c42f commented on a05003c Sep 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/67700

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.6 -m "<description of version>" a05003cd0a16823314e61873d1ae5fc7923bf77e
git push origin v0.1.6

Please sign in to comment.