Skip to content

Commit

Permalink
Update docstrings for io kwargs, some io kwarg fixes, update stdlib l…
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth authored Mar 1, 2021
1 parent c2e3879 commit 6e8b621
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ function up(ctx::Context, pkgs::Vector{PackageSpec};
return
end

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

allow_autoprecomp && Pkg._auto_precompile(ctx; kwargs...)
allow_autoprecomp && Pkg._auto_precompile(ctx)
end


Expand All @@ -1471,7 +1471,7 @@ function status(ctx::Context, pkgs::Vector{PackageSpec}; diff::Bool=false, mode=
end


function activate(;temp=false,shared=false, io::IO=DEFAULT_IO[])
function activate(;temp=false, shared=false, io::IO=DEFAULT_IO[])
shared && pkgerror("Must give a name for a shared environment")
temp && return activate(mktempdir())
Base.ACTIVE_PROJECT[] = nothing
Expand Down
2 changes: 1 addition & 1 deletion src/HistoricalStdlibs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ const STDLIBS_BY_VERSION = [
UUID("deac9b47-8bc7-5906-a0fe-35ac56dc84c0") => "LibCURL_jll",
UUID("76f85450-5226-5b5a-8eaa-529ad045b433") => "LibGit2",
UUID("e37daf67-58a4-590a-8e99-b0245dd2ffc5") => "LibGit2_jll",
UUID("a83860b7-747b-57cf-bf1f-3e79990d037f") => "LibOSXUnwind_jll",
UUID("29816b5a-b9ab-546f-933c-edad1886dfa8") => "LibSSH2_jll",
UUID("183b4373-6708-53ba-ad28-60e28bb38547") => "LibUV_jll",
UUID("745a5e78-f969-53e9-954f-d19f2f74f4e3") => "LibUnwind_jll",
UUID("8f399da3-3557-5675-b5ff-fb832c97cbdb") => "Libdl",
UUID("37e2e46d-f89d-539d-b4ee-838fcccc9c8e") => "LinearAlgebra",
UUID("47c5dbc3-30ba-59ef-96a6-123e260183d9") => "LLVMLibUnwind_jll",
UUID("56ddb016-857b-54e1-b83d-db4d58db5568") => "Logging",
UUID("3a97d323-0669-5f0c-9066-3539efd106a3") => "MPFR_jll",
UUID("d6f4376e-aef5-505a-96c1-9c027394607a") => "Markdown",
Expand Down
30 changes: 15 additions & 15 deletions src/Pkg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ by starting julia with `--inline=no`.
const test = API.test

"""
Pkg.gc()
Pkg.gc(; io::IO=DEFAULT_IO[])
Garbage collect packages that are no longer reachable from any project.
Only packages that are tracked by version are deleted, so no packages
Expand All @@ -228,9 +228,9 @@ const gc = API.gc


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

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

"""
Pkg.free(pkg::Union{String, Vector{String}})
Pkg.free(pkgs::Union{PackageSpec, Vector{PackageSpec}})
Pkg.free(pkg::Union{String, Vector{String}}; io::IO=DEFAULT_IO[])
Pkg.free(pkgs::Union{PackageSpec, Vector{PackageSpec}}; io::IO=DEFAULT_IO[])
If `pkg` is pinned, remove the pin.
If `pkg` is tracking a path,
Expand All @@ -275,8 +275,8 @@ const free = API.free


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

"""
Pkg.instantiate(; verbose = false)
Pkg.instantiate(; verbose = false, io::IO=DEFAULT_IO[])
If a `Manifest.toml` file exists in the active project, download all
the packages declared in that manifest.
Expand All @@ -363,15 +363,15 @@ dependencies in the manifest and instantiate the resulting project.
const instantiate = API.instantiate

"""
Pkg.resolve()
Pkg.resolve(; io::IO=DEFAULT_IO[])
Update the current manifest with potential changes to the dependency graph
from packages that are tracking a path.
"""
const resolve = API.resolve

"""
Pkg.status([pkgs...]; mode::PackageMode=PKGMODE_PROJECT, diff::Bool=false)
Pkg.status([pkgs...]; mode::PackageMode=PKGMODE_PROJECT, diff::Bool=false, io::IO=stdout)
Print out the status of the project/manifest.
If `mode` is `PKGMODE_PROJECT`, print out status only about the packages
Expand All @@ -392,8 +392,8 @@ const status = API.status


"""
Pkg.activate([s::String]; shared::Bool=false)
Pkg.activate(; temp::Bool=false)
Pkg.activate([s::String]; shared::Bool=false, io::IO=DEFAULT_IO[])
Pkg.activate(; temp::Bool=false, shared::Bool=false, io::IO=DEFAULT_IO[])
Activate the environment at `s`. The active environment is the environment
that is modified by executing package commands.
Expand Down
5 changes: 4 additions & 1 deletion test/new.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2500,7 +2500,10 @@ end
@testset "STDLIBS_BY_VERSION up-to-date" begin
test_result = Pkg.Types.STDLIBS_BY_VERSION[end][2] == Pkg.Types.load_stdlib()
if !test_result
@error("STDLIBS_BY_VERSION out of date! Re-run generate_historical_stdlibs.jl!")
@error("STDLIBS_BY_VERSION out of date! Manually fix given the info below, or re-run generate_historical_stdlibs.jl!")
@show length(Pkg.Types.STDLIBS_BY_VERSION[end][2]) length(Pkg.Types.load_stdlib())
@show setdiff(Pkg.Types.STDLIBS_BY_VERSION[end][2], Pkg.Types.load_stdlib())
@show setdiff(Pkg.Types.load_stdlib(), Pkg.Types.STDLIBS_BY_VERSION[end][2])
end
@test_broken test_result # TODO: fix this test
end
Expand Down

0 comments on commit 6e8b621

Please sign in to comment.