@@ -14,8 +14,13 @@ get_deps(manifest, pkg) = get_deps!(String[], manifest, pkg)
14
14
Push dependencies for `pkg` found in `manifest` into `deps`.
15
15
"""
16
16
function get_deps! (deps, manifest, pkg)
17
- if haskey (manifest[pkg][1 ], " deps" )
18
- for dep in manifest[pkg][1 ][" deps" ]
17
+ if VERSION >= v " 1.7.0-beta3"
18
+ manifest_dict = manifest[" deps" ]
19
+ else
20
+ manifest_dict = manifest
21
+ end
22
+ if haskey (manifest_dict[pkg][1 ], " deps" )
23
+ for dep in manifest_dict[pkg][1 ][" deps" ]
19
24
if ! (dep in deps)
20
25
push! (deps, dep)
21
26
get_deps! (deps, manifest, dep)
@@ -37,7 +42,12 @@ function get_manifest()
37
42
manifest_path = replace (path, " Project.toml" => " Manifest.toml" )
38
43
if isfile (manifest_path)
39
44
manifest = Pkg. TOML. parsefile (manifest_path)
40
- haskey (manifest, " TestReports" ) && return manifest
45
+ if VERSION >= v " 1.7.0-beta3"
46
+ ! haskey (manifest, " deps" ) && continue
47
+ haskey (manifest[" deps" ], " TestReports" ) && return manifest
48
+ else
49
+ haskey (manifest, " TestReports" ) && return manifest
50
+ end
41
51
end
42
52
end
43
53
@@ -55,14 +65,26 @@ from the parsed `manifest` provided.
55
65
function make_testreports_environment (manifest)
56
66
all_deps = get_deps (manifest, " TestReports" )
57
67
push! (all_deps, " TestReports" )
58
- new_manifest = Dict (pkg => manifest[pkg] for pkg in all_deps)
59
-
60
- new_project = Dict (
61
- " deps" => Dict (
62
- " Test" => new_manifest[" Test" ][1 ][" uuid" ],
63
- " TestReports" => new_manifest[" TestReports" ][1 ][" uuid" ]
68
+ if VERSION >= v " 1.7.0-beta3"
69
+ new_manifest = Dict {String, Any} ()
70
+ new_manifest[" deps" ] = Dict (pkg => manifest[" deps" ][pkg] for pkg in all_deps)
71
+ new_manifest[" julia_version" ] = manifest[" julia_version" ]
72
+ new_manifest[" manifest_format" ] = manifest[" manifest_format" ]
73
+ new_project = Dict (
74
+ " deps" => Dict (
75
+ " Test" => new_manifest[" deps" ][" Test" ][1 ][" uuid" ],
76
+ " TestReports" => new_manifest[" deps" ][" TestReports" ][1 ][" uuid" ]
77
+ )
64
78
)
65
- )
79
+ else
80
+ new_manifest = Dict (pkg => manifest[pkg] for pkg in all_deps)
81
+ new_project = Dict (
82
+ " deps" => Dict (
83
+ " Test" => new_manifest[" Test" ][1 ][" uuid" ],
84
+ " TestReports" => new_manifest[" TestReports" ][1 ][" uuid" ]
85
+ )
86
+ )
87
+ end
66
88
testreportsenv = mktempdir ()
67
89
open (joinpath (testreportsenv, " Project.toml" ), " w" ) do io
68
90
Pkg. TOML. print (io, new_project)
@@ -163,16 +185,21 @@ is of type `Pkg.Types.Context`. For earlier versions, they are of type
163
185
`Pkg.Types.EnvCache`.
164
186
"""
165
187
function isinstalled! (ctx:: Context , pkgspec:: Pkg.Types.PackageSpec )
166
- @static if VERSION >= v " 1.4.0 "
188
+ @static if v " 1.4.0 " <= VERSION < v " 1.7.0-beta3 "
167
189
var = ctx
168
190
else
169
191
var = ctx. env
170
192
end
193
+ @static if VERSION >= v " 1.7.0-beta3"
194
+ manifest_var = ctx. env. manifest
195
+ else
196
+ manifest_var = var
197
+ end
171
198
project_resolve! (var, [pkgspec])
172
199
project_deps_resolve! (var, [pkgspec])
173
- manifest_resolve! (var , [pkgspec])
200
+ manifest_resolve! (manifest_var , [pkgspec])
174
201
try
175
- ensure_resolved (var , [pkgspec])
202
+ ensure_resolved (manifest_var , [pkgspec])
176
203
catch
177
204
return false
178
205
end
@@ -186,7 +213,23 @@ Gets the testfile path of the package. Code for each Julia version mirrors that
186
213
in `Pkg/src/Operations.jl`.
187
214
"""
188
215
function gettestfilepath (ctx:: Context , pkgspec:: Pkg.Types.PackageSpec )
189
- @static if VERSION >= v " 1.4.0"
216
+ @static if VERSION >= v " 1.7.0-beta3"
217
+ if is_project_uuid (ctx. env, pkgspec. uuid)
218
+ pkgspec. path = dirname (ctx. env. project_file)
219
+ pkgspec. version = ctx. env. pkg. version
220
+ else
221
+ entry = manifest_info (ctx. env. manifest, pkgspec. uuid)
222
+ pkgspec. version = entry. version
223
+ pkgspec. tree_hash = entry. tree_hash
224
+ pkgspec. repo = entry. repo
225
+ pkgspec. path = entry. path
226
+ pkgspec. pinned = entry. pinned
227
+ if isnothing (pkgspec. path)
228
+ pkgspec. path = source_path (ctx. env. project_file, pkgspec, ctx. julia_version)
229
+ end
230
+ end
231
+ pkgfilepath = source_path (ctx. env. project_file, pkgspec, ctx. julia_version)
232
+ elseif VERSION >= v " 1.4.0"
190
233
if is_project_uuid (ctx, pkgspec. uuid)
191
234
pkgspec. path = dirname (ctx. env. project_file)
192
235
pkgspec. version = ctx. env. pkg. version
@@ -328,7 +371,12 @@ function test!(pkg::AbstractString,
328
371
pkgspec,
329
372
pkgspec. path,
330
373
joinpath (pkgspec. path, " test" ))
331
- if VERSION >= v " 1.4.0"
374
+ if VERSION >= v " 1.7.0-beta3"
375
+ test_project_override = test_folder_has_project_file ?
376
+ nothing :
377
+ gen_target_project (ctx. env, ctx. registries, pkgspec, pkgspec. path, " test" )
378
+ sandbox_args = (sandbox_args... , test_project_override)
379
+ elseif VERSION >= v " 1.4.0"
332
380
test_project_override = test_folder_has_project_file ?
333
381
nothing :
334
382
gen_target_project (ctx, pkgspec, pkgspec. path, " test" )
0 commit comments