So obviously before you can update your package to be compatible with julia 0.7,
you need to update any of your dependencies to julia 0.7
I have put together a script
which recursively runs Pkg.test
on the specified package and then (if it fails) on its dependencies.
And produces a report.
using Pkg
const _tested = Dict{String, Bool}()
function passing_all_tests(pkgname)
get!(_tested, pkgname) do
try
Pkg.add(pkgname)
Pkg.test(pkgname)
return true
catch
return false
end
end
end
function get_deps(pkgname)
pkg_dir = Pkg.dir(pkgname)
@show (pkgname, pkg_dir)
reqfile = joinpath(pkg_dir, "REQUIRE")
if !isfile(reqfile)
# anything without a REQUIRE file is not going to be a problem anyway.
#This mostly occurs if you are testing something in stdlib
return String[]
end
deps = String[]
for line in eachline(reqfile)
(strip(line)=="" || line[1]=='#' || line[1]=='@') && continue
#^ Skip comments and things like @osx
pkg_name = split(line)[1]
pkg_name == "julia" && continue
push!(deps, pkg_name)
end
deps
end
function check(pkgname, final_output=stdout, depth=0)
if !passing_all_tests(pkgname)
println(final_output, "\t"^depth * pkgname)
# don't both checking dependencies of things that pass
# Can not use the below with an asyncmap, or it gets weird
for depname in get_deps(pkgname)
check(depname, final_output, depth+1)
end
end
end
function deptree_report(pkgname)
final_output = IOBuffer()
println(final_output)
println(final_output, "-"^70)
println(final_output, "Failing Dependency Tree for " * pkgname)
println(final_output, "-"^70)
check(pkgname, final_output)
println(final_output, "-"^70)
println(String(take!(final_output)))
end
Copy and paste it into your repo and call it via: deptree_report("MyPackage")
.
it will dump out a huge pile of text from all the tests it is calling.
Then at the end it will print out a report.
Any package named in that report is failing its tests on your system.
That might be its own fault, or it might be the fault of its dependencies (esp) if they are listed after. Or both.
(Also failing locally doesn’t nesc mean it is broken on 0.7 for everyone; in the examples below SHA is failing on my computer because of a file-permission error due to where it is installed.)
Also running it for many packages you want to test, one after the other is good,
as it caches test results, so you can avoid rerunning tests.
(Conversely test results won’t updated without a restart/clearing the global _tested
Dict)
Note this script it will explicitly install all your package’s dependencies, you can probably run it in a throw-away environment if you want.
Also this can take a while, and you might want to turn off depwarn.
Here are some example outputs:
MacroTools
Everything is fine.
julia> deptree_report("MacroTools")
...
----------------------------------------------------------------------
Failing Dependency Tree for MacroTools
----------------------------------------------------------------------
----------------------------------------------------------------------
Flux
----------------------------------------------------------------------
Failing Dependency Tree for Flux
----------------------------------------------------------------------
Flux
DataFlow
Requires
Adapt
GZip
Colors
ColorTypes
FixedPointNumbers
FixedPointNumbers
ZipFile
AbstractTrees
----------------------------------------------------------------------
TensorFlow
Failing Dependency Tree for TensorFlow
----------------------------------------------------------------------
TensorFlow
ProtoBuf
PyCall
Conda
BinDeps
URIParser
SHA
TakingBroadcastSeriously
Conda
BinDeps
URIParser
SHA
Distributions
StatsFuns
Rmath
BinDeps
URIParser
SHA
StatsFuns
Rmath
BinDeps
URIParser
SHA
JLD
HDF5
BinDeps
URIParser
SHA
Blosc
BinaryProvider
SHA
CMakeWrapper
BinDeps
URIParser
SHA
FileIO
LegacyStrings
FileIO
MNIST
----------------------------------------------------------------------