diff --git a/.travis.yml b/.travis.yml index 5a5286c..f0a4bca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,6 @@ language: julia matrix: include: - - os: linux - julia: 0.6 - env: TESTCMD="xvfb-run julia" - os: linux julia: 0.7 env: TESTCMD="xvfb-run julia" @@ -14,9 +11,6 @@ matrix: - os: linux julia: nightly env: TESTCMD="xvfb-run julia" - - os: osx - julia: 0.6 - env: TESTCMD="julia" - os: osx julia: 0.7 env: TESTCMD="julia" @@ -47,10 +41,8 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ffmpeg; fi script: - # - julia -e 'Pkg.clone(pwd()); Pkg.build("MeshCat"); Pkg.test("MeshCat"; coverage=true)' - - $TESTCMD -e 'if VERSION < v"0.7-"; Pkg.clone(pwd()); else; import Pkg; Pkg.add(Pkg.PackageSpec(path=pwd())); end; Pkg.build("MeshCat"); Pkg.test("MeshCat"; coverage=true)' + - $TESTCMD -e 'import Pkg; Pkg.add(Pkg.PackageSpec(path=pwd())); Pkg.build("MeshCat"); Pkg.test("MeshCat"; coverage=true)' - julia --code-coverage=user -e 'using MeshCat; MeshCat.develop_meshcat_assets(true)' - - julia -e 'if VERSION >= v"0.7-"; import Pkg; end; Pkg.build("MeshCat")' + - julia -e 'import Pkg; Pkg.build("MeshCat")' after_success: - # push coverage results to Codecov - - julia -e 'if VERSION >= v"0.7-"; import Pkg; end; Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())' + - julia -e 'import Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())' diff --git a/REQUIRE b/REQUIRE index ae617c1..53ee2af 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,23 +1,22 @@ -julia 0.6 +julia 0.7 # Geometry -GeometryTypes 0.4 -StaticArrays 0.5 -CoordinateTransformations 0.4.1 -Rotations 0.5.0 -Colors 0.7.1 +GeometryTypes 0.6 +StaticArrays 0.8 +CoordinateTransformations 0.5 +Rotations 0.8 +Colors 0.9 # Misc -BinDeps 0.8.7 -Compat 0.54 +BinDeps 0.8.8 DocStringExtensions 0.4 -Parameters 0.7 +Parameters 0.10 Requires # Communication -MsgPack 0.1.1 -WebIO # TODO: require v0.3.0 when we drop Julia v0.6 -Mux 0.2.3 # TODO: require v0.5.2 when we drop Julia v0.6 -JSExpr # TODO: require v0.3.0 when we drop Julia v0.6 -AssetRegistry 0.0.1 -JSON +MsgPack 0.2 +WebIO 0.4.2 +Mux 0.5.2 +JSExpr 0.3 +AssetRegistry 0.1 +JSON 0.18 diff --git a/appveyor.yml b/appveyor.yml index 0c44ddd..eef793e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,5 @@ environment: matrix: - - julia_version: 0.6 - julia_version: 0.7 - julia_version: 1 - julia_version: nightly diff --git a/deps/build.jl b/deps/build.jl index bda179d..5bf9f95 100644 --- a/deps/build.jl +++ b/deps/build.jl @@ -1,4 +1,3 @@ -using Compat using Base.Filesystem using BinDeps: unpack_cmd, download_cmd @@ -16,7 +15,7 @@ function update_meshcat() end if isdir(joinpath(meshcat_dir, ".git")) - Compat.@info("Meshcat assets in $meshcat_dir have been cloned with git, so they will not be automatically downloaded. To force a re-download, delete or rename the directory $meshcat_dir") + @info("Meshcat assets in $meshcat_dir have been cloned with git, so they will not be automatically downloaded. To force a re-download, delete or rename the directory $meshcat_dir") return end if isdir(meshcat_dir) && isfile(stamp_file) @@ -24,7 +23,7 @@ function update_meshcat() if stamped_sha == meshcat_sha return else - Compat.@info("Updating meshcat assets in $meshcat_dir from SHA $stamped_sha to $meshcat_sha") + @info("Updating meshcat assets in $meshcat_dir from SHA $stamped_sha to $meshcat_sha") end end @@ -36,7 +35,7 @@ function update_meshcat() download_path = joinpath(download_dir, "meshcat.zip") run(download_cmd(meshcat_url, download_path)) run(unpack_cmd(download_path, download_dir, ".zip", nothing)) - Compat.mv(joinpath(download_dir, "meshcat-$meshcat_sha"), meshcat_dir; force=true) + mv(joinpath(download_dir, "meshcat-$meshcat_sha"), meshcat_dir; force=true) end open(stamp_file, "w") do file print(file, meshcat_sha) diff --git a/src/MeshCat.jl b/src/MeshCat.jl index f431b48..98b4270 100644 --- a/src/MeshCat.jl +++ b/src/MeshCat.jl @@ -16,15 +16,13 @@ using JSExpr: @js, @new, @var using Requires: @require using Base.Filesystem: rm using BinDeps: download_cmd, unpack_cmd -using Compat -using Compat.UUIDs: UUID, uuid1 -using Compat.LinearAlgebra: UniformScaling, norm -using Compat.Sockets: listen -using Compat.Base64: base64encode - -import Base: delete!, length -import MsgPack: pack, Ext -import GeometryTypes: origin, radius +using UUIDs: UUID, uuid1 +using LinearAlgebra: UniformScaling, norm +using Sockets: listen +using Base64: base64encode +using MsgPack: MsgPack, pack, Ext + +import Base: delete! export Visualizer, ViewerWindow, diff --git a/src/animations.jl b/src/animations.jl index eca86bb..0efc14c 100644 --- a/src/animations.jl +++ b/src/animations.jl @@ -50,6 +50,6 @@ ffmpeg -r 60 -i %07d.png \\\n\t -vcodec libx264 \\\n\t -preset slow \\\n\t -crf end end end - Compat.@info("Saved output as $output_path") + @info("Saved output as $output_path") return output_path end diff --git a/src/geometry.jl b/src/geometry.jl index 30a2006..e142073 100644 --- a/src/geometry.jl +++ b/src/geometry.jl @@ -4,7 +4,7 @@ struct HyperEllipsoid{N, T} <: GeometryPrimitive{N, T} radii::Vec{N, T} end -origin(geometry::HyperEllipsoid{N, T}) where {N, T} = geometry.center +GeometryTypes.origin(geometry::HyperEllipsoid{N, T}) where {N, T} = geometry.center radii(geometry::HyperEllipsoid{N, T}) where {N, T} = geometry.radii center(geometry::HyperEllipsoid) = origin(geometry) @@ -21,12 +21,7 @@ function PointCloud(position::AbstractVector{<:AbstractVector{T}}, end struct Triad <: AbstractGeometry{3, Float64} - # # three.js: https://jsfiddle.net/prisoner849/jp17wjam/ - # var worldAxis = new THREE.AxesHelper(20); - # sphere.add(worldAxis); - scale::Float64 - # tube::Bool Triad(scale=20.0) = new(scale) end diff --git a/src/msgpack.jl b/src/msgpack.jl index bd112e6..1215e0e 100644 --- a/src/msgpack.jl +++ b/src/msgpack.jl @@ -4,7 +4,7 @@ extcode(::Type{Int32}) = 0x15 extcode(::Type{UInt32}) = 0x16 extcode(::Type{Float32}) = 0x17 -pack(io::IO, v::PackedVector) = pack(io, Ext(extcode(v), +MsgPack.pack(io::IO, v::PackedVector) = pack(io, Ext(extcode(v), convert(Vector{UInt8}, reshape(reinterpret(UInt8, v.data), (sizeof(v.data),))))) diff --git a/src/servers.jl b/src/servers.jl index a36c0d3..cd74ed2 100644 --- a/src/servers.jl +++ b/src/servers.jl @@ -1,25 +1,20 @@ -@static if VERSION < v"0.7-" - const IOError = Base.UVError -else - using Base: IOError -end Base.open(vis::Visualizer, args...; kw...) = open(vis.core, args...; kw...) function Base.open(core::CoreVisualizer, port::Integer) @async WebIO.webio_serve(Mux.page("/", req -> core.scope), port) url = "http://127.0.0.1:$port" - Compat.@info("Serving MeshCat visualizer at $url") + @info("Serving MeshCat visualizer at $url") open_url(url) end function open_url(url) try - if Compat.Sys.iswindows() + if Sys.iswindows() run(`start $url`) - elseif Compat.Sys.isapple() + elseif Sys.isapple() run(`open $url`) - elseif Compat.Sys.islinux() + elseif Sys.islinux() run(`xdg-open $url`) end catch e @@ -34,7 +29,7 @@ function Base.open(core::CoreVisualizer; default_port=8700, max_retries=500) server = try listen(port) catch e - if e isa IOError + if e isa Base.IOError continue end end diff --git a/src/trees.jl b/src/trees.jl index 928d7dd..0c8ce96 100644 --- a/src/trees.jl +++ b/src/trees.jl @@ -1,7 +1,5 @@ module SceneTrees -using Compat - export SceneNode, Path struct Path <: AbstractVector{String} @@ -12,19 +10,11 @@ Base.size(p::Path) = size(p.entries) Base.IndexStyle(::Type{Path}) = IndexLinear() Base.convert(::Type{Path}, x::AbstractVector{<:AbstractString}) = Path(x) -if VERSION < v"0.7-" - Base.joinpath(p::Path, s...) = foldl(joinpath, p, s) -else - Base.joinpath(p::Path, s...) = foldl(joinpath, s, init=p) -end +Base.joinpath(p::Path, s...) = foldl(joinpath, s, init=p) Base.joinpath(p::Path, s::Symbol) = joinpath(p, String(s)) Base.joinpath(p::Path, s::AbstractString) = _joinpath(p, split(s, '/')) -if VERSION < v"0.7-" - _joinpath(p::Path, s::AbstractVector{<:AbstractString}) = foldl(_joinpath, p, s) -else - _joinpath(p::Path, s::AbstractVector{<:AbstractString}) = foldl(_joinpath, s, init=p) -end +_joinpath(p::Path, s::AbstractVector{<:AbstractString}) = foldl(_joinpath, s, init=p) _joinpath(p::Path, s::AbstractString) = isempty(s) ? Path(String[]) : Path(vcat(p.entries, s)) Base.show(io::IO, p::Path) = print(io, string('/', join(p.entries, '/'))) diff --git a/test/runtests.jl b/test/runtests.jl index ab26384..d0945ea 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,6 +1,5 @@ -using Compat -using Compat.Test -using Compat.LinearAlgebra: UniformScaling +using Test +using LinearAlgebra: UniformScaling using MeshCat using GeometryTypes using CoordinateTransformations diff --git a/test/visualizer.jl b/test/visualizer.jl index fe9e700..89d9ba5 100644 --- a/test/visualizer.jl +++ b/test/visualizer.jl @@ -10,9 +10,12 @@ if !haskey(ENV, "CI") open(vis) end -if !(Compat.Sys.iswindows() && haskey(ENV, "CI")) +if !(Sys.iswindows() && haskey(ENV, "CI")) # this gets stuck on windows CI, but I don't know why open(vis, window) +end + +if !haskey(ENV, "CI") wait(vis) end @@ -130,7 +133,7 @@ end @testset "lines" begin v = vis[:circular_line] settransform!(v, Translation(-1, -1, 0)) - θ = Compat.range(0, stop=2π, length=100) + θ = range(0, stop=2π, length=100) geometry = PointCloud(Point.(0.5 .* sin.(θ), 0, 0.5 .* cos.(θ))) setobject!(v, LineSegments(geometry, LineBasicMaterial())) end @@ -162,7 +165,7 @@ end sleep(5) -if !(Compat.Sys.iswindows() && haskey(ENV, "CI")) +if !(Sys.iswindows() && haskey(ENV, "CI")) # this also fails on appveyor, and again I have no way to debug it notinstalled && AtomShell.uninstall() end