Skip to content

Commit

Permalink
Merge #1230
Browse files Browse the repository at this point in the history
1230: Backports for 1.2.0-rc3 r=fredrikekre a=fredrikekre



Co-authored-by: Fredrik Ekre <[email protected]>
Co-authored-by: Curtis Vogt <[email protected]>
  • Loading branch information
3 people committed Jul 3, 2019
2 parents 8e050a9 + 4fd61d3 commit 394e7c5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
6 changes: 6 additions & 0 deletions docs/src/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,14 @@ For example:
PkgA = "~1.2.3" # [1.2.3, 1.3.0)
PkgB = "~1.2" # [1.2.0, 1.3.0)
PkgC = "~1" # [1.0.0, 2.0.0)
PkgD = "~0.2.3" # [0.2.3, 0.3.0)
PkgE = "~0.0.3" # [0.0.3, 0.0.4)
PkgF = "~0.0" # [0.0.0, 0.1.0)
PkgG = "~0" # [0.0.0, 1.0.0)
```

For all versions with a major version of 0 the tilde and caret specifiers are equivalent.

### Inequality specifiers

Inequalities can also be used to specify version ranges:
Expand Down
12 changes: 12 additions & 0 deletions docs/src/creating-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ test-specific dependencies, are available, see below.
This section only applies to Julia 1.2 and above. For specifying test dependencies
on previous Julia versions, see [Test-specific dependencies in Julia 1.0 and 1.1](@ref).

!!! note
The exact interaction between `Project.toml`, `test/Project.toml` and their corresponding
`Manifest.toml`s are not fully worked out, and may be subject to change in future versions.
The old method of adding test-specific dependencies, described in the next section, will
therefore be supported throughout all Julia 1.X releases.

In Julia 1.2 and later the test environment is given by `test/Project.toml`. Thus, when running
tests, this will be the active project, and only dependencies to the `test/Project.toml` project
can be used. Note that Pkg will add the tested package itself implictly.
Expand Down Expand Up @@ -218,6 +224,12 @@ using Test

#### Test-specific dependencies in Julia 1.0 and 1.1

!!! note
The method of adding test-specific dependencies described in this section will
be replaced by the method from the previous section in future Julia versions.
The method in this section will, however, be supported throughout all Julia 1.X
releases.

In Julia 1.0 and Julia 1.1 test-specific dependencies are added to the main
`Project.toml`. To add `Markdown` and `Test` as test-dependencies, add the following:

Expand Down
2 changes: 1 addition & 1 deletion src/API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ function gc(ctx::Context=Context(); kwargs...)
if isdir(joinpath(packagedir, name))
for slug in readdir(joinpath(packagedir, name))
versiondir = joinpath(packagedir, name, slug)
if !(versiondir in paths_to_keep)
if !(versiondir in paths_to_keep) && isdir(versiondir)
push!(paths_to_delete, versiondir)
end
end
Expand Down
7 changes: 4 additions & 3 deletions test/pkg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,8 @@ temp_pkg_dir() do project_path
@test isinstalled(TEST_PKG)
Pkg.rm(TEST_PKG.name)
@test !isinstalled(TEST_PKG)
# https://github.com/JuliaLang/Pkg.jl/issues/601
pkgdir = joinpath(Pkg.depots1(), "packages")
touch(joinpath(pkgdir, ".DS_Store"))
Pkg.gc()
rm(joinpath(pkgdir, ".DS_Store"))
@test isempty(readdir(pkgdir))
end

Expand Down Expand Up @@ -629,6 +626,10 @@ end
with_temp_env() do
Pkg.add("Example")
Pkg.gc()
# issue #601 and #1228
touch(joinpath(Pkg.depots1(), "packages", ".DS_Store"))
touch(joinpath(Pkg.depots1(), "packages", "Example", ".DS_Store"))
Pkg.gc()
end
end
end
Expand Down

0 comments on commit 394e7c5

Please sign in to comment.