Skip to content

Commit bad0d00

Browse files
committed
only support Julia 1.10+ (lts and newer)
1 parent 348a496 commit bad0d00

14 files changed

+37
-120
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ jobs:
1010
fail-fast: false
1111
matrix:
1212
version:
13-
- '1.6'
1413
- 'lts'
1514
- '1'
1615
- 'pre'

Project.toml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,12 @@ CompositionsBase = "a33af91c-f02d-484b-be07-31d278c5ca2b"
88
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
99
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
1010
InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112"
11-
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1211
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
13-
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
14-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1512

1613
[weakdeps]
1714
AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5"
1815
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
1916
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
20-
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
2117
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
2218
StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
2319
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
@@ -41,16 +37,8 @@ IntervalSets = "0.7"
4137
InverseFunctions = "0.1.5"
4238
LinearAlgebra = "1"
4339
MacroTools = "0.5"
44-
Requires = "0.5, 1.0"
4540
StaticArrays = "1"
4641
StructArrays = "0.6, 0.7"
4742
Test = "1"
4843
Unitful = "1"
49-
julia = "1.6"
50-
51-
[extras]
52-
AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5"
53-
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
54-
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
55-
StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
56-
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
44+
julia = "1.10"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ For more detail, see [this tutorial](https://juliaobjects.github.io/Accessors.jl
5454

5555
# Featured extensions
5656

57-
- [AccessorsExtra.jl](https://github.com/JuliaAPlavin/AccessorsExtra.jl) [[docs](https://aplavin.github.io/AccessorsExtra.jl/test/notebook.html)] introduces additional optics and related functions, that are considered too experimental for inclusion in `Accessors`. For Julia 1.8 and older, `AccessorsExtra` also provides integrations with other packages; for Julia 1.9+, these are mostly included in `Accessors` itself.
57+
- [AccessorsExtra.jl](https://github.com/JuliaAPlavin/AccessorsExtra.jl) [[docs](https://aplavin.github.io/AccessorsExtra.jl/test/notebook.html)] introduces additional optics and related functions that are considered too opinionated or too experimental for inclusion in `Accessors`.

ext/StaticArraysExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module StaticArraysExt
2-
isdefined(Base, :get_extension) ? (using StaticArrays) : (using ..StaticArrays)
2+
using StaticArrays
33
using Accessors
44
import Accessors: setindex, delete, insert
55

src/Accessors.jl

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ using MacroTools
33
using MacroTools: isstructdef, splitstructdef, postwalk
44
using InverseFunctions
55

6-
if !isdefined(Base, :get_extension)
7-
using Requires
8-
end
9-
106

117
include("setindex.jl")
128
include("optics.jl")
@@ -17,15 +13,8 @@ include("testing.jl")
1713

1814
# always include for now; see https://github.com/JuliaObjects/Accessors.jl/issues/192
1915
include("../ext/DatesExt.jl")
20-
if !isdefined(Base, :get_extension)
21-
include("../ext/LinearAlgebraExt.jl")
22-
include("../ext/TestExt.jl")
23-
end
2416

2517
function __init__()
26-
@static if !isdefined(Base, :get_extension)
27-
@require StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" include("../ext/StaticArraysExt.jl")
28-
end
2918
if isdefined(Base.Experimental, :register_error_hint)
3019
Base.Experimental.register_error_hint(MethodError) do io, exc, argtypes, kwargs
3120
if exc.f === insert && argtypes[2] <: Accessors.DynamicIndexLens
@@ -48,7 +37,7 @@ function __init__()
4837
(0, 1, 2, 3, 4)
4938
```
5039
""")
51-
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
40+
elseif (exc.f === test_getset_laws || exc.f === test_modify_law || exc.f === test_getsetall_laws || exc.f === test_insertdelete_laws) && Base.get_extension(Accessors, :AccessorsTestExt) === nothing
5241
print(io, "\nDid you forget to load Test?")
5342
end
5443
end

src/functionlenses.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,8 @@ delete(s::AbstractString, o::Base.Fix2{typeof(first)}) = chop(s; head=o.x, tail=
177177
delete(s::AbstractString, o::Base.Fix2{typeof(last)}) = chop(s; head=0, tail=o.x)
178178

179179
set(s::AbstractString, o::typeof(chomp), v) = endswith(s, '\n') ? v * '\n' : v
180-
if VERSION >= v"1.8"
181-
set(s::AbstractString, o::Base.Fix2{typeof(chopsuffix), <:AbstractString}, v) =
182-
endswith(s, o.x) ? v * o.x : v
183-
set(s::AbstractString, o::Base.Fix2{typeof(chopprefix), <:AbstractString}, v) =
184-
startswith(s, o.x) ? o.x * v : v
185-
end
180+
set(s::AbstractString, o::Base.Fix2{typeof(chopsuffix), <:AbstractString}, v) = endswith(s, o.x) ? v * o.x : v
181+
set(s::AbstractString, o::Base.Fix2{typeof(chopprefix), <:AbstractString}, v) = startswith(s, o.x) ? o.x * v : v
186182

187183
set(s::AbstractString, ::typeof(strip), v) = @set lstrip(rstrip(s)) = v
188184
set(s::AbstractString, ::typeof(lstrip), v) = @set s |> lstrip(isspace, _) = v

src/optics.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,6 @@ function _set(obj, optic, val, ::SetBased)
175175
""")
176176
end
177177

178-
if VERSION < v"1.7"
179-
struct Returns{V}
180-
value::V
181-
end
182-
(o::Returns)(x) = o.value
183-
else
184-
using Base: Returns
185-
end
186-
187178
@inline function _set(obj, optic, val, ::ModifyBased)
188179
modify(Returns(val), obj, optic)
189180
end

test/Project.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
33
AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5"
44
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
55
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
6-
ConstructionBaseExtras = "914cd950-b775-4282-9f32-54fc4544c321"
76
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
87
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
98
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
@@ -19,15 +18,11 @@ StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
1918
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2019
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
2120

22-
[weakdeps]
23-
ConstructionBaseExtras = "914cd950-b775-4282-9f32-54fc4544c321"
24-
2521
[compat]
2622
Aqua = "0.8"
2723
AxisKeys = "0.2"
2824
BenchmarkTools = "1.3"
2925
ConstructionBase = "1.5"
30-
ConstructionBaseExtras = "0.1"
3126
IntervalSets = "0.7"
3227
InverseFunctions = "0.1.5"
3328
MacroTools = "0.4.4, 0.5"

test/perf.jl

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,8 @@ end
177177
println("Right associative composition: $b_right")
178178

179179
@test b_default.allocs == 0
180-
if VERSION >= v"1.10-"
181-
@test_broken b_right.allocs == 0
182-
elseif VERSION >= v"1.7"
183-
@test b_right.allocs == 0
184-
else
185-
@test_broken right.allocs == 0
186-
@test b_right.time > 2b_default.time
187-
end
180+
@test_broken b_right.allocs == 0
181+
@test b_right.time b_default.time rtol=0.8
188182
@test b_left.allocs == 0
189183
@test b_left.time b_default.time rtol=0.8
190184
end

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module TestAccessors
22
import PerformanceTestTools
33
import Accessors
44
import Aqua
5-
VERSION v"1.9-" && Aqua.test_all(Accessors)
5+
Aqua.test_all(Accessors)
66
PerformanceTestTools.@include("perf.jl")
77

88
include("test_examples.jl")

0 commit comments

Comments
 (0)