From 1fe9d57068e61e30dbb999f9979acae1ffcbab28 Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Fri, 20 Oct 2023 21:39:15 +0530 Subject: [PATCH] feat: add pre-1.9 compat using Requires --- Project.toml | 4 ++++ src/SymbolicIndexingInterface.jl | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/Project.toml b/Project.toml index 19f2bb91..36da873b 100644 --- a/Project.toml +++ b/Project.toml @@ -3,6 +3,9 @@ uuid = "2efcf032-c050-4f8e-a9bb-153293bab1f5" authors = ["Aayush Sabharwal and contributors"] version = "0.3.0" +[deps] +Requires = "ae029012-a4dd-5104-9daa-d747884805df" + [weakdeps] SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b" Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" @@ -12,6 +15,7 @@ SymbolicIndexingInterfaceSymbolicUtilsExt = "SymbolicUtils" SymbolicIndexingInterfaceSymbolicsExt = "Symbolics" [compat] +Requires = "1.0" SymbolicUtils = "1.4" Symbolics = "5.10" julia = "1" diff --git a/src/SymbolicIndexingInterface.jl b/src/SymbolicIndexingInterface.jl index f2f2013f..cbaf9d36 100644 --- a/src/SymbolicIndexingInterface.jl +++ b/src/SymbolicIndexingInterface.jl @@ -7,5 +7,12 @@ export issymbolic, isvariable, variableindex, isparameter, parameterindex, isindependent_variable, isobserved, observed, istimedependent, constant_structure include("interface.jl") +@static if !isdefined(Base, :get_extension) + using Requires + function __init__() + @require Symbolics="0c5d862f-8b57-4792-8d23-62f2024744c7" include("../ext/SymbolicIndexingInterfaceSymbolicsExt.jl") + @require SymbolicUtils="d1185830-fcd6-423d-90d6-eec64667417b" include("../ext/SymbolicIndexingInterfaceSymbolicUtilsExt.jl") + end +end end