Skip to content

Commit efc4a3a

Browse files
authored
Merge pull request #328 from JuliaIO/tk/drop0.3
Drop Julia 0.3 support
2 parents a149697 + 70d6c6d commit efc4a3a

File tree

7 files changed

+53
-79
lines changed

7 files changed

+53
-79
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ os:
33
- linux
44
- osx
55
julia:
6-
- 0.3
76
- 0.4
87
- 0.5
98
- nightly

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
julia 0.3.4
1+
julia 0.4
22
BinDeps
33
Blosc
44
Compat 0.8.0

appveyor.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
environment:
22
matrix:
3-
- JULIAVERSION: "julialang/bin/winnt/x86/0.3/julia-0.3-latest-win32.exe"
4-
- JULIAVERSION: "julialang/bin/winnt/x64/0.3/julia-0.3-latest-win64.exe"
53
- JULIAVERSION: "julialang/bin/winnt/x86/0.4/julia-0.4-latest-win32.exe"
64
- JULIAVERSION: "julialang/bin/winnt/x64/0.4/julia-0.4-latest-win64.exe"
75
- JULIAVERSION: "julialang/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe"

src/HDF5.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
VERSION >= v"0.4.0-dev+6521" && __precompile__()
1+
__precompile__()
22

33
include("plain.jl")

src/datafile.jl

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,11 @@ read(f::Base.Callable, parent::DataFile, name::String...) =
3838
f(read(parent, name...)...)
3939

4040
# Read every variable in the file
41-
if VERSION < v"0.4.0-dev+980"
42-
function read(f::DataFile)
43-
vars = names(f)
44-
vals = Array(Any, length(vars))
45-
for i = 1:length(vars)
46-
vals[i] = read(f, vars[i])
47-
end
48-
Dict(vars, vals)
49-
end
50-
else
51-
function read(f::DataFile)
52-
vars = names(f)
53-
vals = Array(Any, length(vars))
54-
for i = 1:length(vars)
55-
vals[i] = read(f, vars[i])
56-
end
57-
Dict(zip(vars, vals))
41+
function read(f::DataFile)
42+
vars = names(f)
43+
vals = Array(Any, length(vars))
44+
for i = 1:length(vars)
45+
vals[i] = read(f, vars[i])
5846
end
47+
Dict(zip(vars, vals))
5948
end

src/plain.jl

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -606,19 +606,17 @@ function h5open(f::Function, args...)
606606
end
607607
end
608608

609-
if VERSION >= v"0.4"
610-
function h5rewrite(f::Function, filename::AbstractString, args...)
611-
tmppath,tmpio = mktemp(dirname(filename))
612-
close(tmpio)
609+
function h5rewrite(f::Function, filename::AbstractString, args...)
610+
tmppath,tmpio = mktemp(dirname(filename))
611+
close(tmpio)
613612

614-
try
615-
val = h5open(f, tmppath, "w", args...)
616-
Compat.Filesystem.rename(tmppath, filename)
617-
return val
618-
catch
619-
Compat.Filesystem.unlink(tmppath)
620-
rethrow()
621-
end
613+
try
614+
val = h5open(f, tmppath, "w", args...)
615+
Compat.Filesystem.rename(tmppath, filename)
616+
return val
617+
catch
618+
Compat.Filesystem.unlink(tmppath)
619+
rethrow()
622620
end
623621
end
624622

@@ -1883,10 +1881,6 @@ function h5d_write{T<:HDF5BitsKind}(dataset_id::Hid, memtype_id::Hid, x::T)
18831881
tmp[1] = x
18841882
h5d_write(dataset_id, memtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)
18851883
end
1886-
if VERSION < v"0.4.0"
1887-
# Restricted version on 0.3 for the use in `h5d_write` below.
1888-
isassigned(ary, i) = isdefined(ary, i)
1889-
end
18901884
function h5d_write{S<:String}(dataset_id::Hid, memtype_id::Hid, strs::Array{S})
18911885
len = length(strs)
18921886
p = Array(Ptr{UInt8}, size(strs))
@@ -2375,11 +2369,7 @@ export
23752369
@write
23762370

