Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Julia 1.6 minimum #1885

Merged
merged 2 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/FrontendTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
# Makes thes `julia` command available
- uses: julia-actions/setup-julia@v1
with:
version: "1.5"
version: "1.6"

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

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
matrix:
# We test quite a lot of versions because we do some OS and version specific things unfortunately
julia-version: ["1.5", "1.6", "1.7"] #, "nightly"]
julia-version: ["1.6", "1.7"] #, "nightly"]
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ HTTP = "^0.9.1"
MsgPack = "1.1"
RelocatableFolders = "0.1"
Tables = "1"
julia = "^1.5"
julia = "^1.6"

[extras]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ _([video](https://www.youtube.com/watch?v=rpB6zQNsbQU)) Grant Sanderson ([3Blue1

For one tasty notebook 🥞 you will need:

- [**Julia** v1.5 or above](https://julialang.org/downloads/#current_stable_release)
- [**Julia** v1.6 or above](https://julialang.org/downloads/#current_stable_release)
- **Linux**, **MacOS** or **Windows**, _Linux and MacOS will work best_
- Mozilla **Firefox** or Google **Chrome**

Expand Down
4 changes: 1 addition & 3 deletions src/Configuration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ function _convert_to_flags(options::CompilerOptions)::Vector{String}
flagname = string("--", replace(String(name), "_" => "-"))
value = getfield(options, name)
if value !== nothing
if !(VERSION <= v"1.5.0-" && name === :threads)
push!(option_list, string(flagname, "=", value))
end
push!(option_list, string(flagname, "=", value))
end
end

Expand Down
40 changes: 18 additions & 22 deletions src/packages/PkgCompat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -340,32 +340,28 @@ package_exists(package_name::AbstractString)::Bool =

# 🐸 "Public API", but using PkgContext
function dependencies(ctx)
# Pkg.dependencies(ctx) should also work on 1.5, but there is some weird bug (run the tests without this patch). This is probably some Pkg bug that got fixed.
@static if VERSION < v"1.6.0-a"
ctx.env.manifest
else
try
# ctx.env.manifest
@static if hasmethod(Pkg.dependencies, (PkgContext,))
Pkg.dependencies(ctx)
else
Pkg.dependencies(ctx.env)
end
catch e
if !occursin(r"expected.*exist.*manifest", sprint(showerror, e))
@error """
Pkg error: you might need to use

Pluto.reset_notebook_environment(notebook_path)
try
# ctx.env.manifest
@static if hasmethod(Pkg.dependencies, (PkgContext,))
Pkg.dependencies(ctx)
else
Pkg.dependencies(ctx.env)
end
catch e
if !occursin(r"expected.*exist.*manifest", sprint(showerror, e))
@error """
Pkg error: you might need to use

to reset this notebook's environment.
Pluto.reset_notebook_environment(notebook_path)

Before doing so, consider sending your notebook file to https://github.com/fonsp/Pluto.jl/issues together with the following info:
""" Pluto.PLUTO_VERSION VERSION exception=(e,catch_backtrace())
end
to reset this notebook's environment.

Dict()
Before doing so, consider sending your notebook file to https://github.com/fonsp/Pluto.jl/issues together with the following info:
""" Pluto.PLUTO_VERSION VERSION exception=(e,catch_backtrace())
end

Dict()

end
end

Expand Down
13 changes: 4 additions & 9 deletions src/runner/Loader.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,10 @@ catch
end
try
# we don't suppress IO for this one because it can take very long, and that would be a frustrating experience without IO
if VERSION >= v"1.6.0-a"
# precompilation switched off because of https://github.com/fonsp/Pluto.jl/issues/875
Pkg.instantiate(pkg_ctx; update_registry=false, allow_autoprecomp=false)
elseif VERSION >= v"1.3.0"
# registry update is not required here and may save some time for startup
Pkg.instantiate(pkg_ctx; update_registry=false)
else
Pkg.instantiate(pkg_ctx)
end

# precompilation switched off because of https://github.com/fonsp/Pluto.jl/issues/875
Pkg.instantiate(pkg_ctx; update_registry=false, allow_autoprecomp=false)

catch e
@error "Failed to instantiate notebook boot environment" exception=(e, catch_backtrace())
end
Expand Down
18 changes: 7 additions & 11 deletions test/Configuration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,15 @@ end
end

@testset "flag conversion" begin
if VERSION > v"1.5.0-"
@test _convert_to_flags(Configuration.CompilerOptions(threads="123")) ==
["--startup-file=no", "--history-file=no", "--threads=123"]
@test _convert_to_flags(Configuration.CompilerOptions(threads="123")) ==
["--startup-file=no", "--history-file=no", "--threads=123"]

@test _convert_to_flags(Configuration.CompilerOptions(threads=123)) ==
["--startup-file=no", "--history-file=no", "--threads=123"]
@test _convert_to_flags(Configuration.CompilerOptions(threads=123)) ==
["--startup-file=no", "--history-file=no", "--threads=123"]

@test _convert_to_flags(Configuration.CompilerOptions()) ⊇
["--startup-file=no", "--history-file=no"]

@test _convert_to_flags(Configuration.CompilerOptions()) ⊇
["--startup-file=no", "--history-file=no"]
else
@test _convert_to_flags(Configuration.CompilerOptions()) ==
["--startup-file=no", "--history-file=no"]
end
@test _convert_to_flags(Configuration.CompilerOptions(compile="min")) ⊇
["--compile=min", "--startup-file=no", "--history-file=no"]
end
Expand Down
4 changes: 1 addition & 3 deletions test/ExpressionExplorer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,6 @@ Some of these @test_broken lines are commented out to prevent printing to the te
@test ExpressionExplorer.external_package_names(:(using Plots, Something.Else, .LocalModule)) == Set([:Plots, :Something])
@test ExpressionExplorer.external_package_names(:(import Plots.A: b, c)) == Set([:Plots])

if VERSION >= v"1.6.0"
@test ExpressionExplorer.external_package_names(Meta.parse("import Foo as Bar, Baz.Naz as Jazz")) == Set([:Foo, :Baz])
end
@test ExpressionExplorer.external_package_names(Meta.parse("import Foo as Bar, Baz.Naz as Jazz")) == Set([:Foo, :Baz])
end
end
2 changes: 1 addition & 1 deletion test/React.jl
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ import Distributed
end

# PlutoTest.jl is only working on Julia version >= 1.6
VERSION >= v"1.6" && @testset "Test Firebasey" begin
@testset "Test Firebasey" begin
🍭.options.evaluation.workspace_use_distributed = true

file = tempname()
Expand Down
6 changes: 2 additions & 4 deletions test/RichOutput.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,8 @@ import Pluto: update_run!, WorkspaceManager, ClientSession, ServerSession, Noteb
s = string(notebook.cells[2].output.body)
@test occursin("OffsetArray", s)
@test occursin("21", s)
if VERSION >= v"1.3"
# once in the prefix, once as index
@test count("22", s) >= 2
end
# once in the prefix, once as index
@test count("22", s) >= 2

WorkspaceManager.unmake_workspace((🍭, notebook))
🍭.options.evaluation.workspace_use_distributed = false
Expand Down
2 changes: 1 addition & 1 deletion test/WorkspaceManager.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import Distributed
WorkspaceManager.unmake_workspace((🍭, notebook))
end

Sys.iswindows() || (VERSION < v"1.6.0-a") || @testset "Pluto inside Pluto" begin
Sys.iswindows() || @testset "Pluto inside Pluto" begin

client = ClientSession(:fakeA, nothing)
🍭 = ServerSession()
Expand Down
2 changes: 1 addition & 1 deletion test/packages/old_artifacts_import.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using InteractiveUtils
# ╔═╡ c581d17a-c965-11eb-1607-bbeb44933d25
# This file imports an outdated version of PlutoPkgTestA: 0.2.1 (which is stored in the embedded Manifest file) and Artifacts, which is now a standard library (as of Julia 1.6), but it used to be a registered package (https://github.com/JuliaPackaging/Artifacts.jl). This notebook was generated on Julia 1.5, so the Manifest will be very very confusing for Julia 1.6 and up.

# It is generated on Julia 1.5 (our oldest supported Julia version, Manifest.toml is not backwards-compatible):
# It is generated on Julia 1.5 (our oldest supported Julia version (at the time of writing), Manifest.toml is not backwards-compatible):

# 1. add our test registry:
# pkg> registry add https://github.com/JuliaPluto/PlutoPkgTestRegistry
Expand Down
2 changes: 1 addition & 1 deletion test/packages/simple_import.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using InteractiveUtils
# ╔═╡ c581d17a-c965-11eb-1607-bbeb44933d25
# This file imports an outdated version of PlutoPkgTestA: 0.2.2 (which is stored in the embedded Manifest file).

# It is generated on Julia 1.5 (our oldest supported Julia version, Manifest.toml is not backwards-compatible):
# It is generated on Julia 1.5 (our oldest supported Julia version (at the time of writing), Manifest.toml is not backwards-compatible):

# 1. add our test registry:
# pkg> registry add https://github.com/JuliaPluto/PlutoPkgTestRegistry
Expand Down