Skip to content

Commit

Permalink
Merge branch 'main' into add-julia-heap-size-hint
Browse files Browse the repository at this point in the history
  • Loading branch information
kirill-kondrashov authored Jan 22, 2024
2 parents d99547b + 46d1030 commit 644efcf
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .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.8", "1.10"] #, "nightly"] # "~1.11.0-0"]
julia-version: ["1.6", "1.8", "1.10", "nightly"] # "~1.11.0-0"]
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
*.jl.cov
*.jl.*.cov
*.jl.mem
precompile.jl
build
Manifest.toml

Expand Down
10 changes: 5 additions & 5 deletions frontend/editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
--pluto-operator-ligatures: none;
--julia-mono-font-stack: JuliaMono, Menlo, "Roboto Mono", "Lucida Sans Typewriter", "Source Code Pro", monospace;
--sans-serif-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
--lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji",
"Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif;
--system-ui-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji",
"Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif;
--lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol", system-ui, sans-serif;
--system-ui-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol", system-ui, sans-serif;
color-scheme: light dark;
}

Expand Down Expand Up @@ -2410,7 +2410,7 @@ pluto-helpbox.hidden > section {
/* see https://github.com/JuliaDocs/Documenter.jl for author information */

.helpbox-docs {
font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
font-family: var(--lato-ui-font-stack);
line-height: 1.5;
font-size: 0.9rem;
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/error.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
}

:root {
--inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji",
"Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif;
--inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol", system-ui, sans-serif;
--system-fonts-mono: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

color-scheme: light dark;
Expand Down
8 changes: 4 additions & 4 deletions frontend/welcome.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
--pluto-operator-ligatures: none;
--julia-mono-font-stack: JuliaMono, Menlo, "Roboto Mono", "Lucida Sans Typewriter", "Source Code Pro", monospace;
--sans-serif-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
--lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji",
"Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif;
--inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, Helvetica, Arial, "Apple Color Emoji",
"Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif;
--lato-ui-font-stack: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol", system-ui, sans-serif;
--inter-ui-font-stack: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol", system-ui, sans-serif;

color-scheme: light dark;
}
Expand Down
7 changes: 6 additions & 1 deletion src/analysis/PlutoDependencyExplorer/ExpressionExplorer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,12 @@ function maybe_macroexpand_pluto(ex::Expr; recursive::Bool=false, expand_bind::B
funcname = ExpressionExplorer.split_funcname(ex.args[1])

if funcname.joined (expand_bind ? can_macroexpand : can_macroexpand_no_bind)
macroexpand(get_plutorunner(), ex; recursive=false)::Expr
try
macroexpand(get_plutorunner(), ex; recursive=false)::Expr
catch e
@debug "Could not macroexpand" ex exception=(e, catch_backtrace())
ex
end
else
ex
end
Expand Down
12 changes: 0 additions & 12 deletions src/precompile.jl
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
using PrecompileTools: PrecompileTools

const __TEST_NOTEBOOK_ID = uuid1()

PrecompileTools.@compile_workload begin
let
channel = Channel{Any}(10)
Pluto.PlutoRunner.setup_plutologger(
__TEST_NOTEBOOK_ID,
channel,
)
end
expr = Expr(:toplevel, :(1 + 1))
Pluto.PlutoRunner.run_expression(Module(), expr, __TEST_NOTEBOOK_ID, uuid1(), nothing);

nb = Pluto.Notebook([
Pluto.Cell("""md"Hello *world*" """)
Pluto.Cell("""[f(x)]""")
Expand Down
2 changes: 2 additions & 0 deletions src/runner/PlutoRunner/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
FuzzyCompletions = "0.3,0.4,0.5"
PrecompileTools = "1"
2 changes: 2 additions & 0 deletions src/runner/PlutoRunner/src/PlutoRunner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2699,4 +2699,6 @@ function setup_plutologger(notebook_id::UUID, log_channel::Channel{Any})
pluto_log_channels[notebook_id] = log_channel
end

include("./precompile.jl")

end
20 changes: 20 additions & 0 deletions src/runner/PlutoRunner/src/precompile.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using PrecompileTools: PrecompileTools
using UUIDs: uuid1

const __TEST_NOTEBOOK_ID = uuid1()

PrecompileTools.@compile_workload begin
let
channel = Channel{Any}(10)
PlutoRunner.setup_plutologger(
__TEST_NOTEBOOK_ID,
channel,
)
end
expr = Expr(:toplevel, :(1 + 1))
cell_id = uuid1()
workspace = Module()
PlutoRunner.run_expression(workspace, expr, __TEST_NOTEBOOK_ID, cell_id, nothing);
PlutoRunner.formatted_result_of(__TEST_NOTEBOOK_ID, cell_id,
false, String[], nothing, workspace; capture_stdout=true)
end
11 changes: 8 additions & 3 deletions test/helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,14 @@ end

function expecterror(err, cell; strict=true)
cell.errored || return false
io = IOBuffer()
showerror(io, err)
msg = String(take!(io))
msg = sprint(showerror, err)

# UndefVarError(:x, #undef)
if err isa UndefVarError && !isdefined(err, :scope) && VERSION > v"1.10"
strict = false
msg = first(split(msg, '\n'; limit=2))
end

if strict
return cell.output.body[:msg] == msg
else
Expand Down

0 comments on commit 644efcf

Please sign in to comment.