Skip to content
This repository was archived by the owner on Apr 12, 2019. It is now read-only.

Commit ca65ee9

Browse files
committed
move Pkg to stdlib
1 parent 3dd40ff commit ca65ee9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+161
-132
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
/tmp/julia/bin/julia-debug --sysimage-native-code=no -e 'true' &&
5555
pushd /tmp/julia/share/julia/test &&
5656
/tmp/julia/bin/julia --check-bounds=yes runtests.jl all --skip socket | bar -i 30 &&
57-
/tmp/julia/bin/julia --check-bounds=yes runtests.jl libgit2-online download pkg &&
57+
/tmp/julia/bin/julia --check-bounds=yes runtests.jl libgit2-online Pkg/pkg download &&
5858
popd &&
5959
mkdir /tmp/embedding-test &&
6060
make check -C /tmp/julia/share/doc/julia/examples/embedding \

.freebsdci.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ runtests(){
3636
export JULIA_TEST_MAXRSS_MB=600
3737
export JULIA_CPU_CORES=$MAKE_JOBS_NUMBER
3838

39-
gmake testall \
40-
test-download \
41-
test-pkg \
42-
test-libgit2-online
39+
./usr/bin/julia test/runtests.jl all
40+
./usr/bin/julia test/runtests.jl libgit2-online Pkg/pkg download
4341
}
4442

