diff --git a/.github/workflows/Downgrade.yml b/.github/workflows/Downgrade.yml new file mode 100644 index 000000000..43309a37a --- /dev/null +++ b/.github/workflows/Downgrade.yml @@ -0,0 +1,32 @@ +name: Downgrade +on: + pull_request: + branches: + - main + paths-ignore: + - 'docs/**' + push: + branches: + - main + paths-ignore: + - 'docs/**' +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + version: + - '1.6' + - '1' + # - 'nightly' + steps: + - uses: actions/checkout@v3 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + - uses: cjdoris/julia-downgrade-compat-action@v1 +# if: ${{ matrix.version == '1.6' }} + with: + skip: Pkg,TOML + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 diff --git a/.just/downgrade.jl b/.just/downgrade.jl new file mode 100644 index 000000000..18de70419 --- /dev/null +++ b/.just/downgrade.jl @@ -0,0 +1,75 @@ +function downgrade(file, ignore_pkgs, strict) + lines = readlines(file) + compat = false + for (i, line) in pairs(lines) + if startswith(line, "[compat]") + compat = true + elseif startswith(line, "[") + compat = false + elseif startswith(strip(line), "#") || isempty(strip(line)) + continue + elseif compat + # parse the compat line + m = match(r"^([A-Za-z0-9]+)( *= *\")([^\"]*)(\".*)", line) + if m === nothing + error("cannot parse compat line: $line") + end + pkg, eq, ver, post = m.captures + # skip julia and any ignored packages + if pkg == "julia" || pkg in ignore_pkgs + println("skipping $pkg: $ver") + continue + end + # just take the first part a list compat + ver2 = strip(split(ver, ",")[1]) + if occursin(" - ", ver2) + error("range specifiers not supported") + end + # separate the operator from the version + if ver2[1] in "^~=" + op = ver2[1] + ver2 = ver2[2:end] + elseif isnumeric(ver2[1]) + op = '^' + else + println("skipping $pkg: $ver") + continue + end + # parse the version + ver2 = VersionNumber(ver2) + # select a new operator + if strict == "true" + op = '=' + elseif strict == "v0" && ver2.major == 0 + op = '=' + elseif op == '^' + op = '~' + end + # output the new compat entry + ver2 = "$op$ver2" + if ver == ver2 + println("skipping $pkg: $ver") + continue + end + lines[i] = "$pkg$eq$ver2$post" + println("downgrading $pkg: $ver -> $ver2") + end + end + open(file, "w") do io + for line in lines + println(io, line) + end + end +end + +ignore_pkgs = map(strip, split(ARGS[1], ",", keepempty=false)) +strict = ARGS[2] + +strict in ["true", "false", "v0"] || error("strict must be true, false or v0") + +project_files = filter(isfile, ["Project.toml", "JuliaProject.toml"]) +isempty(project_files) && error("could not find Project.toml") + +for file in project_files + downgrade(file, ignore_pkgs, strict) +end diff --git a/Project.toml b/Project.toml index 9bc3e4b46..320e3603b 100644 --- a/Project.toml +++ b/Project.toml @@ -39,34 +39,34 @@ DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d" DiffEqDevToolsExt = "DiffEqDevTools" [compat] -ArrayAllocators = "0.3" -DiffEqBase = "6.122" -DiffEqDevTools = "2" -ExponentialUtilities = "1" -FastBroadcast = "0.2" -FastGaussQuadrature = "0.5, 1" -ForwardDiff = "0.10" -FunctionWrappersWrappers = "0.1.3" -GaussianDistributions = "0.5" -Kronecker = "0.5.4" -LinearAlgebra = "1" -Octavian = "0.3.17" -OrdinaryDiffEq = "6.52" -PSDMatrices = "0.4.6" -PrecompileTools = "1" -RecipesBase = "1" -RecursiveArrayTools = "2" -Reexport = "1" -SciMLBase = "1.90, 2" -SimpleUnPack = "1" -SpecialMatrices = "3" -StaticArrayInterface = "1.3" -Statistics = "1" -StructArrays = "0.4, 0.5, 0.6" -TaylorIntegration = "0.8, 0.9, 0.10, 0.11, 0.12, 0.13, 0.14" -TaylorSeries = "0.10, 0.11, 0.12, 0.13, 0.14, 0.15" -Test = "1" -ToeplitzMatrices = "0.7, 0.8" +ArrayAllocators = "=0.3.0" +DiffEqBase = "~6.125.0" +DiffEqDevTools = "~2.30.0" +ExponentialUtilities = "~1.22.0" +FastBroadcast = "=0.2.5" +FastGaussQuadrature = "=1.0.0" +ForwardDiff = "=0.10.13" +FunctionWrappersWrappers = "=0.1.3" +GaussianDistributions = "=0.5.2" +Kronecker = "=0.5.4" +LinearAlgebra = "~1.9.0" +Octavian = "=0.3.21" +OrdinaryDiffEq = "~6.52.0" +PSDMatrices = "=0.4.6" +PrecompileTools = "~1.0.0" +RecipesBase = "~1.3.0" +RecursiveArrayTools = "~2.36.0" +Reexport = "~1.0.0" +SciMLBase = "~1.90.0" +SimpleUnPack = "~1.0.0" +SpecialMatrices = "~3.0.0" +StaticArrayInterface = "~1.3.0" +Statistics = "~1.9.0" +StructArrays = "=0.4.0" +TaylorIntegration = "=0.9.0" +TaylorSeries = "=0.12.0" +Test = "~1.6.0" +ToeplitzMatrices = "=0.7.0" julia = "1.6" [extras] diff --git a/Project_main.toml b/Project_main.toml new file mode 100644 index 000000000..383a11a6b --- /dev/null +++ b/Project_main.toml @@ -0,0 +1,76 @@ +name = "ProbNumDiffEq" +uuid = "bf3e78b0-7d74-48a5-b855-9609533b56a5" +authors = ["Nathanael Bosch"] +version = "0.13.0" + +[deps] +ArrayAllocators = "c9d4266f-a5cb-439d-837c-c97b191379f5" +DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" +DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d" +ExponentialUtilities = "d4d017d3-3776-5f7e-afef-a10c40355c18" +FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898" +FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838" +ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" +FunctionWrappersWrappers = "77dc65aa-8811-40c2-897b-53d922fa7daf" +GaussianDistributions = "43dcc890-d446-5863-8d1a-14597580bb8d" +Kronecker = "2c470bb0-bcc8-11e8-3dad-c9649493f05e" +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +Octavian = "6fd5a793-0b7e-452c-907f-f8bfe9c57db4" +OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" +PSDMatrices = "fe68d972-6fd8-4755-bdf0-97d4c54cefdc" +PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" +RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" +RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" +Reexport = "189a3867-3050-52da-a836-e630ba90ab69" +SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" +SimpleUnPack = "ce78b400-467f-4804-87d8-8f486da07d0a" +SpecialMatrices = "928aab9d-ef52-54ac-8ca1-acd7ca42c160" +StaticArrayInterface = "0d7ed370-da01-4f52-bd93-41d350b8b718" +Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" +TaylorIntegration = "92b13dbe-c966-51a2-8445-caca9f8a7d42" +TaylorSeries = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea" +ToeplitzMatrices = "c751599d-da0a-543b-9d20-d0a503d91d24" + +[weakdeps] +DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d" + +[extensions] +DiffEqDevToolsExt = "DiffEqDevTools" + +[compat] +ArrayAllocators = "0.3" +DiffEqBase = "6.125" +DiffEqDevTools = "2" +ExponentialUtilities = "1.22" +FastBroadcast = "0.2.5" +FastGaussQuadrature = "1" +ForwardDiff = "0.10.13" +FunctionWrappersWrappers = "0.1.3" +GaussianDistributions = "0.5.2" +Kronecker = "0.5.4" +LinearAlgebra = "1.6" +Octavian = "0.3.21" +OrdinaryDiffEq = "6.52" +PSDMatrices = "0.4.6" +PrecompileTools = "1" +RecipesBase = "1" +RecursiveArrayTools = "2.36" +Reexport = "1" +SciMLBase = "1.90, 2" +SimpleUnPack = "1" +SpecialMatrices = "3" +StaticArrayInterface = "1.3" +Statistics = "1.6" +StructArrays = "0.4, 0.5, 0.6" +TaylorIntegration = "0.9, 0.10, 0.11, 0.12, 0.13, 0.14" +TaylorSeries = "0.12, 0.13, 0.14, 0.15" +Test = "1.6" +ToeplitzMatrices = "0.7, 0.8" +julia = "1.6" + +[extras] +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[targets] +test = ["Test"] diff --git a/justfile b/justfile index 9f86f303b..fc5e52931 100644 --- a/justfile +++ b/justfile @@ -17,4 +17,9 @@ benchmark: julia --project=benchmarks -e 'include("benchmarks/runall.jl")' vale: - git ls-files | xargs vale \ No newline at end of file + git ls-files | xargs vale + +test-lower-compat: + julia .just/downgrade.jl "Pkg,TOML" "v0" + julia --project=. -e "using ProbNumDiffEq" + git restore Project.toml \ No newline at end of file diff --git a/test/Project.toml b/test/Project.toml index 2af565072..2194846b6 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -11,7 +11,6 @@ ODEProblemLibrary = "fdc4e326-1af4-4b90-96e7-779fcce2daa5" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" ParameterizedFunctions = "65888b18-ceab-5e60-b2b9-181511a3b968" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" -ProbNumDiffEq = "bf3e78b0-7d74-48a5-b855-9609533b56a5" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" SimpleUnPack = "ce78b400-467f-4804-87d8-8f486da07d0a"