From 41ccaf19e1c98d6e680f0a999ce1b8fca8358313 Mon Sep 17 00:00:00 2001 From: Tony Kelman Date: Sat, 30 Jul 2016 17:27:09 -0400 Subject: [PATCH 1/3] Use dirname(@__FILE__) instead of Pkg.dir Add testing against 0.5 to Travis this runs the most recent release candidate now, release once final tags are done add Compat to REQUIRE and Distributions to test/REQUIRE instead of assuming they will be present as indirect dependencies --- .travis.yml | 5 +++-- REQUIRE | 1 + src/blink_integration.jl | 2 +- src/render.jl | 2 +- test/REQUIRE | 1 + test/runtests.jl | 16 ++++++++-------- 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index d23e7b9..4d901b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,10 @@ os: notifications: email: false julia: - - release + - 0.4 + - 0.5 - nightly before_install: - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi script: - - julia -e 'Pkg.init(); Pkg.add("RDatasets"); Pkg.clone(pwd()); Pkg.test("Vega")' \ No newline at end of file + - julia -e 'Pkg.init(); Pkg.add("RDatasets"); Pkg.clone(pwd()); Pkg.test("Vega")' diff --git a/REQUIRE b/REQUIRE index 93493ee..c768bc3 100644 --- a/REQUIRE +++ b/REQUIRE @@ -4,3 +4,4 @@ ColorBrewer KernelDensity NoveltyColors Patchwork +Compat diff --git a/src/blink_integration.jl b/src/blink_integration.jl index bf4a412..7bff939 100644 --- a/src/blink_integration.jl +++ b/src/blink_integration.jl @@ -2,7 +2,7 @@ using Blink function blink_show(v::VegaVisualization) w = Window() - path(url...) = Pkg.dir("Vega", "assets", "bower_components", url...) + path(url...) = joinpath(dirname(@__FILE__), "..", "assets", "bower_components", url...) d3 = path("d3","d3.min.js") topojson = path("topojson","topojson.js") cloudlayout = path("d3-cloud", "build", "d3.layout.cloud.js") diff --git a/src/render.jl b/src/render.jl index 2d126e9..b82dcac 100644 --- a/src/render.jl +++ b/src/render.jl @@ -8,7 +8,7 @@ end #Jupyter Notebook display import Base.writemime -asset(url...) = readall(Pkg.dir("Vega", "assets", "bower_components", url...)) +asset(url...) = readall(joinpath(dirname(@__FILE__), "..", "assets", "bower_components", url...)) function writemime(io::IO, ::MIME"text/html", v::VegaVisualization) divid = "vg" * randstring(3) diff --git a/test/REQUIRE b/test/REQUIRE index f900cca..9d638c4 100644 --- a/test/REQUIRE +++ b/test/REQUIRE @@ -4,3 +4,4 @@ ColorBrewer Compat KernelDensity RDatasets +Distributions diff --git a/test/runtests.jl b/test/runtests.jl index 6234b64..134f4b5 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,7 +1,7 @@ #using PyCall #@pyimport jsonschema using JSON, Vega, Base.Test, KernelDensity, Distributions, RDatasets -vegaschema = JSON.parse(readall(Pkg.dir("Vega", "assets/bower_components/vega/vega-schema.json"))) +vegaschema = JSON.parse(readall(joinpath(dirname(@__FILE__), "..", "assets/bower_components/vega/vega-schema.json"))) #### Tests #### #Test that Julia returned VegaVisulization (every public function does) @@ -123,7 +123,7 @@ a = bubblechart(x = x, y = y, group = cont, pointSize = z) #13. Choropleth Counties println("Test 13") -df = readtable(Pkg.dir("Vega", "vega-datasets/unemployment.tsv")) +df = readtable(joinpath(dirname(@__FILE__), "..", "vega-datasets/unemployment.tsv")) a = choropleth(x = df[:id], y = df[:rate]) @test typeof(a) == VegaVisualization @@ -243,7 +243,7 @@ a = piechart(x = fruit, y = bushels, holesize = 175); #25. Population Chart println("Test 25") df = DataFrame() -for p in JSON.parse(readall(Pkg.dir("Vega", "vega-datasets/population.json"))) +for p in JSON.parse(readall(joinpath(dirname(@__FILE__), "..", "vega-datasets/population.json"))) df = vcat(df, DataFrame(;[symbol(k)=>v for (k,v) in p]...)) end pop1900 = df[df[:year] .== 1900, :]; @@ -295,7 +295,7 @@ a = stemleaf(y = data); #29. Stream Plot println("Test 29") -df = readtable(Pkg.dir("Vega", "vega-datasets/streamdata.csv")) +df = readtable(joinpath(dirname(@__FILE__), "..", "vega-datasets/streamdata.csv")) a = streamplot(x = df[:date], y = df[:value], group = df[:key]); @test typeof(a) == VegaVisualization @@ -363,7 +363,7 @@ colorscheme!(a, palette = "Violet"); #36. colorscheme! println("Test 36") df = DataFrame() -for p in JSON.parse(readall(Pkg.dir("Vega", "vega-datasets/population.json"))) +for p in JSON.parse(readall(joinpath(dirname(@__FILE__), "..", "vega-datasets/population.json"))) df = vcat(df, DataFrame(;[symbol(k)=>v for (k,v) in p]...)) end pop1900 = df[df[:year] .== 1900, :]; @@ -452,7 +452,7 @@ text!(a, title = "Safe Fat Intake 65g/day", x = 150, y = 10) #43 title! println("Test 43") df = DataFrame() -for p in JSON.parse(readall(Pkg.dir("Vega", "vega-datasets/population.json"))) +for p in JSON.parse(readall(joinpath(dirname(@__FILE__), "..", "vega-datasets/population.json"))) df = vcat(df, DataFrame(;[symbol(k)=>v for (k,v) in p]...)) end pop1900 = df[df[:year] .== 1900, :]; @@ -503,7 +503,7 @@ a.background = "green" #47 dotplot println("Test 47") df = DataFrame() -for p in JSON.parse(readall(Pkg.dir("Vega", "vega-datasets/movies.json"))) +for p in JSON.parse(readall(joinpath(dirname(@__FILE__), "..", "vega-datasets/movies.json"))) df = vcat(df, DataFrame(;[symbol(k)=>v for (k,v) in p]...)) end @@ -518,7 +518,7 @@ xlab!(a, title = "Avg. U.S. Gross Movie Receipts", format = ".3s") #48 dotplot println("Test 48") df = DataFrame() -for p in JSON.parse(readall(Pkg.dir("Vega", "vega-datasets/movies.json"))) +for p in JSON.parse(readall(joinpath(dirname(@__FILE__), "..", "vega-datasets/movies.json"))) df = vcat(df, DataFrame(;[symbol(k)=>v for (k,v) in p]...)) end From c3127808673e920a625908538857931a695bcebc Mon Sep 17 00:00:00 2001 From: Tony Kelman Date: Sat, 30 Jul 2016 15:25:35 -0700 Subject: [PATCH 2/3] take manual installation of RDatasets out of .travis.yml that should be covered by test/REQUIRE --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4d901b2..c5d0637 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,4 +11,4 @@ julia: before_install: - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi script: - - julia -e 'Pkg.init(); Pkg.add("RDatasets"); Pkg.clone(pwd()); Pkg.test("Vega")' + - julia -e 'Pkg.init(); Pkg.clone(pwd()); Pkg.test("Vega")' From 564ae0c0a41b68a7fd579df7542759f4b670a9bd Mon Sep 17 00:00:00 2001 From: Tony Kelman Date: Sat, 30 Jul 2016 15:26:33 -0700 Subject: [PATCH 3/3] same change on appveyor and enable 0.5 --- appveyor.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 0fcff9e..eccb6d1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,6 +2,8 @@ environment: matrix: #- JULIAVERSION: "julialang/bin/winnt/x86/0.4/julia-0.4-latest-win32.exe" - JULIAVERSION: "julialang/bin/winnt/x64/0.4/julia-0.4-latest-win64.exe" + #- JULIAVERSION: "julialang/bin/winnt/x86/0.5/julia-0.5-latest-win32.exe" + - JULIAVERSION: "julialang/bin/winnt/x64/0.5/julia-0.5-latest-win64.exe" #- JULIAVERSION: "julianightlies/bin/winnt/x86/julia-latest-win32.exe" - JULIAVERSION: "julianightlies/bin/winnt/x64/julia-latest-win64.exe" @@ -31,4 +33,4 @@ build_script: Pkg.clone(pwd(), \"Vega\"); Pkg.build(\"Vega\")" test_script: - - C:\projects\julia\bin\julia --check-bounds=yes -e "Pkg.add(\"RDatasets\");Pkg.test(\"Vega\")" + - C:\projects\julia\bin\julia --check-bounds=yes -e "Pkg.test(\"Vega\")"