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

Revert use of package extensions #202

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Malt = "36869731-bdee-424d-aa32-cab38c994e3b"
PackageExtensionCompat = "65ce6f38-6b18-4e1d-a461-8949797d7930"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
ProgressLogging = "33c8b6b6-d38a-422a-b730-caa89a2f386c"
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RelocatableFolders = "05181044-ff0b-4ac5-8273-598c1e38db00"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
Scratch = "6c6a2e73-6563-6170-7368-637461726353"
Sockets = "6462fe0b-24de-5631-8697-dd941f90decc"
Expand All @@ -36,13 +36,13 @@ IterTools = "1"
JSON3 = "1"
Logging = "1.6"
Malt = "1"
PackageExtensionCompat = "1"
Pkg = "1.6"
PrecompileTools = "1"
ProgressLogging = "0.1.4"
REPL = "1.6"
Random = "1.6"
RelocatableFolders = "1"
Requires = "1"
SHA = "0.7, 1.6"
Scratch = "1"
Sockets = "1.6"
Expand Down
27 changes: 0 additions & 27 deletions src/QuartoNotebookWorker/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,5 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[weakdeps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
PlotlyBase = "a03496cd-edff-5a9b-9e67-9cda94a718b5"
PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
RCall = "6f49c342-dc21-5d91-9882-a32aef131414"
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
SymPyCore = "458b697b-88f0-4a86-b56b-78b75cfb3531"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"

[extensions]
QuartoNotebookWorkerCairoMakieExt = "CairoMakie"
QuartoNotebookWorkerDataFramesTablesExt = ["DataFrames", "Tables"]
QuartoNotebookWorkerJSONExt = "JSON"
QuartoNotebookWorkerLaTeXStringsExt = "LaTeXStrings"
QuartoNotebookWorkerMakieExt = "Makie"
QuartoNotebookWorkerPlotlyBaseExt = "PlotlyBase"
QuartoNotebookWorkerPlotlyJSExt = "PlotlyJS"
QuartoNotebookWorkerPlotsExt = "Plots"
QuartoNotebookWorkerRCallExt = "RCall"
QuartoNotebookWorkerReviseExt = "Revise"
QuartoNotebookWorkerSymPyCoreExt = "SymPyCore"

[preferences.QuartoNotebookWorker]
packages = []
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module QuartoNotebookWorkerCairoMakieExt

import QuartoNotebookWorker
import CairoMakie
import ..CairoMakie

function configure()
fm = QuartoNotebookWorker._figure_metadata()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module QuartoNotebookWorkerDataFramesTablesExt

import QuartoNotebookWorker
import DataFrames
import Tables
import ..DataFrames
import ..Tables

QuartoNotebookWorker._ojs_convert(df::DataFrames.AbstractDataFrame) = Tables.rows(df)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module QuartoNotebookWorkerJSONExt

import QuartoNotebookWorker
import JSON
import ..JSON

function QuartoNotebookWorker._ojs_define(::QuartoNotebookWorker.OJSDefine, kwargs)
contents = QuartoNotebookWorker.ojs_convert(kwargs)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module QuartoNotebookWorkerLaTeXStringsExt

import QuartoNotebookWorker as QNW
import LaTeXStrings as LS
import ..LaTeXStrings as LS

QNW._mimetype_wrapper(s::LS.LaTeXString) = LaTeXStringWrapper(s)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module QuartoNotebookWorkerMakieExt

import QuartoNotebookWorker
import Makie
import ..Makie

function configure()
fm = QuartoNotebookWorker._figure_metadata()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module QuartoNotebookWorkerPlotlyBaseExt

import QuartoNotebookWorker
import PlotlyBase
import ..PlotlyBase

struct PlotlyBasePlotWithoutRequireJS
plot::PlotlyBase.Plot
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module QuartoNotebookWorkerPlotlyJSExt

import QuartoNotebookWorker
import PlotlyJS
import ..PlotlyJS

QuartoNotebookWorker.expand(p::PlotlyJS.SyncPlot) = QuartoNotebookWorker.expand(p.plot)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module QuartoNotebookWorkerPlotsExt

import QuartoNotebookWorker
import Plots
import ..Plots

function configure()
fm = QuartoNotebookWorker._figure_metadata()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module QuartoNotebookWorkerRCallExt

import QuartoNotebookWorker
import RCall
import ..RCall

const RCall_temp_files_ref = Ref{String}()
const rcalljl_device_ref = Ref{Symbol}(:png)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module QuartoNotebookWorkerReviseExt

import Revise
import ..Revise
import QuartoNotebookWorker

function __init__()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module QuartoNotebookWorkerSymPyCoreExt

import QuartoNotebookWorker as QNW
import SymPyCore as SPC
import ..SymPyCore as SPC

QNW._mimetype_wrapper(s::SPC.SymbolicObject) = SymWrapper(s)
QNW._mimetype_wrapper(s::AbstractArray{<:SPC.Sym}) = SymWrapper(s)
Expand Down
47 changes: 42 additions & 5 deletions src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,49 @@

end

# Handle older versions of Julia that don't have support for package extensions.
# Note that this macro must be called in the root-module of a package, otherwise
# `pathof(__module__)` will be `nothing`.
import .Packages.PackageExtensionCompat: @require_extensions
# TODO: currently we cannot use package extensions for this code that is loaded
# via `Requires.jl` since we appear to have encountered a potential bug with
# the combination of a system image that contains dependencies that are
# referenced below, versions of Julia from 1.10.5 onwards, and package
# extensions that triggers cyclic dependency check errors even though they
# appear, at least on the surface, to be false positives.
import .Packages.Requires
function __init__()
@require_extensions
Requires.@require CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" include(

Check warning on line 83 in src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl

View check run for this annotation

Codecov / codecov/patch

src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl#L83

Added line #L83 was not covered by tests
"../ext/QuartoNotebookWorkerCairoMakieExt.jl",
)
Requires.@require DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" begin
Requires.@require Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" include(

