From 9083d860d14688ec84b8e4b3d17daf0831343899 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 10 Aug 2024 13:26:12 -0400 Subject: [PATCH 01/10] Don't make Test a dependency It should only be a test dependency --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 23ca1947..c7d9347e 100644 --- a/Project.toml +++ b/Project.toml @@ -12,7 +12,6 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" Requires = "ae029012-a4dd-5104-9daa-d747884805df" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [weakdeps] AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5" @@ -49,3 +48,4 @@ IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" From 3101224bbe4520556f3f170dd4803254000b6d23 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 10 Aug 2024 13:26:45 -0400 Subject: [PATCH 02/10] Update Project.toml --- Project.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Project.toml b/Project.toml index c7d9347e..083c33fd 100644 --- a/Project.toml +++ b/Project.toml @@ -48,4 +48,3 @@ IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" From b2c8b3d3ddd6b5f97a4f7c956dc2f05abd1a2346 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 17 Aug 2024 11:51:29 -0400 Subject: [PATCH 03/10] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 083c33fd..91d36a10 100644 --- a/Project.toml +++ b/Project.toml @@ -40,7 +40,7 @@ Requires = "0.5, 1.0" StaticArrays = "1" StructArrays = "0.6" Unitful = "1" -julia = "1.6" +julia = "1.10" [extras] AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5" From 511e8d668a4789736f051b63c6bba32e5bf637c9 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 17 Aug 2024 11:51:49 -0400 Subject: [PATCH 04/10] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36f4b09c..9aeee085 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: version: - - 1.6 # LTS + - 1.10 # LTS - 1 - 'nightly' os: From dcf9c33dcb3824f5dd8f4967e2d8d869c50f9d75 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 17 Aug 2024 11:52:36 -0400 Subject: [PATCH 05/10] Update Accessors.jl --- src/Accessors.jl | 57 ++++++++++++++++++------------------------------ 1 file changed, 21 insertions(+), 36 deletions(-) diff --git a/src/Accessors.jl b/src/Accessors.jl index 2852fdea..b2b116a0 100644 --- a/src/Accessors.jl +++ b/src/Accessors.jl @@ -4,11 +4,6 @@ using MacroTools: isstructdef, splitstructdef, postwalk using InverseFunctions using Markdown: Markdown, @md_str, term -if !isdefined(Base, :get_extension) - using Requires -end - - include("setindex.jl") include("optics.jl") include("getsetall.jl") @@ -16,38 +11,28 @@ include("sugar.jl") include("functionlenses.jl") include("testing.jl") -# always included for now -include("../ext/AccessorsDatesExt.jl") -include("../ext/AccessorsLinearAlgebraExt.jl") -include("../ext/AccessorsTestExt.jl") - function __init__() - @static if !isdefined(Base, :get_extension) - @require StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" include("../ext/AccessorsStaticArraysExt.jl") - end - if isdefined(Base.Experimental, :register_error_hint) - Base.Experimental.register_error_hint(MethodError) do io, exc, argtypes, kwargs - if exc.f === insert && argtypes[2] <: Accessors.DynamicIndexLens - println(io) - term(io, md""" - `insert` with a `DynamicIndexLens` is not supported, this can happen when you write - code such as `@insert a[end] = 1` or `@insert a[begin] = 1` since `end` and `begin` - are functions of `a`. The reason we do not support these with `insert` is that - Accessors.jl tries to guarentee that `f(insert(obj, f, val)) == val`, but - `@insert a[end] = 1` and `@insert a[begin] = 1` will violate that invariant. - - Instead, you can use `first` and `last` directly, e.g. - ``` - julia> a = (1, 2, 3, 4) - - julia> @insert last(a) = 5 - (1, 2, 3, 4, 5) - - julia> @insert first(a) = 0 - (0, 1, 2, 3, 4) - ``` - """) - end + Base.Experimental.register_error_hint(MethodError) do io, exc, argtypes, kwargs + if exc.f === insert && argtypes[2] <: Accessors.DynamicIndexLens + println(io) + term(io, md""" + `insert` with a `DynamicIndexLens` is not supported, this can happen when you write + code such as `@insert a[end] = 1` or `@insert a[begin] = 1` since `end` and `begin` + are functions of `a`. The reason we do not support these with `insert` is that + Accessors.jl tries to guarentee that `f(insert(obj, f, val)) == val`, but + `@insert a[end] = 1` and `@insert a[begin] = 1` will violate that invariant. + + Instead, you can use `first` and `last` directly, e.g. + ``` + julia> a = (1, 2, 3, 4) + + julia> @insert last(a) = 5 + (1, 2, 3, 4, 5) + + julia> @insert first(a) = 0 + (0, 1, 2, 3, 4) + ``` + """) end end end From d8301df974cc1f191bbcd53db2f6aa8b43c6cd88 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 17 Aug 2024 11:55:35 -0400 Subject: [PATCH 06/10] Update Project.toml --- Project.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Project.toml b/Project.toml index 91d36a10..81a422fb 100644 --- a/Project.toml +++ b/Project.toml @@ -11,7 +11,6 @@ InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" -Requires = "ae029012-a4dd-5104-9daa-d747884805df" [weakdeps] AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5" From c2e7c6c9eb142e38f2f220bcdd8a6afac46c81e2 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 17 Aug 2024 11:55:53 -0400 Subject: [PATCH 07/10] Update Project.toml --- Project.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Project.toml b/Project.toml index 81a422fb..4f8cc65b 100644 --- a/Project.toml +++ b/Project.toml @@ -35,7 +35,6 @@ IntervalSets = "0.7" InverseFunctions = "0.1.5" MacroTools = "0.5" Markdown = "1" -Requires = "0.5, 1.0" StaticArrays = "1" StructArrays = "0.6" Unitful = "1" From ed6fef60f65412a2a4e61d6421fdeb7bad4cac43 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 17 Aug 2024 11:56:46 -0400 Subject: [PATCH 08/10] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9aeee085..0542f16e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,7 +45,7 @@ jobs: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 with: - version: 1.7 + version: 1.10 - run: | julia --project=docs -e ' using Pkg From 8af6db2014fd0d950293066ccaec2c99f3a8b52c Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 17 Aug 2024 11:57:47 -0400 Subject: [PATCH 09/10] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0542f16e..af39af84 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: version: - - 1.10 # LTS + - '1.10' # LTS - 1 - 'nightly' os: From 2ef77a1b49b8378f62a9524a50e4fab2fbde03e7 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Tue, 20 Aug 2024 08:42:37 -0400 Subject: [PATCH 10/10] Update Project.toml Co-authored-by: David Widmann --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 4f8cc65b..63f7e38e 100644 --- a/Project.toml +++ b/Project.toml @@ -38,7 +38,7 @@ Markdown = "1" StaticArrays = "1" StructArrays = "0.6" Unitful = "1" -julia = "1.10" +julia = "1.9" [extras] AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5"