23772371
# Define globally because JLD uses this, too
2378-
if VERSION < v"0.4.0-dev+2014"
2379-
const rehash! = Base.rehash
2380-
else
2381-
const rehash! = Base.rehash!
2382-
end
2372+
const rehash! = Base.rehash!
23832373

23842374
# Across initializations of the library, the id of various properties
23852375
# will change. So don't hard-code the id (important for precompilation)

test/plain.jl

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -251,49 +251,47 @@ close(g)
251251
close(fid)
252252

253253
# more do syntax: atomic rename version
254-
if VERSION >= v"0.4"
255-
tmpdir = mktempdir()
256-
outfile = joinpath(tmpdir, "test.h5")
254+
tmpdir = mktempdir()
255+
outfile = joinpath(tmpdir, "test.h5")
257256

258-
# create a new file
259-
h5rewrite(outfile) do fid
260-
g_create(fid, "mygroup") do g
261-
write(g, "x", 3.3)
262-
end
263-
end
264-
@test length(readdir(tmpdir)) == 1
265-
h5open(outfile, "r") do fid
266-
@test names(fid) == Compat.ASCIIString["mygroup"]
267-
@test names(fid["mygroup"]) == Compat.ASCIIString["x"]
257+
# create a new file
258+
h5rewrite(outfile) do fid
259+
g_create(fid, "mygroup") do g
260+
write(g, "x", 3.3)
268261
end
262+
end
263+
@test length(readdir(tmpdir)) == 1
264+
h5open(outfile, "r") do fid
265+
@test names(fid) == Compat.ASCIIString["mygroup"]
266+
@test names(fid["mygroup"]) == Compat.ASCIIString["x"]
267+
end
269268

270-
# fail to overwrite
271-
@test_throws ErrorException h5rewrite(outfile) do fid
272-
g_create(fid, "mygroup") do g
273-
write(g, "oops", 3.3)
274-
end
275-
error("failed")
276-
end
277-
@test length(readdir(tmpdir)) == 1
278-
h5open(outfile, "r") do fid
279-
@test names(fid) == Compat.ASCIIString["mygroup"]
280-
@test names(fid["mygroup"]) == Compat.ASCIIString["x"]
269+
# fail to overwrite
270+
@test_throws ErrorException h5rewrite(outfile) do fid
271+
g_create(fid, "mygroup") do g
272+
write(g, "oops", 3.3)
281273
end
274+
error("failed")
275+
end
276+
@test length(readdir(tmpdir)) == 1
277+
h5open(outfile, "r") do fid
278+
@test names(fid) == Compat.ASCIIString["mygroup"]
279+
@test names(fid["mygroup"]) == Compat.ASCIIString["x"]
280+
end
282281

283-
# overwrite
284-
h5rewrite(outfile) do fid
285-
g_create(fid, "mygroup") do g
286-
write(g, "y", 3.3)
287-
end
288-
end
289-
@test length(readdir(tmpdir)) == 1
290-
h5open(outfile, "r") do fid
291-
@test names(fid) == Compat.ASCIIString["mygroup"]
292-
@test names(fid["mygroup"]) == Compat.ASCIIString["y"]
282+
# overwrite
283+
h5rewrite(outfile) do fid
284+
g_create(fid, "mygroup") do g
285+
write(g, "y", 3.3)
293286
end
294-
295-
rm(tmpdir, recursive=true)
296287
end
288+
@test length(readdir(tmpdir)) == 1
289+
h5open(outfile, "r") do fid
290+
@test names(fid) == Compat.ASCIIString["mygroup"]
291+
@test names(fid["mygroup"]) == Compat.ASCIIString["y"]
292+
end
293+
294+
rm(tmpdir, recursive=true)
297295

298296
d = h5read(joinpath(test_path, "compound.h5"), "/data")
299297
@assert typeof(d) == HDF5.HDF5Compound

0 commit comments

Comments
 (0)