Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move RecipesBase support to an extension on 1.9+ #446

Merged
merged 2 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TimeZones"
uuid = "f269a46b-ccf7-5d73-abea-4c690281aa53"
authors = ["Curtis Vogt <[email protected]>"]
version = "1.12.0"
version = "1.13.0"

[deps]
Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
Expand All @@ -26,8 +26,15 @@ TZJData = "1"
julia = "1.6"
p7zip_jll = "17.4"

[extensions]
TimeZonesRecipesBaseExt = "RecipesBase"
omus marked this conversation as resolved.
Show resolved Hide resolved

[extras]
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
Comment on lines 32 to +33
Copy link
Member

Choose a reason for hiding this comment

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

This is now required as on Julia 1.9 the [weakdeps] take precedence over [deps] so in order to test with this we need to now add [extras] right?

That explains the PkgBenchmark failure better too. You could work around that failure by setting the Julia version for the benchmark CI tests to 1.8 so that the [weakdeps] are ignored and [deps] are preferred. I'm fine with ignoring the benchmark tests for this PR so don't feel the need to go through this change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is now required as on Julia 1.9 the [weakdeps] take precedence over [deps] so in order to test with this we need to now add [extras] right?

Correct.

I would also prefer to just ignore the failure for this one PR so that benchmarking remains on the current release moving forward.

Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
test = ["Test", "RecipesBase"]

[weakdeps]
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
7 changes: 7 additions & 0 deletions src/plotting.jl → ext/TimeZonesRecipesBaseExt.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
module TimeZonesRecipesBaseExt
omus marked this conversation as resolved.
Show resolved Hide resolved

using TimeZones
using RecipesBase: RecipesBase, @recipe

#==
Plot ZonedDateTime, on x-axis.
We convert it to DateTimes, in the local timezone,
Expand All @@ -22,3 +27,5 @@ for details on the options and their tradeoffs.
[], ys
end
end

end # module
7 changes: 5 additions & 2 deletions src/TimeZones.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module TimeZones
using Dates
using Printf
using Scratch: @get_scratch!
using RecipesBase: RecipesBase, @recipe
using Unicode
using InlineStrings: InlineString15
using TZJData: TZJData
Expand Down Expand Up @@ -92,7 +91,11 @@ include("ranges.jl")
include("discovery.jl")
include("rounding.jl")
include("parse.jl")
include("plotting.jl")
include("deprecated.jl")

# Required to support Julia `VERSION < v"1.9"`
if !isdefined(Base, :get_extension)
palday marked this conversation as resolved.
Show resolved Hide resolved
include("../ext/TimeZonesRecipesBaseExt.jl")
end

end # module
Loading