Skip to content

Commit

Permalink
Make Dates and Tests weak dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion authored and aplavin committed Sep 13, 2024
1 parent cd796cb commit d8a9314
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Accessors"
uuid = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
authors = ["Takafumi Arakaki <[email protected]>", "Jan Weidner <[email protected]> and contributors"]
version = "0.1.37"
version = "0.1.38"

[deps]
CompositionsBase = "a33af91c-f02d-484b-be07-31d278c5ca2b"
Expand All @@ -16,17 +16,21 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[weakdeps]
AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[extensions]
AccessorsAxisKeysExt = "AxisKeys"
AccessorsDatesExt = "Dates"
AccessorsIntervalSetsExt = "IntervalSets"
AccessorsStaticArraysExt = "StaticArrays"
AccessorsStructArraysExt = "StructArrays"
AccessorsTestExt = "Test"
AccessorsUnitfulExt = "Unitful"

[compat]
Expand Down
9 changes: 7 additions & 2 deletions src/Accessors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ include("functionlenses.jl")
include("testing.jl")

# always included for now
include("../ext/AccessorsDatesExt.jl")
include("../ext/AccessorsLinearAlgebraExt.jl")
include("../ext/AccessorsTestExt.jl")

if !isdefined(Base, :get_extension)
include("../ext/AccessorsDatesExt.jl")
include("../ext/AccessorsTestExt.jl")
end

function __init__()
@static if !isdefined(Base, :get_extension)
Expand Down Expand Up @@ -47,6 +50,8 @@ function __init__()
(0, 1, 2, 3, 4)
```
""")
elseif (exc.f === test_getset_laws || exc.f === test_modify_law || exc.f === test_getsetall_laws || exc.f === test_insertdelete_laws) && isdefined(Base, :get_extension) && Base.get_extension(Accessors, :AccessorsTestExt) === nothing
print(io, "\nDid you forget to load Test?")
end
end
end
Expand Down

2 comments on commit d8a9314

@aplavin
Copy link
Member

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@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/115142

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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.38 -m "<description of version>" d8a93147bfab5a918bf0e95c24ad3852c2631a94
git push origin v0.1.38

Please sign in to comment.