You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# We use `only` here because I believe the entry will always contain a single dict wrapped in an array. If we encounter a case where this is not true the only will throw instead of silently taking just the first
@@ -285,13 +295,15 @@ function get_manifest_file(p::FromPackageController)
285
295
proj_file = project.file
286
296
envdir =dirname(abspath(proj_file))
287
297
manifest_file =if mode in (:instantiate, :resolve)
# We delete this as it's a previous version of the mirror_package_callback function
417
+
verbose &&@warn"Deleting previous version of package_callback function"
418
+
deleteat!(callbacks, i)
419
+
end
420
+
# Add the package callback if not already present
421
+
push!(callbacks, mirror_package_callback)
398
422
end
399
-
# Add the package callback if not already present
400
-
push!(callbacks, mirror_package_callback)
401
423
end
402
424
end
403
425
404
426
# This function will extract a module from the _LoadedModules_ module which will be populated when each package is loaded in julia
405
427
functionget_dep_from_loaded_modules(key::Symbol)
406
428
loaded_modules =get_loaded_modules_mod()
407
429
isdefined(loaded_modules, key) ||error("The module $key can not be found in the loaded modules.")
408
-
m =getproperty(loaded_modules, key)::Module
430
+
m =invokelatest(getproperty, loaded_modules, key)::Module
409
431
return m
410
432
end
411
433
# This is internally calls the previous function, allowing to control which packages can be loaded (by default only direct dependencies and stdlibs are allowed)
@@ -443,10 +465,10 @@ end
443
465
444
466
# Basically Base.names but ignores names that are not defined in the module and allows to restrict to only exported names (since 1.11 added also public names as out of names). It also defaults `all` and `imported` to true (to be more precise, to the opposite of `only_exported`)
m =extract_nested_module(starting_module, path; first_dot_skipped=true)
137
-
modname.original =fullname(m) |> collect
137
+
modname.original =_fullname(m) |> collect
138
138
else
139
139
error("The provided import statement is not a valid input for the @frompackage macro.\nIf you want to import from a dependency of the target package, prepend `>.` in front of the package name, e.g. `using >.BenchmarkTools`.")
140
140
end
@@ -156,7 +156,7 @@ end
156
156
# This function will include all the names of the module as explicit imports in the import statement. It will modify the provided mwn in place and unless usings are excluded, it will also add all the using statements being parsed while evaluating the target module
mwn.imported =invokelatest(filterednames, p, m) .|> ImportAs
160
160
ex =reconstruct_import_statement(mwn; head=:import)
161
161
# If we exclude using, we simply return the expression
162
162
exclude_usings &&return ex
@@ -188,7 +188,8 @@ function complete_imported_names!(mwn::ModuleWithNames, p::FromPackageController
188
188
# Here we do not modify the list of explicitily imported names, as it's better to get an error if you explicitly import something that was already defined in the notebook
# We have to recreate the module of the extension, as ExprSplitter will not recreate it if it's already there and it will still have inside a reference to an old version of the package of interest. Not sure if this was a non-found bug before or it's only a problem with either julia 1.12 or JuliaIntepreterv0.10
0 commit comments