From a5e448f009c1ab50fa8621e8a43209b201a51e4e Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Fri, 16 May 2025 08:30:46 -0400 Subject: [PATCH 01/13] Make test/ have its own Project.toml --- Project.toml | 8 -------- test/Project.toml | 5 +++++ 2 files changed, 5 insertions(+), 8 deletions(-) create mode 100644 test/Project.toml diff --git a/Project.toml b/Project.toml index 578c9d3..d0f60bc 100644 --- a/Project.toml +++ b/Project.toml @@ -14,11 +14,3 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" DelimitedFiles = "1" StaticArrays = "0.5, 0.6, 0.7, 0.8, 0.9, 0.10, 0.11, 0.12, 1.0" julia = "1" - -[extras] -Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[targets] -test = ["Test"] diff --git a/test/Project.toml b/test/Project.toml new file mode 100644 index 0000000..40f96f4 --- /dev/null +++ b/test/Project.toml @@ -0,0 +1,5 @@ +[deps] +Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" From 10ff505a02e72d7d46bdecba64b777eda6db29b6 Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Fri, 16 May 2025 08:32:11 -0400 Subject: [PATCH 02/13] Turn doctests back on for the test suite --- test/runtests.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 7609886..7ca749a 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -4,14 +4,14 @@ using AstroLib using Test using Dates -#using Documenter +using Documenter @testset "AstroLib" begin include("utils-tests.jl") include("misc-tests.jl") - #DocMeta.setdocmeta!(AstroLib, :DocTestSetup, :(using AstroLib), recursive=true) - #doctest(AstroLib) + DocMeta.setdocmeta!(AstroLib, :DocTestSetup, :(using AstroLib), recursive=true) + doctest(AstroLib) end # Dummy calls to "show" for new data types, just to increase code coverage. From 7aba88de13d5725b7f2e809bc4f0622127ac894a Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Fri, 16 May 2025 08:35:19 -0400 Subject: [PATCH 03/13] Add Aqua.jl tests --- test/Project.toml | 1 + test/runtests.jl | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/test/Project.toml b/test/Project.toml index 40f96f4..ecffb82 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,4 +1,5 @@ [deps] +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7" diff --git a/test/runtests.jl b/test/runtests.jl index 7ca749a..4129844 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,12 +1,17 @@ # This file is a part of AstroLib.jl. License is MIT "Expat". # Copyright (C) 2016 Mosè Giordano. +using Aqua using AstroLib using Test using Dates using Documenter @testset "AstroLib" begin + @testset "Aqua.jl" begin + Aqua.test_all(AstroLib) + end + include("utils-tests.jl") include("misc-tests.jl") From 6ef743876fd36ae15ddc3ff233fa004bf3917e60 Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Fri, 16 May 2025 08:41:58 -0400 Subject: [PATCH 04/13] Add compat for stdlib packages --- Project.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Project.toml b/Project.toml index d0f60bc..77f9471 100644 --- a/Project.toml +++ b/Project.toml @@ -11,6 +11,9 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" [compat] +Dates = "1" DelimitedFiles = "1" +LinearAlgebra = "1" +Printf = "1" StaticArrays = "0.5, 0.6, 0.7, 0.8, 0.9, 0.10, 0.11, 0.12, 1.0" julia = "1" From 56cc947e4aae0bfe981de7ba2fc8cd01ba8422f8 Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Fri, 16 May 2025 08:42:08 -0400 Subject: [PATCH 05/13] Bump minimum julia support to 1.10 (current LTS) --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 77f9471..f3543fe 100644 --- a/Project.toml +++ b/Project.toml @@ -16,4 +16,4 @@ DelimitedFiles = "1" LinearAlgebra = "1" Printf = "1" StaticArrays = "0.5, 0.6, 0.7, 0.8, 0.9, 0.10, 0.11, 0.12, 1.0" -julia = "1" +julia = "1.10" From 1bb45f13ebc207e08502848c36838742eff00a1f Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Fri, 16 May 2025 08:48:07 -0400 Subject: [PATCH 06/13] Give CompatHelper explicit permissions and reduce frequency Every 5 days instead of every day --- .github/workflows/CompatHelper.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index ed74bb2..2265824 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -1,12 +1,14 @@ name: CompatHelper on: schedule: - - cron: 0 23 * * * + - cron: 0 23 */5 * * +permissions: + contents: write + pull-requests: write jobs: CompatHelper: runs-on: ubuntu-latest steps: - - name: Install CompatHelper shell: julia --color=yes {0} run: using Pkg; Pkg.add("CompatHelper") From d93d9b9eb7d0a2de4526864383c52cd938c67b04 Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Fri, 16 May 2025 08:59:51 -0400 Subject: [PATCH 07/13] Add doctest filter for test suite --- test/runtests.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/runtests.jl b/test/runtests.jl index 4129844..f094524 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -16,6 +16,7 @@ using Documenter include("misc-tests.jl") DocMeta.setdocmeta!(AstroLib, :DocTestSetup, :(using AstroLib), recursive=true) + DocMeta.setdocmeta!(AstroLib, :DocTestFilters, r"(\d*)\.(\d{5})\d+" => s"\1.\2***", recursive=true) doctest(AstroLib) end From 976a79670a4507b81ac42e1517ab113941f398d1 Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Fri, 16 May 2025 09:06:51 -0400 Subject: [PATCH 08/13] Update CI.yml for supported Julia versions --- .github/workflows/CI.yml | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 71f9a5a..5bad5a3 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,16 +13,9 @@ jobs: strategy: fail-fast: false matrix: - version: - - "1.0" - - "1" - - "nightly" - os: - - ubuntu-latest - - macOS-latest - - windows-latest - arch: - - x64 + version: ["1.10", "1", "nightly"] + os: [ubuntu-latest, macOS-latest, windows-latest] + arch: [x64] steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v2 From f8b77bdf3ea9ad83226e3b32bd69d368f32064b5 Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Fri, 16 May 2025 19:08:31 -0400 Subject: [PATCH 09/13] Make jdcnv an actual function instead of an alias --- src/jdcnv.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/jdcnv.jl b/src/jdcnv.jl index b2e6737..43f0e6a 100644 --- a/src/jdcnv.jl +++ b/src/jdcnv.jl @@ -49,5 +49,6 @@ equivalent to `jdcnv(now(Dates.UTC))`. For the conversion of Julian date to number of Julian days, use `juldate`. """ -const jdcnv = Dates.datetime2julian +jdcnv(d::DateTime) = Dates.datetime2julian(d) +jdcnv(d::AbstractString) = Dates.datetime2julian(Dates.DateTime(d)) jdcnv(date...) = jdcnv(DateTime(date...)) From 3bff5fed0222567800929318fa066824f18f1f33 Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Fri, 16 May 2025 19:08:42 -0400 Subject: [PATCH 10/13] Remove DocTestFilter meta key from test suite --- test/runtests.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index f094524..4129844 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -16,7 +16,6 @@ using Documenter include("misc-tests.jl") DocMeta.setdocmeta!(AstroLib, :DocTestSetup, :(using AstroLib), recursive=true) - DocMeta.setdocmeta!(AstroLib, :DocTestFilters, r"(\d*)\.(\d{5})\d+" => s"\1.\2***", recursive=true) doctest(AstroLib) end From 0e023d8c3d9c7562f0a86fb7c5783f68754a8d8e Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Fri, 16 May 2025 19:58:07 -0400 Subject: [PATCH 11/13] Make doctests only run on linux for test suite --- test/runtests.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 4129844..4d5ce59 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -15,8 +15,10 @@ using Documenter include("utils-tests.jl") include("misc-tests.jl") - DocMeta.setdocmeta!(AstroLib, :DocTestSetup, :(using AstroLib), recursive=true) - doctest(AstroLib) + if Sys.islinux() + DocMeta.setdocmeta!(AstroLib, :DocTestSetup, :(using AstroLib), recursive=true) + doctest(AstroLib) + end end # Dummy calls to "show" for new data types, just to increase code coverage. From dbfffabfc00f708148fb513e70e0afeb21e632ed Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Sat, 17 May 2025 10:55:59 -0400 Subject: [PATCH 12/13] Re-update CI testing matrix --- .github/workflows/CI.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5bad5a3..caaad0b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,8 +13,14 @@ jobs: strategy: fail-fast: false matrix: - version: ["1.10", "1", "nightly"] - os: [ubuntu-latest, macOS-latest, windows-latest] + version: + - 'min' + - '1' + - 'nightly' + os: + - ubuntu-latest + - macOS-latest + - windows-latest arch: [x64] steps: - uses: actions/checkout@v4 From 12ff8e5457977e5d8bfe5e695071d989b700c597 Mon Sep 17 00:00:00 2001 From: abhro <5664668+abhro@users.noreply.github.com> Date: Sat, 17 May 2025 10:57:39 -0400 Subject: [PATCH 13/13] Nitpick CI.yml to make the PR diff look cleaner --- .github/workflows/CI.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index caaad0b..a3ce7f0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -14,14 +14,15 @@ jobs: fail-fast: false matrix: version: - - 'min' - - '1' - - 'nightly' - os: + - "min" + - "1" + - "nightly" + os: - ubuntu-latest - macOS-latest - windows-latest - arch: [x64] + arch: + - x64 steps: - uses: actions/checkout@v4 - uses: julia-actions/setup-julia@v2