Skip to content

Commit

Permalink
Update to julia 1.0, drop julia 0.6 support (PR #17)
Browse files Browse the repository at this point in the history
* Change CI to test julia 1.0 instead of julia 0.6
* Switch to newer appveyor script (from https://github.com/JuliaCI/Appveyor.jl)
* Fix `using Pkg` && switch to use default `script`.
* Fix .travis.yml Coverage `after_success` section for v0.7
* removed .travis.yml git depth && unshallow settings from
* .travis.yml: remove cd from after_success
* Bump REQUIRE to julia v0.7
* Removed Compat now that we're requiring julia 0.7!
* Removed all "VERSION" checks now that this is 1.0!
  • Loading branch information
NHDaly authored and vtjnash committed Aug 14, 2018
1 parent 52e0ed0 commit ed18d97
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 60 deletions.
47 changes: 25 additions & 22 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,43 @@
environment:
matrix:
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x86/0.6/julia-0.6-latest-win32.exe"
- JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe"
- JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe"
- julia_version: 1
- julia_version: nightly

platform:
- x86 # 32-bit
- x64 # 64-bit

# # Uncomment the following lines to allow failures on nightly julia
# # (tests will run but not make your overall status red)
# matrix:
# allow_failures:
# - julia_version: latest

branches:
only:
- master
- /release-.*/

notifications:
- provider: Email
on_build_success: false
on_build_failure: false
on_build_status_changed: false

init:
- git config --global core.autocrlf input

install:
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
# If there's a newer build queued for the same PR, cancel this one
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
Where-Object pullRequestId -eq $env:APPVEYOR_PULL_REQUEST_NUMBER)[0].buildNumber) { `
throw "There are newer queued builds for this pull request, failing early." }
# Download most recent Julia Windows binary
- ps: (new-object net.webclient).DownloadFile(
$env:JULIA_URL,
"C:\projects\julia-binary.exe")
# Run installer silently, output to C:\projects\julia
- C:\projects\julia-binary.exe /S /D=C:\projects\julia
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))

build_script:
- C:\projects\julia\bin\julia -e "versioninfo();
Pkg.clone(pwd(), \"Glob\"); Pkg.build(\"Glob\")"
- echo "%JL_BUILD_SCRIPT%"
- C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%"

test_script:
- C:\projects\julia\bin\julia -e "Pkg.test(\"Glob\")"
- echo "%JL_TEST_SCRIPT%"
- C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"

# # Uncomment to support code coverage upload. Should only be enabled for packages
# # which would have coverage gaps without running on Windows
# on_success:
# - echo "%JL_CODECOV_SCRIPT%"
# - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%"

11 changes: 2 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
language: julia
julia:
- nightly
- 0.6
- 1.0
os:
- linux
branches:
only:
- master
notifications:
email: false
git:
depth: 99999999
before_install:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
script:
- julia -e 'Pkg.clone(pwd());
Pkg.test("Glob", coverage=true)'
after_success:
- julia -e 'cd(Pkg.dir("Glob"));
- julia -e 'using Pkg;
Pkg.add("Coverage");
using Coverage;
Coveralls.submit(Coveralls.process_folder())'
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
julia 0.6
julia 0.7
Compat 0.68.0
24 changes: 3 additions & 21 deletions src/Glob.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@ __precompile__()

module Glob

using Compat

import Base: ismatch, readdir, show
import Compat: occursin

@static if VERSION < v"0.7.0-DEV.5126"
function iterate(s::AbstractString, i::Int=firstindex(s))
i > ncodeunits(s) && return nothing
return s[i], nextind(s, i)
end
end
import Base: readdir, show, occursin

export glob, @fn_str, @fn_mstr, @glob_str, @glob_mstr

Expand Down Expand Up @@ -132,19 +122,11 @@ function occursin(fn::FilenameMatch, s::AbstractString)
return true
end

@static if VERSION < v"0.7.0-DEV.4637"
Base.ismatch(fn::FilenameMatch, s::AbstractString) = occursin(fn, s)
else
@deprecate ismatch(fn::FilenameMatch, s::AbstractString) occursin(fn, s)
end
@deprecate ismatch(fn::FilenameMatch, s::AbstractString) occursin(fn, s)

filter!(fn::FilenameMatch, v) = filter!(x -> occursin(fn, x), v)
filter(fn::FilenameMatch, v) = filter(x -> occursin(fn, x), v)
@static if VERSION < v"0.7.0-DEV.1378"
filter!(fn::FilenameMatch, d::Dict) = filter!((k, v) -> occursin(fn, k), d)
else
filter!(fn::FilenameMatch, d::Dict) = filter!(((k, v),) -> occursin(fn, k), d)
end
filter!(fn::FilenameMatch, d::Dict) = filter!(((k, v),) -> occursin(fn, k), d)
filter(fn::FilenameMatch, d::Dict) = filter!(fn, copy(d))

function _match_bracket(pat::AbstractString, mc::Char, i, cl::Char, cu::Char) # returns (mc, i, valid, match)
Expand Down
9 changes: 2 additions & 7 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Glob
using Compat
using Compat.Test
using Test

macro test_types(arr, types)
return quote
Expand Down Expand Up @@ -182,11 +181,7 @@ end
@test all([!startswith(x,'.') for x in Glob.glob("*.*")])

function test_string(x1)
@static if VERSION < v"0.7.0-DEV.2437"
x2 = string(eval(parse(x1)))
else
x2 = string(eval(Meta.parse(x1)))
end
x2 = string(eval(Meta.parse(x1)))
x1 == x2 ? nothing : error(string(
"string test failed:",
"\noriginal: ", x1,
Expand Down

0 comments on commit ed18d97

Please sign in to comment.