Skip to content

Commit

Permalink
Merge pull request #69 from rdeits/rd/no-0.6
Browse files Browse the repository at this point in the history
Drop Julia 0.6
  • Loading branch information
rdeits authored Nov 11, 2018
2 parents 90b2b69 + f55d1fc commit 5d191c8
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 76 deletions.
14 changes: 3 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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())'
29 changes: 14 additions & 15 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
environment:
matrix:
- julia_version: 0.6
- julia_version: 0.7
- julia_version: 1
- julia_version: nightly
Expand Down
7 changes: 3 additions & 4 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Compat
using Base.Filesystem
using BinDeps: unpack_cmd, download_cmd

Expand All @@ -16,15 +15,15 @@ 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)
stamped_sha = strip(open(f -> read(f, String), stamp_file))
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

Expand All @@ -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)
Expand Down
16 changes: 7 additions & 9 deletions src/MeshCat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/animations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 1 addition & 6 deletions src/geometry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/msgpack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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),)))))
15 changes: 5 additions & 10 deletions src/servers.jl
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
14 changes: 2 additions & 12 deletions src/trees.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module SceneTrees

using Compat

export SceneNode, Path

struct Path <: AbstractVector{String}
Expand All @@ -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, '/')))
Expand Down
5 changes: 2 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Compat
using Compat.Test
using Compat.LinearAlgebra: UniformScaling
using Test
using LinearAlgebra: UniformScaling
using MeshCat
using GeometryTypes
using CoordinateTransformations
Expand Down
9 changes: 6 additions & 3 deletions test/visualizer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 5d191c8

Please sign in to comment.