Skip to content
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 6 additions & 1 deletion src/frompackage/imports_helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions test/TestPackage/src/TestPackage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion test/TestPackage/src/notebook1.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.20.13
# v0.20.18

using Markdown
using InteractiveUtils
Expand Down Expand Up @@ -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