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
11 changes: 10 additions & 1 deletion src/PumasProductManager.jl
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,17 @@ function _setup_ppm_channel()

_heal_juliaup_channels(jc)

# Ensure "release" exists so +PumasProductManager always aliases to a real channel,
# not another alias (juliaup rejects alias-to-alias).
all_channels = vcat(
filter(!isnothing, [get(jc, "DefaultChannel", nothing)]),
get(jc, "OtherChannels", []),
)
has_release = any(ch -> get(ch, "Name", "") == "release", all_channels)
has_release || run(`juliaup add release`)

juliaup_cfg = Dict("extra_args" => ["-i", "-e", "import PumasProductManager"])
_link_juliaup_channel("PumasProductManager", juliaup_cfg; jc)
_link_juliaup_channel("PumasProductManager", juliaup_cfg, "release"; jc)
end

# Run as part of precompilation. When we update the package via `Pkg.update()`
Expand Down
18 changes: 18 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,24 @@ using Test

run(`juliaup rm PumasProductManager`)
end

@testset "_setup_ppm_channel when default is a Pumas alias" begin
run(ignorestatus(`juliaup rm PumasProductManager`))
run(`juliaup add 1.11`)
run(`juliaup link Pumas@2.7.1 +1.11 -- --project=@Pumas@2.7.1`)
run(`juliaup default Pumas@2.7.1`)
try
PPM._setup_ppm_channel()
config = PPM.juliaup_config()
ch = only(filter(c -> c["Name"] == "PumasProductManager", config["OtherChannels"]))
@test startswith(ch["File"], "alias-to-") || isfile(ch["File"])
@test ch["Args"] == ["--project=@PumasProductManager", "-i", "-e", "import PumasProductManager"]
finally
run(`juliaup default 1.11`)
run(ignorestatus(`juliaup rm Pumas@2.7.1`))
run(ignorestatus(`juliaup rm PumasProductManager`))
end
end
end
end
end
Expand Down