Skip to content

Commit

Permalink
move RecipesBase support to an extension on 1.9+ (#446)
Browse files Browse the repository at this point in the history
* move RecipesBase support to an extension on 1.9+

---------

Co-authored-by: Curtis Vogt <curtis.vogt@gmail.com>
  • Loading branch information
palday and omus committed Aug 24, 2023
1 parent 77c9c04 commit f9d0dcf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
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 <curtis.vogt@gmail.com>"]
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"

[extras]
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
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

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)
include("../ext/TimeZonesRecipesBaseExt.jl")
end

end # module

2 comments on commit f9d0dcf

@omus
Copy link
Member

@omus omus commented on f9d0dcf Aug 28, 2023

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/90403

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 v1.13.0 -m "<description of version>" f9d0dcfd03e0c5702667988b870026c55c504b96
git push origin v1.13.0

Please sign in to comment.