Skip to content

Commit

Permalink
Merge pull request #26141 from JuliaLang/kc/pkg3_stdlib
Browse files Browse the repository at this point in the history
Pkg3 stdlib
  • Loading branch information
StefanKarpinski authored Feb 23, 2018
2 parents f4d82b2 + 41ce00e commit cca1261
Show file tree
Hide file tree
Showing 57 changed files with 46,339 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
/tmp/julia/bin/julia-debug --sysimage-native-code=no -e 'true' &&
pushd /tmp/julia/share/julia/test &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl all --skip socket | bar -i 30 &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl LibGit2/online Pkg/pkg download &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl LibGit2/online Pkg/pkg Pkg3/pkg download &&
popd &&
mkdir /tmp/embedding-test &&
make check -C /tmp/julia/share/julia/test/embedding \
Expand Down
2 changes: 1 addition & 1 deletion .freebsdci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ runtests(){
export JULIA_CPU_CORES=$MAKE_JOBS_NUMBER

./usr/bin/julia test/runtests.jl all
./usr/bin/julia test/runtests.jl LibGit2/online Pkg/pkg download
./usr/bin/julia test/runtests.jl LibGit2/online Pkg/pkg Pkg3/pkg download
}

test-embedding(){
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ script:
- /tmp/julia/bin/julia -e 'versioninfo()'
- pushd /tmp/julia/share/julia/test
- /tmp/julia/bin/julia --check-bounds=yes runtests.jl $TESTSTORUN &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl LibGit2/online Pkg/pkg download
/tmp/julia/bin/julia --check-bounds=yes runtests.jl LibGit2/online Pkg/pkg Pkg3/pkg download
- popd
# test that the embedding code works on our installation
- mkdir /tmp/embedding-test &&
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ test_script:
- usr\bin\julia -e "versioninfo()"
- usr\bin\julia --sysimage-native-code=no -e "true"
- cd julia-* && .\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl all &&
.\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl LibGit2/online Pkg/pkg download
.\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl LibGit2/online Pkg/pkg Pkg3/pkg download
- cd ..
- usr\bin\julia usr\share\julia\test\embedding\embedding-test.jl test\embedding\embedding.exe
1 change: 1 addition & 0 deletions base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ let
:Distributed,
:Test,
:REPL,
:Pkg3,
]

maxlen = maximum(textwidth.(string.(stdlibs)))
Expand Down
1 change: 1 addition & 0 deletions stdlib/Pkg3/.codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
comment: false
4 changes: 4 additions & 0 deletions stdlib/Pkg3/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/tmp
*.jl.mem
*.jl.cov
*.jl.*.cov
22 changes: 22 additions & 0 deletions stdlib/Pkg3/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: julia

julia:
- nightly

os:
- linux
- osx

notifications:
email: false

before_script:
- export PATH=$HOME/.local/bin:$PATH

script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia --check-bounds=yes -e 'Pkg.clone(pwd()); Pkg.build("Pkg3"); Pkg.test("Pkg3"; coverage=true)'

after_success:
- julia -e 'cd(Pkg.dir("Pkg3")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'

36 changes: 36 additions & 0 deletions stdlib/Pkg3/Compat.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[123] # this name doesn't matter, just needs to be unique
url = "http://github.com/PkgA/issues/123"
desc = "PkgA accidentally changed its `foo` API and broke PkgB"

# The name/uuid mapping of a package is recorded when a compatibility entry
# is created. This is only used to decode the package names below and does
# not need to match the name used in Config.toml or Manifest.toml, nor do
# they need to be updated later if those change for any reason. They may be
# updated, however, for clarity.

[123.uuids]
PkgA = "uuid#1"
PkgB = "uuid#2"

# A key-value pair in a broken/fixed stanza is satisfied if the named package
# on the LHS is checked out at a commit that is a descendant of the commit on
# the RHS. A broken/fixed stanza is satisfied if all of its key-value pairs
# are satisfied. If the value of "broken" or "fixed" is a single stanza (i.e.
# a dict) then it is satisfied if that stanza is. If a "broken" or "fixed"
# entry is an array, then it is satisfied if any of its stanzas are satisfied.
# A set of package versions is considered "broken" if the "broken" entry is
# satisfied but the "fixed" entry is not satisfied.

[123.broken]
PkgA = "commit#1"
PkgB = "commit#2"

[[123.fixed]]
PkgA = "commit#5"
PkgB = "commit#6"

[[123.fixed]]
PkgA = "commit#3"

[[123.fixed]]
PkgB = "commit#4"
47 changes: 47 additions & 0 deletions stdlib/Pkg3/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
The Pkg3.jl package is licensed under the MIT "Expat" License:

> Copyright (c) 2017: Stefan Karpinski.
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in all
> copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.
>
The file PlatformEngines.jl is under the following license:

The BinaryProvider.jl package is licensed under the MIT "Expat" License:

