From c609481c7cb82f589551ac58a0faacb917f09fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Miclu=C8=9Ba-C=C3=A2mpeanu?= Date: Thu, 22 Aug 2024 17:25:37 +0300 Subject: [PATCH] refactor: remove dependency on Pkg --- Project.toml | 2 -- src/Optimization.jl | 1 - src/utils.jl | 15 --------------- 3 files changed, 18 deletions(-) diff --git a/Project.toml b/Project.toml index 6e14d3d7a..1fa156848 100644 --- a/Project.toml +++ b/Project.toml @@ -12,7 +12,6 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" LoggingExtras = "e6f89c97-d47a-5376-807f-9c37f3926c36" OptimizationBase = "bca83a33-5cc9-4baa-983d-23429ab6bcbb" -Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" ProgressLogging = "33c8b6b6-d38a-422a-b730-caa89a2f386c" Reexport = "189a3867-3050-52da-a836-e630ba90ab69" @@ -30,7 +29,6 @@ LinearAlgebra = "1.10" Logging = "1.10" LoggingExtras = "0.4, 1" OptimizationBase = "1.3.3" -Pkg = "1" Printf = "1.10" ProgressLogging = "0.1" Reexport = "1.2" diff --git a/src/Optimization.jl b/src/Optimization.jl index 7945a4c93..138997ae5 100644 --- a/src/Optimization.jl +++ b/src/Optimization.jl @@ -13,7 +13,6 @@ end using Logging, ProgressLogging, ConsoleProgressMonitor, TerminalLoggers, LoggingExtras using ArrayInterface, Base.Iterators, SparseArrays, LinearAlgebra -using Pkg import OptimizationBase: instantiate_function, OptimizationCache, ReInitCache import SciMLBase: OptimizationProblem, diff --git a/src/utils.jl b/src/utils.jl index cf219df5d..483819b3b 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -52,21 +52,6 @@ function _check_and_convert_maxtime(maxtime) end end -function check_pkg_version(pkg::String, ver::String; - branch::Union{String, Nothing} = nothing) - deps = Pkg.dependencies() - pkg_info = Dict{String, Pkg.Types.PackageInfo}() - for (uuid, dep) in deps - dep.is_direct_dep || continue - dep.version === nothing && continue - pkg_info[dep.name] = dep - end - - return (isnothing(branch) | (pkg_info[pkg].git_revision == branch)) ? - pkg_info[pkg].version >= VersionNumber(ver) : - pkg_info[pkg].version > VersionNumber(ver) -end - # RetCode handling for BBO and others. using SciMLBase: ReturnCode