Skip to content

Commit 24aad72

Browse files
IanButterworthKristofferC
authored andcommitted
Update docstrings for io kwargs, some io kwarg fixes (#2402)
(cherry picked from commit 6e8b621)
1 parent abe871d commit 24aad72

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

src/API.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ function up(ctx::Context, pkgs::Vector{PackageSpec};
261261
return
262262
end
263263

264-
resolve(; kwargs...) = resolve(Context(); kwargs...)
264+
resolve(; io::IO=DEFAULT_IO[], kwargs...) = resolve(Context(;io); kwargs...)
265265
function resolve(ctx::Context; kwargs...)
266266
up(ctx; level=UPLEVEL_FIXED, mode=PKGMODE_MANIFEST, update_registry=false, kwargs...)
267267
return nothing
@@ -1390,7 +1390,7 @@ function instantiate(ctx::Context; manifest::Union{Bool, Nothing}=nothing,
13901390
# Run build scripts
13911391
Operations.build_versions(ctx, union(UUID[pkg.uuid for pkg in new_apply], new_git); verbose)
13921392

1393-
allow_autoprecomp && Pkg._auto_precompile(ctx; kwargs...)
1393+
allow_autoprecomp && Pkg._auto_precompile(ctx)
13941394
end
13951395

13961396

@@ -1404,7 +1404,7 @@ function status(ctx::Context, pkgs::Vector{PackageSpec}; diff::Bool=false, mode=
14041404
end
14051405

14061406

1407-
function activate(;temp=false,shared=false, io::IO=DEFAULT_IO[])
1407+
function activate(;temp=false, shared=false, io::IO=DEFAULT_IO[])
14081408
shared && pkgerror("Must give a name for a shared environment")
14091409
temp && return activate(mktempdir())
14101410
Base.ACTIVE_PROJECT[] = nothing

src/Pkg.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ by starting julia with `--inline=no`.
215215
const test = API.test
216216

217217
"""
218-
Pkg.gc()
218+
Pkg.gc(; io::IO=DEFAULT_IO[])
219219
220220
Garbage collect packages that are no longer reachable from any project.
221221
Only packages that are tracked by version are deleted, so no packages
@@ -225,9 +225,9 @@ const gc = API.gc
225225

226226

227227
"""
228-
Pkg.build(; verbose = false)
229-
Pkg.build(pkg::Union{String, Vector{String}}; verbose = false)
230-
Pkg.build(pkgs::Union{PackageSpec, Vector{PackageSpec}}; verbose = false)
228+
Pkg.build(; verbose = false, io::IO=DEFAULT_IO[])
229+
Pkg.build(pkg::Union{String, Vector{String}}; verbose = false, io::IO=DEFAULT_IO[])
230+
Pkg.build(pkgs::Union{PackageSpec, Vector{PackageSpec}}; verbose = false, io::IO=DEFAULT_IO[])
231231
232232
Run the build script in `deps/build.jl` for `pkg` and all of its dependencies in
233233
depth-first recursive order.
@@ -241,8 +241,8 @@ redirecting to the `build.log` file.
241241
const build = API.build
242242

243243
"""
244-
Pkg.pin(pkg::Union{String, Vector{String}})
245-
Pkg.pin(pkgs::Union{PackageSpec, Vector{PackageSpec}})
244+
Pkg.pin(pkg::Union{String, Vector{String}}; io::IO=DEFAULT_IO[])
245+
Pkg.pin(pkgs::Union{PackageSpec, Vector{PackageSpec}}; io::IO=DEFAULT_IO[])
246246
247247
Pin a package to the current version (or the one given in the `PackageSpec`) or to a certain
248248
git revision. A pinned package is never updated.
@@ -256,8 +256,8 @@ Pkg.pin(name="Example", version="0.3.1")
256256
const pin = API.pin
257257

258258
"""
259-
Pkg.free(pkg::Union{String, Vector{String}})
260-
Pkg.free(pkgs::Union{PackageSpec, Vector{PackageSpec}})
259+
Pkg.free(pkg::Union{String, Vector{String}}; io::IO=DEFAULT_IO[])
260+
Pkg.free(pkgs::Union{PackageSpec, Vector{PackageSpec}}; io::IO=DEFAULT_IO[])
261261
262262
If `pkg` is pinned, remove the pin.
263263
If `pkg` is tracking a path,
@@ -272,8 +272,8 @@ const free = API.free
272272

273273

274274
"""
275-
Pkg.develop(pkg::Union{String, Vector{String}})
276-
Pkg.develop(pkgs::Union{Packagespec, Vector{Packagespec}})
275+
Pkg.develop(pkg::Union{String, Vector{String}}; io::IO=DEFAULT_IO[])
276+
Pkg.develop(pkgs::Union{Packagespec, Vector{Packagespec}}; io::IO=DEFAULT_IO[])
277277
278278
Make a package available for development by tracking it by path.
279279
If `pkg` is given with only a name or by a URL, the package will be downloaded
@@ -346,7 +346,7 @@ Request a `ProjectInfo` struct which contains information about the active proje
346346
const project = API.project
347347

348348
"""
349-
Pkg.instantiate(; verbose = false)
349+
Pkg.instantiate(; verbose = false, io::IO=DEFAULT_IO[])
350350
351351
If a `Manifest.toml` file exists in the active project, download all
352352
the packages declared in that manifest.
@@ -360,15 +360,15 @@ dependencies in the manifest and instantiate the resulting project.
360360
const instantiate = API.instantiate
361361

362362
"""
363-
Pkg.resolve()
363+
Pkg.resolve(; io::IO=DEFAULT_IO[])
364364
365365
Update the current manifest with potential changes to the dependency graph
366366
from packages that are tracking a path.
367367
"""
368368
const resolve = API.resolve
369369

370370
"""
371-
Pkg.status([pkgs...]; mode::PackageMode=PKGMODE_PROJECT, diff::Bool=false)
371+
Pkg.status([pkgs...]; mode::PackageMode=PKGMODE_PROJECT, diff::Bool=false, io::IO=stdout)
372372
373373
Print out the status of the project/manifest.
374374
If `mode` is `PKGMODE_PROJECT`, print out status only about the packages
@@ -389,7 +389,7 @@ const status = API.status
389389

390390

391391
"""
392-
Pkg.activate([s::String]; shared::Bool=false)
392+
Pkg.activate([s::String]; shared::Bool=false, io::IO=DEFAULT_IO[])
393393
394394
Activate the environment at `s`. The active environment is the environment
395395
that is modified by executing package commands.

test/new.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2521,7 +2521,10 @@ end
25212521
@testset "STDLIBS_BY_VERSION up-to-date" begin
25222522
test_result = Pkg.Types.STDLIBS_BY_VERSION[end][2] == Pkg.Types.load_stdlib()
25232523
if !test_result
2524-
@error("STDLIBS_BY_VERSION out of date! Re-run generate_historical_stdlibs.jl!")
2524+
@error("STDLIBS_BY_VERSION out of date! Manually fix given the info below, or re-run generate_historical_stdlibs.jl!")
2525+
@show length(Pkg.Types.STDLIBS_BY_VERSION[end][2]) length(Pkg.Types.load_stdlib())
2526+
@show setdiff(Pkg.Types.STDLIBS_BY_VERSION[end][2], Pkg.Types.load_stdlib())
2527+
@show setdiff(Pkg.Types.load_stdlib(), Pkg.Types.STDLIBS_BY_VERSION[end][2])
25252528
end
25262529
@test test_result
25272530
end

0 commit comments

Comments
 (0)