Stop using Memento#116
Conversation
|
|
||
| const LOGGER = getlogger(@__MODULE__) | ||
| __init__() = Memento.register(LOGGER) | ||
|
|
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| ) | ||
| catch e | ||
| warn(LOGGER, e) | ||
| @warn exception=e |
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| @warn exception=e | |
| @warn exception = e |
| supported || throw(ArgumentError( | ||
| "Unsupported version ($version). Expected a value between ($valid_versions)." | ||
| )) |
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| supported || throw(ArgumentError( | |
| "Unsupported version ($version). Expected a value between ($valid_versions)." | |
| )) | |
| return supported || throw( | |
| ArgumentError( | |
| "Unsupported version ($version). Expected a value between ($valid_versions).", | |
| ), | |
| ) |
| return deserialize(jlso.format, decompressing_buffer) | ||
| catch e | ||
| warn(LOGGER, e) | ||
| @warn exception=e |
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| @warn exception=e | |
| @warn exception = e |
| info(LOGGER, "Upgrading $src -> $dest") | ||
| @info "Upgrading" src dest | ||
| jlso = open(io -> read(io, JLSOFile), src) | ||
| write(dest, jlso) |
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| write(dest, jlso) | |
| return write(dest, jlso) |
| "Failed to construct an environment with the provide package version " * | ||
| "($pkgs): $e.\n Falling back to simply adding the packages." | ||
| end | ||
| "\nFalling back to simply adding the packages.", |
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| "\nFalling back to simply adding the packages.", | |
| "\nFalling back to simply adding the packages.", |
| end | ||
| "\nFalling back to simply adding the packages.", | ||
| pkgs, | ||
| exception=e |
There was a problem hiding this comment.
[JuliaFormatter] reported by reviewdog 🐶
| exception=e | |
| exception = e |
| FilePathsBase = "0.7, 0.8, 0.9" | ||
| Memento = "0.10, 0.11, 0.12, 0.13, 1" | ||
| TimeZones = "0.9, 0.10, 0.11, 1" | ||
| TimeZones = "0.9, 0.10, 0.11, ~1.0, ~1.1, ~1.2, ~1.3, ~1.4, ~1.5" |
There was a problem hiding this comment.
This is unrelated to this PR.
CI has actually been broken for ages.
https://github.com/invenia/JLSO.jl/actions/runs/1428133005
This is because we have specimen files that were saved with TimeZones prior to v1.5.
Codecov Report
@@ Coverage Diff @@
## master #116 +/- ##
==========================================
- Coverage 97.67% 97.66% -0.02%
==========================================
Files 6 6
Lines 215 214 -1
==========================================
- Hits 210 209 -1
Misses 5 5
Continue to review full report at Codecov.
|
|
I'm still not convinced, but then I actively dislike Julia's base logging system. Since we haven't changed the core file format in a while, we aren't likely to hit those upgrade logs. I still think Memento probably shouldn't depend directly on TimeZones.jl, and it should be an optional dependency instead. If you manage to get CI passing then I'll just merge. https://github.com/invenia/Memento.jl/blob/master/src/records.jl#L160 |
|
Here's an alternate fix which makes TimeZones.jl an optional dependency of Memento.jl invenia/Memento.jl#182.
|
|
I'm gonna close this since the specific issue was fixed in Memento.jl, feel free to re-open if you disagree. |
Closes #114 which will make dealing with data that was saves with different version of TimeZones.jl better.
Will also avoid other TimeZones related suffering hit by JLSO uses (cc @ablaom) like:
Test.@test_logsis more annoying to work with thanMemento.@test_warnsee JuliaLang/julia#43016.This because
@warn exception=edoesn't converteto a string as part of message so@test_logsdoesn't accept a regex to apply to it.Because of that we only test if a warning was given rather than what it says.
The change to the package code (rather than the test code) is pretty minimal
This PR should only be merged if @rofinn is convinced.