From 1698bd2a3b709c170037479fd994a3fad8943252 Mon Sep 17 00:00:00 2001 From: Douglas Bates Date: Sun, 3 Mar 2024 10:05:16 -0600 Subject: [PATCH] Add imports from PrecompileTools; tests with ExplicitImports. --- Project.toml | 4 +++- src/MixedModels.jl | 4 +--- test/runtests.jl | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index c73e56bc8..012235c94 100644 --- a/Project.toml +++ b/Project.toml @@ -37,6 +37,7 @@ BSplineKit = "0.14, 0.15, 0.16, 0.17" DataAPI = "1" DataFrames = "1" Distributions = "0.21, 0.22, 0.23, 0.24, 0.25" +ExplicitImports = "1.2" GLM = "1.8.2" InteractiveUtils = "1" JSON3 = "1" @@ -67,10 +68,11 @@ julia = "1.8" [extras] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7" InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua", "DataFrames", "InteractiveUtils", "StableRNGs", "Suppressor", "Test"] +test = ["Aqua", "DataFrames", "ExplicitImports", "InteractiveUtils", "StableRNGs", "Suppressor", "Test"] diff --git a/src/MixedModels.jl b/src/MixedModels.jl index 7bf5f9b30..898766ca5 100644 --- a/src/MixedModels.jl +++ b/src/MixedModels.jl @@ -24,7 +24,7 @@ using Markdown: Markdown using MixedModelsDatasets: dataset, datasets using NLopt: NLopt, Opt, ftol_abs, ftol_rel, initial_step, maxtime, xtol_abs, xtol_rel using PooledArrays: PooledArrays, PooledArray -using PrecompileTools: PrecompileTools +using PrecompileTools: PrecompileTools, @setup_workload, @compile_workload using ProgressMeter: ProgressMeter, Progress, ProgressUnknown, finish!, next! using Random: Random, AbstractRNG, randn! using SparseArrays: SparseArrays, SparseMatrixCSC, SparseVector, dropzeros!, nnz @@ -208,8 +208,6 @@ include("mimeshow.jl") include("serialization.jl") include("profile/profile.jl") -using PrecompileTools - @setup_workload begin # Putting some things in `setup` can reduce the size of the # precompile file and potentially make loading faster. diff --git a/test/runtests.jl b/test/runtests.jl index 797989bb7..fcfa68fee 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,4 +1,5 @@ using Aqua +using ExplicitImports using GLM using MixedModels using Test @@ -18,6 +19,11 @@ import LinearAlgebra: BLAS piracies=(;treat_as_own=[GLM.wrkresp!, Base.:|])) end +@testset "ExplicitImports" begin + check_no_implicit_imports(MixedModels) + check_no_stale_explicit_imports(MixedModels) +end + include("utilities.jl") include("misc.jl") include("pivot.jl")