Skip to content

Commit 389f8c3

Browse files
Drop Requires.jl dependency and use native Julia v1.10 extensions
- Remove Requires.jl from dependencies in Project.toml - Update Julia compat to require v1.10 (new LTS) - Remove conditional extension loading code from src/Adapt.jl - Simplify extension modules to use standard imports - Update CI to test only Julia v1.10 and newer Julia v1.10 is now the LTS release, so we can drop support for older versions and remove the Requires.jl compatibility layer. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent cf6f6d4 commit 389f8c3

File tree

5 files changed

+3
-23
lines changed

5 files changed

+3
-23
lines changed

.github/workflows/Test.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
version:
16-
- '1.6'
17-
- '1.7'
18-
- '1.8'
19-
- '1.9'
2016
- '1.10'
2117
- '1.11'
2218
- 'nightly'

Project.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ version = "4.4.0"
44

55
[deps]
66
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
7-
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
87

98
[weakdeps]
109
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
@@ -15,9 +14,8 @@ AdaptSparseArraysExt = "SparseArrays"
1514
AdaptStaticArraysExt = "StaticArrays"
1615

1716
[compat]
18-
Requires = "1"
1917
StaticArrays = "1"
20-
julia = "1.6"
18+
julia = "1.10"
2119
LinearAlgebra = "1"
2220
SparseArrays = "1"
2321

ext/AdaptSparseArraysExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module AdaptSparseArraysExt
22

33
using Adapt
4-
isdefined(Base, :get_extension) ? (using SparseArrays) : (using ..SparseArrays)
4+
using SparseArrays
55

66
Adapt.adapt_storage(::Type{Array}, xs::SparseVector) = xs
77
Adapt.adapt_storage(::Type{Array}, xs::SparseMatrixCSC) = xs

ext/AdaptStaticArraysExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module AdaptStaticArraysExt
22

33
using Adapt
4-
isdefined(Base, :get_extension) ? (using StaticArrays) : (using ..StaticArrays)
4+
using StaticArrays
55

66
Adapt.adapt_storage(::Type{<:SArray{S}}, xs::Array) where {S} = SArray{S}(xs)
77
Adapt.adapt_storage(::Type{SArray}, xs::Array) = SArray{Tuple{size(xs)...}}(xs)

src/Adapt.jl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,5 @@ include("arrays.jl")
6767
# helpers
6868
include("macro.jl")
6969

70-
if !isdefined(Base, :get_extension)
71-
using Requires
72-
end
73-
74-
@static if !isdefined(Base, :get_extension)
75-
function __init__()
76-
@require SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" begin
77-
include("../ext/AdaptSparseArraysExt.jl")
78-
end
79-
@require StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" begin
80-
include("../ext/AdaptStaticArraysExt.jl")
81-
end
82-
end
83-
end
8470

8571
end # module

0 commit comments

Comments
 (0)