Skip to content

Commit

Permalink
Make Julia 1.10 minimum
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Oct 10, 2024
1 parent 26b88d4 commit b3070e4
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 68 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/FrontendTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ jobs:
- uses: actions/checkout@v4

# Makes thes `julia` command available
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/setup-julia@v2
with:
version: "1.6" # our lowest supported version
version: "1.10" # our lowest supported version

- name: Install Pluto.jl packages
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/LaunchTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
strategy:
matrix:
# We test quite a lot of versions because we do some OS and version specific things unfortunately
julia-version: ["1.6", "1.7"]
julia-version: ["lts", "1"]
os: [windows-latest, ubuntu-latest]

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

# Makes thes `julia` command available
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
fail-fast: false
matrix:
# We test quite a lot of versions because we do some OS and version specific things unfortunately
julia-version: ["1.6", "1.10", "1.11"] #, "nightly"] # "~1.12.0-0"]
julia-version: ["1.10", "1.11"] #, "nightly"] # "~1.12.0-0"]
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
Expand All @@ -45,9 +45,9 @@ jobs:
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
arch: ${{ (matrix.julia-version == '1.6') && 'x64' || runner.arch }}
arch: ${{ runner.arch }}

- uses: julia-actions/cache@v1
- uses: julia-actions/cache@v2

# πŸš—
- uses: julia-actions/julia-runtest@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/TestFirefox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
- uses: actions/checkout@v4

# Makes thes `julia` command available
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/setup-julia@v2
with:
version: "1.6" # our lowest supported version
version: "1.10" # our lowest supported version
arch: x64

- name: Install Pluto.jl packages
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ TOML = "1"
Tables = "1"
URIs = "1.3"
UUIDs = "1"
julia = "^1.6"
julia = "^1.10"

[extras]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand Down
7 changes: 1 addition & 6 deletions src/Configuration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -402,16 +402,11 @@ end

function _convert_to_flags(options::CompilerOptions)::Vector{String}
option_list = String[]
exclude_list = String[]

if VERSION < v"1.9"
push!(exclude_list, "--heap-size-hint")
end

for name in fieldnames(CompilerOptions)
flagname = string("--", replace(String(name), "_" => "-"))
value = getfield(options, name)
if value !== nothing && flagname βˆ‰ exclude_list
if value !== nothing
push!(option_list, string(flagname, "=", value))
end
end
Expand Down
5 changes: 1 addition & 4 deletions src/packages/IOListener.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,7 @@ function stoplistening(listener::IOListener)
end
end

freeze_loading_spinners(s::AbstractString) = _replaceall(s, 'β—‘' => '◐', 'β—’' => '◐', 'β—“' => '◐')

_replaceall(s, p) = replace(s, p)
_replaceall(s, p, ps...) = @static VERSION >= v"1.7" ? replace(s, p, ps...) : _replaceall(replace(s, p), ps...)
freeze_loading_spinners(s::AbstractString) = replace(s, 'β—‘' => '◐', 'β—’' => '◐', 'β—“' => '◐')

