|
1 | 1 | function test_packages(mode) |
| 2 | + Pkg.activate(; temp = true) |
2 | 3 | @testset "Compatibility - $(mode)" begin |
3 | 4 | for package in packages_juliaastro |
4 | 5 | p_name = package.name |
5 | 6 | @info string("Adding: ", p_name) |
6 | 7 | @testset "$(p_name)" begin |
7 | 8 | if mode == :release |
8 | | - if p_name == "Spectra.jl" |
9 | | - # TODO: Register |
10 | | - @test Pkg.add(url="https://github.com/JuliaAstro/Spectra.jl") == nothing |
| 9 | + if p_name == "ASDF.jl" |
| 10 | + # TODO: Register ASDF.jl v2 (v1 Python version currently broken) |
| 11 | + @test_skip p_name |
| 12 | + elseif p_name == "Spectra.jl" |
| 13 | + # TODO: Register SpectrumBase.jl |
| 14 | + @test_skip p_name |
| 15 | + elseif p_name == "GeneralAstrodynamics.jl" |
| 16 | + @test_skip p_name |
11 | 17 | else |
| 18 | + @info "Adding package" p_name |
12 | 19 | @test Pkg.add(chopsuffix(p_name, ".jl")) == nothing |
13 | 20 | end |
14 | 21 | elseif mode == :dev |
15 | | - @test Pkg.add(url=package.repo) == nothing |
| 22 | + # Currently needed for Astroalign.jl until ConsensusFitting.jl is registered |
| 23 | + Pkg.add(url = "https://github.com/JuliaAstro/ConsensusFitting.jl") |
| 24 | + if p_name == "GeneralAstrodynamics.jl" |
| 25 | + # https://github.com/JuliaAstro/GeneralAstrodynamics.jl/pull/275 |
| 26 | + repo = "https://github.com/JuliaAstro/GeneralAstrodynamics.jl" |
| 27 | + Pkg.add([ |
| 28 | + Pkg.PackageSpec(; url = repo, subdir = "lib/AstrodynamicalCalculations"), |
| 29 | + Pkg.PackageSpec(; url = repo, subdir = "lib/AstrodynamicalModels"), |
| 30 | + Pkg.PackageSpec(; url = repo, subdir = "lib/AstrodynamicalSolvers"), |
| 31 | + Pkg.PackageSpec(; url = repo), |
| 32 | + ]) |
| 33 | + @test Pkg.add(url = "https://github.com/JuliaAstro/GeneralAstrodynamics.jl") == nothing |
| 34 | + else |
| 35 | + @test Pkg.add(url = package.repo) == nothing |
| 36 | + end |
16 | 37 | else |
17 | 38 | throw(ArgumentError("`mode` argument to `test_packages` must be either `:release` or `:dev`.")) |
18 | 39 | end |
19 | 40 | end |
20 | 41 | end |
21 | 42 |
|
22 | 43 | @testset "Precompilation" begin |
23 | | - @test Pkg.precompile(; strict=true) == nothing |
| 44 | + @test (Pkg.precompile(; strict = true); true) |
24 | 45 | end |
25 | 46 |
|
26 | 47 | @testset "Package loading" begin |
27 | 48 | for package in packages_juliaastro |
28 | 49 | p_name = package.name |
| 50 | + if mode == :release && p_name ∈ ["ASDF.jl", "Spectra.jl", "GeneralAstrodynamics.jl"] |
| 51 | + continue |
| 52 | + end |
29 | 53 | @info string("Loading: ", p_name) |
30 | 54 | @testset "$(p_name)" begin |
31 | 55 | @test eval(quote |
|
0 commit comments