diff --git a/.github/workflows/continuous_integration.yml b/.github/workflows/continuous_integration.yml index 09ee511..ae7d417 100644 --- a/.github/workflows/continuous_integration.yml +++ b/.github/workflows/continuous_integration.yml @@ -21,7 +21,7 @@ jobs: version: - 'pre' - '1' - - '1.9.0' + - '1.10.0' os: - ubuntu-latest - macOS-latest @@ -36,7 +36,7 @@ jobs: arch: ${{ matrix.arch }} show-versioninfo: true - uses: julia-actions/julia-downgrade-compat@v1 - if: ${{ matrix.version == '1.7' }} + if: ${{ matrix.version == '1.10' }} with: strict: 'true' - uses: julia-actions/cache@v1 diff --git a/Project.toml b/Project.toml index f9ea9fe..1520b3a 100644 --- a/Project.toml +++ b/Project.toml @@ -10,7 +10,7 @@ LaTeXStrings = "1" Markdown = "1" PrecompileTools = "1" Typst_jll = "0.2, 0.3, 0.7, 0.8, 0.10, 0.11" -julia = "1.9" +julia = "1.10" [deps] Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" diff --git a/docs/Project.toml b/docs/Project.toml index c09c55a..dbc95d6 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -14,3 +14,4 @@ Documenter = "1" Luxor = "3 - 4" MakieTeX = "0.4.1" TypstJlyfish = "0.1.0" +julia = "1.10" diff --git a/docs/source/references/internals.md b/docs/source/references/internals.md index 255a57b..6444a6c 100644 --- a/docs/source/references/internals.md +++ b/docs/source/references/internals.md @@ -29,7 +29,6 @@ Typstry.Strings.show_array Typstry.Strings.show_parameters Typstry.Strings.show_raw Typstry.Strings.show_vector -Typstry.Strings.static_parse ``` ### Dates.jl diff --git a/src/Commands.jl b/src/Commands.jl index 6dc489a..7ea55da 100644 --- a/src/Commands.jl +++ b/src/Commands.jl @@ -16,14 +16,12 @@ module Commands import Base: ==, addenv, detach, eltype, firstindex, getindex, hash, ignorestatus, - iterate, keys, lastindex, length, run, setenv, show, showerror + iterate, keys, lastindex, length, run, setcpuaffinity, setenv, show, showerror using ..Typstry: Strings, Typst, TypstString, TypstText, @typst_str using .Strings: enclose, join_with, _show_typst using Artifacts: @artifact_str using Typst_jll: typst -@static isdefined(Base, :setcpuaffinity) && import Base: setcpuaffinity - # Internals """ @@ -402,25 +400,19 @@ function run(tc::TypstCommand, args...; kwargs...) process end -@static if isdefined(Base, :setcpuaffinity) - setcpuaffinity(tc::TypstCommand, cpus) = TypstCommand(tc; cpus) - - @doc """ - setcpuaffinity(::TypstCommand, cpus) +""" + setcpuaffinity(::TypstCommand, cpus) - See also [`TypstCommand`](@ref). +See also [`TypstCommand`](@ref). - !!! compat - Requires at least Julia v0.8. +# Examples - # Examples - - ```jldoctest - julia> setcpuaffinity(typst`help`, nothing) - typst`help` - ``` - """ setcpuaffinity -end +```jldoctest +julia> setcpuaffinity(typst`help`, nothing) +typst`help` +``` +""" +setcpuaffinity(tc::TypstCommand, cpus) = TypstCommand(tc; cpus) """ setenv(::TypstCommand, args...; kwargs...) diff --git a/src/Strings.jl b/src/Strings.jl index c57f902..36307f1 100644 --- a/src/Strings.jl +++ b/src/Strings.jl @@ -173,11 +173,11 @@ macro typst_str(s) current < previous && push!(args, s[current:prevind(s, previous, interpolate + backslashes รท 2)]) if interpolate - x, current = static_parse(s, start; filename, greedy = false) + x, current = parse(s, start; filename, greedy = false) isexpr(x, :incomplete) && throw(first(x.args)) interpolation = :($TypstString()) - append!(interpolation.args, static_parse(s[previous:prevind(s, current)]; filename).args[2:end]) + append!(interpolation.args, parse(s[previous:prevind(s, current)]; filename).args[2:end]) push!(args, esc(interpolation)) else current = start end @@ -475,15 +475,6 @@ show_vector(io, x) = math_mode(io, x) do io, x print(io, "\n", _indent ^ _depth, ")") end -""" - static_parse(args...; filename, kwargs...) - -Call `Meta.parse` with the `filename` if it is supported -in the current Julia version (at least v1.10). -""" -static_parse(args...; filename, kwargs...) = @static VERSION < v"1.10" ? - parse(args...; kwargs...) : parse(args...; filename, kwargs...) - ## Dates.jl """ diff --git a/test/Project.toml b/test/Project.toml index 692aabb..d7baead 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -18,6 +18,7 @@ Documenter = "1" ExplicitImports = "1.6" MakieTeX = "0.4.1" TypstJlyfish = "0.1.0" +julia = "1.10" [extras] Typstry = "f0ed7684-a786-439e-b1e3-3b82803b501e" diff --git a/test/runtests.jl b/test/runtests.jl index e6306cb..d9763c1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -22,11 +22,10 @@ test_strings(x, s; kwargs...) = @test TypstString(x; kwargs...) == s @testset "Typstry" begin for (description, descriptions) in [ - "Utilities" => ["ExplicitImports"], - # "Utilities" => ["Aqua", "Documenter", "ExplicitImports"], - # "Interface" => ["Strings", "Commands"], - # "Extensions" => map(string, names), - # "Interoperability" => ["MakieTeX", "TypstJlyfish"] + "Utilities" => ["Aqua", "Documenter", "ExplicitImports"], + "Interface" => ["Strings", "Commands"], + "Extensions" => map(string, names), + "Interoperability" => ["MakieTeX", "TypstJlyfish"] ] @info "Testing $description" @testset "$description" begin