4543
test-embedding(){

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ script:
144144
- /tmp/julia/bin/julia -e 'versioninfo()'
145145
- pushd /tmp/julia/share/julia/test
146146
- /tmp/julia/bin/julia --check-bounds=yes runtests.jl $TESTSTORUN &&
147-
/tmp/julia/bin/julia --check-bounds=yes runtests.jl libgit2-online download pkg
147+
/tmp/julia/bin/julia --check-bounds=yes runtests.jl libgit2-online Pkg/pkg download
148148
- popd
149149
# test that the embedding code works on our installation
150150
- mkdir /tmp/embedding-test &&

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ test_script:
5555
- usr\bin\julia -e "versioninfo()"
5656
- usr\bin\julia --sysimage-native-code=no -e "true"
5757
- cd julia-* && .\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl all &&
58-
.\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl libgit2-online download pkg
58+
.\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl libgit2-online Pkg/pkg download
5959
- cd ..
6060
- usr\bin\julia usr\share\doc\julia\examples\embedding\embedding-test.jl examples\embedding\embedding.exe

base/exports.jl

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
export
44
# Modules
55
Meta,
6-
Pkg,
76
LibGit2,
87
StackTraces,
98
Sys,

base/initdefs.jl

-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ function init_load_path(BINDIR = Sys.BINDIR)
119119
load_path = get(ENV, "JULIA_LOAD_PATH", "@|@v#.#.#|@v#.#|@v#|@default|@!v#.#")
120120
append!(empty!(LOAD_PATH), parse_load_path(load_path))
121121
vers = "v$(VERSION.major).$(VERSION.minor)"
122-
push!(LOAD_PATH, Pkg.dir)
123122
push!(LOAD_PATH, abspath(BINDIR, "..", "local", "share", "julia", "site", vers))
124123
push!(LOAD_PATH, abspath(BINDIR, "..", "share", "julia", "site", vers))
125124
end

base/loading.jl

+1
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,7 @@ function create_expr_cache(input::String, output::String, concrete_deps::typeof(
10661066
try
10671067
write(in, """
10681068
begin
1069+
import Pkg
10691070
empty!(Base.LOAD_PATH)
10701071
append!(Base.LOAD_PATH, $(repr(LOAD_PATH, :module => nothing)))
10711072
empty!(Base.DEPOT_PATH)

base/precompile.jl

-2
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,6 @@ precompile(Tuple{typeof(Base.show_method_params), Base.GenericIOBuffer{Array{UIn
383383
precompile(Tuple{typeof(Base.print), Base.GenericIOBuffer{Array{UInt8, 1}}, String, Module})
384384
precompile(Tuple{typeof(Base.print), Base.GenericIOBuffer{Array{UInt8, 1}}, String, Symbol, String, Int32})
385385
precompile(Tuple{typeof(Base.reverseind), String, Int64})
386-
precompile(Tuple{typeof(Base.Pkg.Dir.path)})
387386
precompile(Tuple{typeof(Base.promote_type), Type{String}, Type{Union{}}})
388387
precompile(Tuple{typeof(Base.promote_type), Type{Any}, Type{String}})
389388
precompile(Tuple{typeof(Base.promote_rule), Type{Any}, Type{String}})
@@ -597,7 +596,6 @@ precompile(Tuple{typeof(Base.print), Base.GenericIOBuffer{Array{UInt8, 1}}, Stri
597596
precompile(Tuple{typeof(Base.print), Base.GenericIOBuffer{Array{UInt8, 1}}, DataType, Char})
598597
precompile(Tuple{typeof(Base.print), Base.GenericIOBuffer{Array{UInt8, 1}}, typeof(Type), Char})
599598
precompile(Tuple{typeof(Base.print), Base.GenericIOBuffer{Array{UInt8, 1}}, String, Module, String, Char})
600-
precompile(Tuple{typeof(Base.Pkg.dir), String, String})
601599
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Array{Base.Docs.DocStr, 1}, Symbol, Int64})
602600
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.Docs.Binding, Symbol, Int64})
603601
precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Type{Union{}}, Symbol, Int64})

base/reflection.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ Get the fully-qualified name of a module as a tuple of symbols. For example,
4848
4949
# Examples
5050
```jldoctest
51-
julia> fullname(Base.Pkg)
52-
(:Base, :Pkg)
51+
julia> fullname(Base.Iterators)
52+
(:Base, :Iterators)
5353
5454
julia> fullname(Main)
5555
(:Main,)

base/sysimg.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,6 @@ include("missing.jl")
443443
# libgit2 support
444444
include("libgit2/libgit2.jl")
445445

446-
# package manager
447-
include("pkg/pkg.jl")
448-
449446
# worker threads
450447
include("threadcall.jl")
451448

@@ -525,6 +522,7 @@ Base.require(Base, :SparseArrays)
525522
Base.require(Base, :SuiteSparse)
526523
Base.require(Base, :Test)
527524
Base.require(Base, :Unicode)
525+
Base.require(Base, :Pkg)
528526
Base.require(Base, :REPL)
529527
Base.require(Base, :Markdown)
530528

@@ -566,6 +564,8 @@ Base.require(Base, :Markdown)
566564
@deprecate_binding REPLCompletions root_module(Base, :REPL).REPLCompletions true ", use `REPL.REPLCompletions` instead"
567565
@deprecate_binding Terminals root_module(Base, :REPL).Terminals true ", use `REPL.Terminals` instead"
568566

567+
@deprecate_binding Pkg root_module(Base, :Pkg) true ", run `using Pkg` instead"
568+
569569
@eval @deprecate_binding $(Symbol("@doc_str")) getfield(root_module(Base, :Markdown), Symbol("@doc_str")) true ", use `Markdown` instead"
570570

571571
@deprecate_stdlib readdlm DelimitedFiles true

doc/make.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Install dependencies needed to build the documentation.
22
ENV["JULIA_PKGDIR"] = joinpath(@__DIR__, "deps")
3+
using Pkg
34
Pkg.init()
45
cp(joinpath(@__DIR__, "REQUIRE"), Pkg.dir("REQUIRE"); remove_destination = true)
56
Pkg.update()
@@ -101,7 +102,6 @@ const PAGES = [
101102
"base/io-network.md",
102103
"base/punctuation.md",
103104
"base/sort.md",
104-
"base/pkg.md",
105105
"base/iterators.md",
106106
"base/c.md",
107107
"base/libc.md",

doc/src/base/base.md

-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ Base.Iterators
7777
Base.LibGit2
7878
Base.Libc
7979
Base.Meta
80-
Base.Pkg
8180
Base.StackTraces
8281
Base.Sys
8382
Base.Threads

doc/src/manual/packages.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Julia has a built-in package manager for installing add-on functionality written in Julia. It
44
can also install external libraries using your operating system's standard system for doing so,
55
or by compiling from source. The list of registered Julia packages can be found at [http://pkg.julialang.org](http://pkg.julialang.org).
6-
All package manager commands are found in the `Pkg` module, included in Julia's `Base`
7-
install.
6+
All package manager commands are found in the `Pkg` standard library which becomes available after using
7+
`import Pkg`.
88

99
First we'll go over the mechanics of the `Pkg` family of commands and then we'll provide some
1010
guidance on how to get your package registered. Be sure to read the section below on package naming

stdlib/InteractiveUtils/src/InteractiveUtils.jl

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ using Base: unwrap_unionall, rewrap_unionall, isdeprecated, Bottom, show_expr_ty
1414
to_tuple_type, signature_type, format_bytes
1515

1616
using Markdown
17+
import Pkg
1718

1819
include("editless.jl")
1920
include("codeview.jl")

stdlib/Markdown/src/Markdown.jl

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Tools for working with the Markdown file format. Mainly for documentation.
55
"""
66
module Markdown
77

8+
import Pkg
89
import Base: show, ==, with_output_color
910

1011
include(joinpath("parse", "config.jl"))

doc/src/base/pkg.md stdlib/Pkg/docs/src/index.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@ package. See [PkgDev README](https://github.com/JuliaLang/PkgDev.jl/blob/master/
99
the documentation of those functions.
1010

1111
```@docs
12-
Base.Pkg.dir
13-
Base.Pkg.init
14-
Base.Pkg.resolve
15-
Base.Pkg.edit
16-
Base.Pkg.add
17-
Base.Pkg.rm
18-
Base.Pkg.clone
19-
Base.Pkg.setprotocol!
20-
Base.Pkg.available
21-
Base.Pkg.installed
22-
Base.Pkg.status
23-
Base.Pkg.update
24-
Base.Pkg.checkout
25-
Base.Pkg.pin
26-
Base.Pkg.free
27-
Base.Pkg.build
28-
Base.Pkg.test
29-
Base.Pkg.dependents
12+
Pkg.dir
13+
Pkg.init
14+
Pkg.resolve
15+
Pkg.edit
16+
Pkg.add
17+
Pkg.rm
18+
Pkg.clone
19+
Pkg.setprotocol!
20+
Pkg.available
21+
Pkg.installed
22+
Pkg.status
23+
Pkg.update
24+
Pkg.checkout
25+
Pkg.pin
26+
Pkg.free
27+
Pkg.build
28+
Pkg.test
29+
Pkg.dependents
3030
```

base/pkg/pkg.jl stdlib/Pkg/src/Pkg.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ init(meta::AbstractString=DEFAULT_META, branch::AbstractString=META_BRANCH) = Di
8686

8787
function __init__()
8888
vers = "v$(VERSION.major).$(VERSION.minor)"
89+
pushfirst!(Base.LOAD_PATH, dir)
8990
pushfirst!(Base.LOAD_CACHE_PATH, abspath(Dir._pkgroot(), "lib", vers))
9091
end
9192

@@ -288,7 +289,6 @@ Set the protocol used to access GitHub-hosted packages. Defaults to 'https', wit
288289
"""
289290
setprotocol!(proto::AbstractString) = Cache.setprotocol!(proto)
290291

291-
292292
# point users to PkgDev
293293
register(args...) =
294294
error("Pkg.register(pkg,[url]) has been moved to the package PkgDev.jl.\n",

base/pkg/cache.jl stdlib/Pkg/src/cache.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
module Cache
44

5-
import ...LibGit2, ..Dir, ...Pkg.PkgError
5+
import Pkg
6+
import ...LibGit2, ..Dir, ..PkgError
67
using ..Types
78

89
rewrite_url_to = "https"

base/pkg/dir.jl stdlib/Pkg/src/dir.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
module Dir
44

5-
import ..Pkg: DEFAULT_META, META_BRANCH, PkgError
5+
import Pkg
6+
import ..DEFAULT_META, ..META_BRANCH, ..PkgError
67
import ...LibGit2, ...LibGit2.with
7-
88
const DIR_NAME = ".julia"
99

1010
_pkgroot() = abspath(get(ENV,"JULIA_PKGDIR",joinpath(homedir(),DIR_NAME)))

base/pkg/entry.jl stdlib/Pkg/src/entry.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
module Entry
44

55
import Base: thispatch, nextpatch, nextminor, nextmajor, check_new_version
6+
import Pkg
67
import ..Reqs, ..Read, ..Query, ..Resolve, ..Cache, ..Write, ..Dir
78
using ...LibGit2
8-
import ...Pkg.PkgError
9+
import ..PkgError
910
using ..Types
1011
using Base.Printf: @printf
1112

@@ -582,6 +583,7 @@ function build(pkg::AbstractString, build_file::AbstractString, errfile::Abstrac
582583
# To isolate the build from the running Julia process, we execute each build.jl file in
583584
# a separate process. Errors are written to errfile for later reporting.
584585
code = """
586+
import Pkg
585587
empty!(Base.LOAD_PATH)
586588
append!(Base.LOAD_PATH, $(repr(LOAD_PATH, :module => nothing)))
587589
empty!(Base.DEPOT_PATH)

base/pkg/query.jl stdlib/Pkg/src/query.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
module Query
44

5-
import ...Pkg.PkgError
5+
import Pkg
6+
import ..PkgError
67
using ..Types
78

89
function init_resolve_backtrace(reqs::Requires, fix::Dict{String,Fixed} = Dict{String,Fixed}())

base/pkg/read.jl stdlib/Pkg/src/read.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
module Read
44

5-
import ...LibGit2, ..Cache, ..Reqs, ...Pkg.PkgError, ..Dir
5+
import Pkg
6+
import ...LibGit2, ..Cache, ..Reqs, ..PkgError, ..Dir
67
using ..Types
78

89
readstrip(path...) = strip(read(joinpath(path...), String))

base/pkg/reqs.jl stdlib/Pkg/src/reqs.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
module Reqs
44

55
import Base: ==
6-
import ...Pkg.PkgError
6+
import Pkg
7+
import ..PkgError
78
using ..Types
89

910
# representing lines of REQUIRE files

base/pkg/resolve.jl stdlib/Pkg/src/resolve.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
module Resolve
44

5+
import Pkg
6+
57
include(joinpath("resolve", "versionweight.jl"))
68
include(joinpath("resolve", "interface.jl"))
79
include(joinpath("resolve", "maxsum.jl"))
810

911
using ..Types, ..Query, .PkgToMaxSumInterface, .MaxSum
10-
import ...Pkg.PkgError
12+
import ..PkgError
1113

1214
export resolve, sanity_check
1315

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

base/pkg/types.jl stdlib/Pkg/src/types.jl

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
module Types
44

5+
import Pkg
6+
57
export VersionInterval, VersionSet, Requires, Available, Fixed, merge_requires!, satisfies,
68
ResolveBacktraceItem, ResolveBacktrace
79
import Base: show, isempty, in, intersect, union!, union, ==, hash, copy, deepcopy_internal, push!

base/pkg/write.jl stdlib/Pkg/src/write.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
module Write
44

5-
import ..Cache, ..Read, ...Pkg.PkgError
5+
import Pkg
6+
import ..Cache, ..Read, ..PkgError
67
using ...LibGit2
78

89
function prefetch(pkg::AbstractString, sha1::AbstractString)

0 commit comments

Comments
 (0)