Check warning on line 87 in src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl

View check run for this annotation

Codecov / codecov/patch

src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl#L86-L87

Added lines #L86 - L87 were not covered by tests
"../ext/QuartoNotebookWorkerDataFramesTablesExt.jl",
)
end
Requires.@require JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" include(

Check warning on line 91 in src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl

View check run for this annotation

Codecov / codecov/patch

src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl#L91

Added line #L91 was not covered by tests
"../ext/QuartoNotebookWorkerJSONExt.jl",
)
Requires.@require LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" include(

Check warning on line 94 in src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl

View check run for this annotation

Codecov / codecov/patch

src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl#L94

Added line #L94 was not covered by tests
"../ext/QuartoNotebookWorkerLaTeXStringsExt.jl",
)
Requires.@require Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" include(

Check warning on line 97 in src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl

View check run for this annotation

Codecov / codecov/patch

src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl#L97

Added line #L97 was not covered by tests
"../ext/QuartoNotebookWorkerMakieExt.jl",
)
Requires.@require PlotlyBase = "a03496cd-edff-5a9b-9e67-9cda94a718b5" include(

Check warning on line 100 in src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl

View check run for this annotation

Codecov / codecov/patch

src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl#L100

Added line #L100 was not covered by tests
"../ext/QuartoNotebookWorkerPlotlyBaseExt.jl",
)
Requires.@require PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a" include(

Check warning on line 103 in src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl

View check run for this annotation

Codecov / codecov/patch

src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl#L103

Added line #L103 was not covered by tests
"../ext/QuartoNotebookWorkerPlotlyJSExt.jl",
)
Requires.@require Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" include(

Check warning on line 106 in src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl

View check run for this annotation

Codecov / codecov/patch

src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl#L106

Added line #L106 was not covered by tests
"../ext/QuartoNotebookWorkerPlotsExt.jl",
)
Requires.@require RCall = "6f49c342-dc21-5d91-9882-a32aef131414" include(

Check warning on line 109 in src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl

View check run for this annotation

Codecov / codecov/patch

src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl#L109

Added line #L109 was not covered by tests
"../ext/QuartoNotebookWorkerRCallExt.jl",
)
Requires.@require Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" include(

Check warning on line 112 in src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl

View check run for this annotation

Codecov / codecov/patch

src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl#L112

Added line #L112 was not covered by tests
"../ext/QuartoNotebookWorkerReviseExt.jl",
)
Requires.@require SymPyCore = "458b697b-88f0-4a86-b56b-78b75cfb3531" include(

Check warning on line 115 in src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl

View check run for this annotation

Codecov / codecov/patch

src/QuartoNotebookWorker/src/QuartoNotebookWorker.jl#L115

Added line #L115 was not covered by tests
"../ext/QuartoNotebookWorkerSymPyCoreExt.jl",
)
end

# Imports.
Expand Down
4 changes: 2 additions & 2 deletions src/WorkerSetup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import TOML
# Vendored packages.

import IOCapture
import PackageExtensionCompat
import Requires

# Dependency detection.

Expand Down Expand Up @@ -103,7 +103,7 @@ end
const VENDORED_PACKAGES = package_information([
# This contains the entry point files for each vendored package.
IOCapture,
PackageExtensionCompat,
Requires,
])

# So that we key the loader environment on the vendored package versions.
Expand Down
Loading