diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71ceefb819..4f25f33ab7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: - version: '1' os: windows-latest arch: x64 - - version: '1.6' + - version: '1.10' os: ubuntu-latest arch: x64 - version: '1' diff --git a/Project.toml b/Project.toml index ab1e6af1dd..930997db9b 100644 --- a/Project.toml +++ b/Project.toml @@ -7,7 +7,7 @@ BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" CodecBzip2 = "523fee87-0ab8-5b00-afb7-3ecf72e48cfd" CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" -JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1" +JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MutableArithmetics = "d8a4904e-b15c-11e9-3269-09a3773c0cb0" NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" @@ -23,18 +23,18 @@ BenchmarkTools = "1" CodecBzip2 = "0.6, 0.7, 0.8" CodecZlib = "0.6, 0.7" ForwardDiff = "0.10, 1" -JSON3 = "1" +JSON = "1" JSONSchema = "1" -LinearAlgebra = "<0.0.1, 1.6" +LinearAlgebra = "1" MutableArithmetics = "1" NaNMath = "0.3, 1" OrderedCollections = "1" PrecompileTools = "1" -Printf = "<0.0.1, 1.6" -SparseArrays = "<0.0.1, 1.6" +Printf = "1" +SparseArrays = "1" SpecialFunctions = "0.8, 1, 2" -Test = "<0.0.1, 1.6" -julia = "1.6" +Test = "1" +julia = "1.10" [extras] JSONSchema = "7d188eb4-7ad8-530c-ae41-71a32a6d4692" diff --git a/src/FileFormats/MOF/MOF.jl b/src/FileFormats/MOF/MOF.jl index ad8d98ceab..d15fa2104c 100644 --- a/src/FileFormats/MOF/MOF.jl +++ b/src/FileFormats/MOF/MOF.jl @@ -7,7 +7,7 @@ module MOF import ..FileFormats -import JSON3 +import JSON import MathOptInterface as MOI """ diff --git a/src/FileFormats/MOF/read.jl b/src/FileFormats/MOF/read.jl index 89250cf66b..197f569508 100644 --- a/src/FileFormats/MOF/read.jl +++ b/src/FileFormats/MOF/read.jl @@ -13,7 +13,7 @@ function Base.read!(io::IO, model::Model) if !MOI.is_empty(model) error("Cannot read model from file as destination model is not empty.") end - object = JSON3.read(io, Dict{String,Any}) + object = JSON.parse(io; dicttype = Dict{String,Any}) file_version = _parse_mof_version(object["version"]::Dict{String,Any}) if !(file_version in _SUPPORTED_VERSIONS) version = _SUPPORTED_VERSIONS[1] diff --git a/src/FileFormats/MOF/write.jl b/src/FileFormats/MOF/write.jl index 1226adcc8b..98d9c740f8 100644 --- a/src/FileFormats/MOF/write.jl +++ b/src/FileFormats/MOF/write.jl @@ -33,7 +33,7 @@ function Base.write(io::IO, model::Model) if has_scalar_nonlinear object = (; has_scalar_nonlinear = true, object...) end - JSON3.write(io, object) + Base.write(io, JSON.json(object)) return end diff --git a/test/FileFormats/MOF/MOF.jl b/test/FileFormats/MOF/MOF.jl index 6eaa81ca8a..f607b6f172 100644 --- a/test/FileFormats/MOF/MOF.jl +++ b/test/FileFormats/MOF/MOF.jl @@ -8,7 +8,7 @@ module TestMOF using Test -import JSON3 +import JSON import JSONSchema import MathOptInterface as MOI @@ -17,7 +17,10 @@ const MOF = MOI.FileFormats.MOF const TEST_MOF_FILE = "test.mof.json" const SCHEMA = JSONSchema.Schema( - JSON3.read(read(MOI.FileFormats.MOF.SCHEMA_PATH, String), Dict{String,Any}), + JSON.parse( + read(MOI.FileFormats.MOF.SCHEMA_PATH, String); + dicttype = Dict{String,Any}, + ), ) function runtests() @@ -40,7 +43,7 @@ function _validate(filename::String) "r", MOI.FileFormats.AutomaticCompression(), ) do io - object = JSON3.read(io, Dict{String,Any}) + object = JSON.parse(io; dicttype = Dict{String,Any}) ret = JSONSchema.validate(SCHEMA, object) if ret !== nothing error( @@ -1565,7 +1568,7 @@ function test_use_nlp_block() io = IOBuffer() write(io, model) seekstart(io) - object = JSON3.read(io, Dict{String,Any}) + object = JSON.parse(io; dicttype = Dict{String,Any}) @test object["has_scalar_nonlinear"] == true @test JSONSchema.validate(SCHEMA, object) === nothing # Test (; use_nlp_block = nothing)