phasemessage(iolistener, phase::String) = phasemessage(iolistener.buffer, phase)
function phasemessage(io::IO, phase::String)
Expand Down
2 changes: 1 addition & 1 deletion src/packages/PkgCompat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ end
# βœ… Internal API with fallback
"Update the project hash in the manifest file (https://github.com/JuliaLang/Pkg.jl/pull/2815)"
function _update_project_hash!(ctx::PkgContext)
VERSION >= v"1.8.0" && isfile(manifest_file(ctx)) && try
isfile(manifest_file(ctx)) && try
Pkg.Operations.record_project_hash(ctx.env)
Pkg.Types.write_manifest(ctx.env)
catch e
Expand Down
6 changes: 1 addition & 5 deletions src/packages/precompile_isolated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ function precompile_isolated(
end
Pkg.activate($(repr(environment)); io=out_stream)
if VERSION >= v"1.8.0" # https://github.com/JuliaLang/Pkg.jl/pull/2816
Pkg.precompile(; already_instantiated=true, io=out_stream)
else
Pkg.precompile(; io=out_stream)
end
Pkg.precompile(; already_instantiated=true, io=out_stream)
"""

cmd = `$(Base.julia_cmd()[1]) $(flags) -e $(code)`
Expand Down
8 changes: 3 additions & 5 deletions src/runner/PlutoRunner/src/display/Exception.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ frame_url(m::Method) = Base.url(m)
frame_url(::Any) = nothing

function source_package(m::Union{Method,Module})
@static if VERSION >= v"1.9"
next = parentmodule(m)
next === m ? m : source_package(next)
end
next = parentmodule(m)
next === m ? m : source_package(next)
end
source_package(::Any) = nothing

Expand Down Expand Up @@ -63,7 +61,7 @@ function format_output(val::CapturedException; context=default_iocontext)
func = s.func === nothing ? nothing : s.func isa Symbol ? String(s.func) : repr(s.func)
method = method_from_frame(s)
sp = source_package(method)
pm = VERSION >= v"1.9" && method isa Method ? parentmodule(method) : nothing
pm = method isa Method ? parentmodule(method) : nothing
call = replace(pretty_stackcall(s, s.linfo), r"Main\.var\"workspace#\d+\"\." => "")

Dict(
Expand Down
6 changes: 0 additions & 6 deletions src/runner/PlutoRunner/src/evaluation/deleting globals.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,6 @@ function delete_method_doc(m::Method)
end


if VERSION < v"1.7.0-0"
@eval macro atomic(ex)
esc(ex)
end
end

"""
Delete all methods of `f` that were defined in this notebook, and leave the ones defined in other packages, base, etc. βœ‚
Expand Down
4 changes: 2 additions & 2 deletions test/MacroAnalysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ import Memoize: @memoize
@test notebook.cells[begin] |> noerror
@test notebook.cells[end].errored

@test expecterror(UndefVarError(Symbol("@m")), notebook.cells[end]; strict=VERSION >= v"1.7")
@test expecterror(UndefVarError(Symbol("@m")), notebook.cells[end]; strict=true)
cleanup(🍭, notebook)
end

Expand Down Expand Up @@ -633,7 +633,7 @@ import Memoize: @memoize
update_run!(🍭, notebook, cell(2))

@test cell(2).errored == true
@test expecterror(UndefVarError(Symbol("@dateformat_str")), cell(2); strict=VERSION >= v"1.7")
@test expecterror(UndefVarError(Symbol("@dateformat_str")), cell(2); strict=true)

update_run!(🍭, notebook, notebook.cells)

Expand Down
31 changes: 11 additions & 20 deletions test/React.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1029,29 +1029,20 @@ import Pluto.Configuration: Options, EvaluationOptions
update_run!(🍭, notebook, notebook.cells)
@test Pluto.is_just_text(notebook.topology, notebook.cells[1])
@test Pluto.is_just_text(notebook.topology, notebook.cells[2])
@static if VERSION >= v"1.10.0-DEV.1548" # ~JuliaSyntax PR Pluto.jl#2526 julia#46372
@test notebook.cells[1].errored
@test notebook.cells[2].errored
@test notebook.cells[3].errored
@test notebook.cells[1].errored
@test notebook.cells[2].errored
@test notebook.cells[3].errored

@test haskey(notebook.cells[1].output.body, :source)
@test haskey(notebook.cells[1].output.body, :diagnostics)
@test haskey(notebook.cells[1].output.body, :source)
@test haskey(notebook.cells[1].output.body, :diagnostics)

@test haskey(notebook.cells[2].output.body, :source)
@test haskey(notebook.cells[2].output.body, :diagnostics)
@test haskey(notebook.cells[2].output.body, :source)
@test haskey(notebook.cells[2].output.body, :diagnostics)

# not literal syntax error
@test haskey(notebook.cells[3].output.body, :msg)
@test !haskey(notebook.cells[3].output.body, :source)
@test !haskey(notebook.cells[3].output.body, :diagnostics)
else
@test !occursinerror("(incomplete ", notebook.cells[1])
@test !occursinerror("(incomplete ", notebook.cells[2])

@show notebook.cells[1].output.body
@test startswith(notebook.cells[1].output.body[:msg], "syntax:")
@test startswith(notebook.cells[2].output.body[:msg], "syntax:")
end
# not literal syntax error
@test haskey(notebook.cells[3].output.body, :msg)
@test !haskey(notebook.cells[3].output.body, :source)
@test !haskey(notebook.cells[3].output.body, :diagnostics)
end

@testset "using .LocalModule" begin
Expand Down
13 changes: 4 additions & 9 deletions test/packages/Basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -715,9 +715,7 @@ import Malt
# β”‚ cache file: use_pkgimages = true, debug_level = 1, check_bounds = 1, inline = true, opt_level = 2
# β”” @ Base loading.jl:2668
flip = !match
if VERSION >= v"1.9.0-aaa"
🍭.options.compiler.pkgimages = (flip ⊻ Base.JLOptions().use_pkgimages == 1) ? "yes" : "no"
end
🍭.options.compiler.pkgimages = (flip ⊻ Base.JLOptions().use_pkgimages == 1) ? "yes" : "no"
🍭.options.compiler.check_bounds = (flip ⊻ Base.JLOptions().check_bounds == 1) ? "yes" : "no"
🍭.options.compiler.inline = (flip ⊻ Base.JLOptions().can_inline == 1) ? "yes" : "no"
🍭.options.compiler.optimize = match ? Base.JLOptions().opt_level : 3 - Base.JLOptions().opt_level
Expand All @@ -739,11 +737,8 @@ import Malt
# syncing should have called Pkg.precompile(), which should have generated new precompile caches.
# If `match == false`, then this is the second run, and the precompile caches should be different.
# These new caches use the same filename (weird...), EXCEPT when the pkgimages flag changed, then you get a new filename.
if match == true || VERSION >= v"1.9.0-aaa"
@test before_sync != after_sync
@test length(before_sync) < length(after_sync)
end

@test before_sync != after_sync
@test length(before_sync) < length(after_sync)


# Now actually run the import.
Expand All @@ -763,7 +758,7 @@ import Malt
full_logs = join([log["msg"][1] for log in notebook.cells[1].logs], "\n")

# There should be a log message about loading the cache.
VERSION >= v"1.9.0-aaa" && @test occursin(r"Loading.*cache"i, full_logs)
@test occursin(r"Loading.*cache"i, full_logs)
# There should NOT be a log message about rejecting the cache.
@test !occursin(r"reject.*cache"i, full_logs)

Expand Down

0 comments on commit b3070e4

Please sign in to comment.