From e939e991ff1a472218a2f7896174ffc0fe95d6b4 Mon Sep 17 00:00:00 2001 From: Alberto Mengali Date: Mon, 10 Nov 2025 13:51:06 +0100 Subject: [PATCH 1/2] fix imports from Core/Base --- src/frompackage/imports_helpers.jl | 7 ++++++- test/TestPackage/src/TestPackage.jl | 3 +++ test/TestPackage/src/notebook1.jl | 10 +++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/frompackage/imports_helpers.jl b/src/frompackage/imports_helpers.jl index 3d1dd34..ad36fb5 100644 --- a/src/frompackage/imports_helpers.jl +++ b/src/frompackage/imports_helpers.jl @@ -145,7 +145,12 @@ function process_modpath!(mwn::ModuleWithNames, p::FromPackageController{name}; elseif root_name === :> # Deps import @assert !is_catchall(mwn) "You can't use the catch-all expression when importing from dependencies" - m = get_dep_from_loaded_modules(p, first(path); allow_manifest=true) + modname = first(path) + m = if modname in (:Base, :Core) + modname == :Base ? Base : Core + else + get_dep_from_loaded_modules(p, first(path); allow_manifest=true) + end # Replace the deps name with the uuid_name symbol from loaded modules path[1] = unique_module_name(m) # Add the loaded module path diff --git a/test/TestPackage/src/TestPackage.jl b/test/TestPackage/src/TestPackage.jl index 37ceace..0b4c044 100644 --- a/test/TestPackage/src/TestPackage.jl +++ b/test/TestPackage/src/TestPackage.jl @@ -3,6 +3,9 @@ module TestPackage import PlutoDevMacros export toplevel_variable +using Base.Threads: Threads, Event +using Core: MethodTable + const TEST_INIT = Ref{Int}(0) toplevel_variable = 15 diff --git a/test/TestPackage/src/notebook1.jl b/test/TestPackage/src/notebook1.jl index 1fadfc9..ef73fed 100644 --- a/test/TestPackage/src/notebook1.jl +++ b/test/TestPackage/src/notebook1.jl @@ -1,5 +1,5 @@ ### A Pluto.jl notebook ### -# v0.20.13 +# v0.20.18 using Markdown using InteractiveUtils @@ -32,9 +32,17 @@ toplevel_variable + hidden_toplevel_variable # # We define a method testmethod(x) = "ANY" +# ╔═╡ cd0230d0-2a08-4839-a788-630fbce8faf1 +Event == Base.Threads.Event || error("There was a problem loading from Base") + +# ╔═╡ 6338e7c7-8218-4e65-beca-94e43ece936e +MethodTable == Core.MethodTable || error("There was a problem loading from Core") + # ╔═╡ Cell order: # ╠═8de53a58-e6ab-11ed-1db7-ef087d78eaef # ╠═22f0a6a4-907b-4389-b6b7-1f175289c69b # ╠═cf9f785b-f8f5-4d1b-9a48-ca5983843ba4 # ╠═9a8ae7e2-d3c4-4cf2-876e-bcde84741540 # ╠═c9997396-bd93-41f1-8c3c-d13c7c6c5c3e +# ╠═cd0230d0-2a08-4839-a788-630fbce8faf1 +# ╠═6338e7c7-8218-4e65-beca-94e43ece936e From 6866da348af0fe7d397c00f935a0693ede2ad683 Mon Sep 17 00:00:00 2001 From: Alberto Mengali Date: Mon, 10 Nov 2025 13:51:56 +0100 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b48d346..0661c26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Fixed +- Fixed an issue when importing from submodules of the imported package without using relative imports. +- Fixed an issue when trying to import (either directly or indirectly via `import *`) from Base or Core. + ## [0.9.1] - 2025-07-14 This is the first version were the CHANGELOG was added