> Copyright (c) 2017: SimonDanisch.
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in all
> copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> SOFTWARE.
>
15 changes: 15 additions & 0 deletions stdlib/Pkg3/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
desc = "The next-generation Julia package manager."
keywords = ["package", "management"]
license = "MIT"
name = "Pkg3"
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
67 changes: 67 additions & 0 deletions stdlib/Pkg3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Pkg3

[![Build Status](https://travis-ci.org/JuliaLang/Pkg3.jl.svg?branch=master)](https://travis-ci.org/JuliaLang/Pkg3.jl) [![Build status](https://ci.appveyor.com/api/projects/status/ywiwk98gvye1ov6x/branch/master?svg=true)](https://ci.appveyor.com/project/KristofferC/pkg3-jl-li0m6/branch/master) [![codecov](https://codecov.io/gh/JuliaLang/Pkg3.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaLang/Pkg3.jl)

Next-generation package manager for Julia. Still quite alpha. The last commit that works on 0.6 is [4bd137919](https://github.com/JuliaLang/Pkg3.jl/commit/4bd1379195ce10056c26fb689f732907dd4f09fa).

To install, `Pkg.clone` the `Pkg3` repo itself:

```jl
Pkg.clone("https://github.com/JuliaLang/Pkg3.jl.git")
```

Packages are installed under `joinpath(homedir(), ".julia", "packages")`, so they won't influence the packages that you already have installed.

```jl
$ julia

julia> using Pkg3
```

This gives you a `pkg> ` REPL mode, activated by the `]` key. Currently, this supports thee operations: `add`, `rm` and `up`:

```jl
pkg> add JSON
INFO: Resolving package versions
INFO: Cloning [682c06a0-de6a-54ab-a142-c8b1cf79cde6] JSON
INFO: Installing JSON v0.13.0 [9003b4622ec7e553]
INFO: Updating project file /Users/stefan/projects/julia/Project.toml
INFO: [+] JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
INFO: Updating manifest file /Users/stefan/projects/julia/Manifest.toml
INFO: [34da2185] + Compat v0.31.0
INFO: [682c06a0] + JSON v0.13.0

pkg> add Compat @0.28
INFO: Resolving package versions
INFO: Installing Compat v0.28.0 [0427af7e2c8610c8]
INFO: Updating project file /Users/stefan/projects/julia/Project.toml
INFO: [+] Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
INFO: Updating manifest file /Users/stefan/projects/julia/Manifest.toml
INFO: [34da2185] Compat v0.31.0 v0.28.0

pkg> rm Compat
INFO: Updating project file /Users/stefan/projects/julia/Project.toml
INFO: [-] Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
INFO: [-] JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
INFO: Updating manifest file /Users/stefan/projects/julia/Manifest.toml
INFO: [34da2185] - Compat v0.28.0
INFO: [682c06a0] - JSON v0.13.0

pkg> add JSON @0.10
INFO: Resolving package versions
INFO: Installing JSON v0.10.0 [77699b5cc09b169c]
INFO: Updating project file /Users/stefan/projects/julia/Project.toml
INFO: [+] JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
INFO: Updating manifest file /Users/stefan/projects/julia/Manifest.toml
INFO: [34da2185] + Compat v0.31.0
INFO: [682c06a0] + JSON v0.10.0

pkg> up
INFO: Resolving package versions
INFO: Updating project file /Users/stefan/projects/julia/Project.toml
INFO: [no changes]
INFO: Updating manifest file /Users/stefan/projects/julia/Manifest.toml
INFO: [682c06a0] JSON v0.10.0 v0.13.0
```

Package operations create a `Project.toml` file that record what dependencies your project (or named global environment) has – i.e. what you've explicitly added. It also creates a `Manifest.toml` file that records the exact versions of each of those dependenices and their transitive dependencies – and the graph between them. You can load top-level dependencies via the usual `using JSON` or `import JSON` constructs in the REPL or in Julia scripts.
1 change: 1 addition & 0 deletions stdlib/Pkg3/REQUIRE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
julia 0.7-
39 changes: 39 additions & 0 deletions stdlib/Pkg3/appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
environment:
matrix:
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"

branches:
only:
- master
- /release-.*/

notifications:
- provider: Email
on_build_success: false
on_build_failure: false
on_build_status_changed: false

install:
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
# If there's a newer build queued for the same PR, cancel this one
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
# Download most recent Julia Windows binary
- ps: (new-object net.webclient).DownloadFile(
$env:JULIA_URL,
"C:\projects\julia-binary.exe")
# Run installer silently, output to C:\projects\julia
- C:\projects\julia-binary.exe /S /D=C:\projects\julia

build_script:
# Need to convert from shallow to complete for Pkg.clone to work
- IF EXIST .git\shallow (git fetch --unshallow)
- C:\projects\julia\bin\julia -e "versioninfo();
Pkg.clone(pwd(), \"Pkg3\"); Pkg.build(\"Pkg3\")"

test_script:
- C:\projects\julia\bin\julia -e "Pkg.test(\"Pkg3\")"

1 change: 1 addition & 0 deletions stdlib/Pkg3/bin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
stdlib.toml.old
Loading

0 comments on commit cca1261

Please sign in to comment.