Skip to content

Commit

Permalink
compat with Julia 1.x (#445)
Browse files Browse the repository at this point in the history
* compat with Julia 1.x

* work around compiler error on 1.2

* rm travis/appveyor
  • Loading branch information
pfitzseb committed Dec 1, 2020
1 parent 661e106 commit 98ec8aa
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 80 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI
on:
- push
- pull_request
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.0'
- '1.1'
- '1.2'
- '1.3'
- '1.4'
- '1.5'
- 'nightly'
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

[compat]
CodeTracking = "0.5.9, 1"
julia = "~1.0, 1.5"
julia = "1"

[extras]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand Down
37 changes: 0 additions & 37 deletions appveyor.yml

This file was deleted.

20 changes: 19 additions & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,25 @@ function lineoffset(framecode::FrameCode)
end

getline(ln) = Int(isexpr(ln, :line) ? ln.args[1] : ln.line)::Int
getfile(ln) = CodeTracking.maybe_fixup_stdlib_path(String(isexpr(ln, :line) ? ln.args[2] : ln.file)::String)
# work around compiler error on 1.2
@static if v"1.2.0" <= VERSION < v"1.3"
getfile(ln) = begin
path = if isexpr(ln, :line)
String(ln.args[2])
else
try
file = String(ln.file)
isfile(file)
file
catch err
""
end
end
CodeTracking.maybe_fixup_stdlib_path(path)
end
else
getfile(ln) = CodeTracking.maybe_fixup_stdlib_path(String(isexpr(ln, :line) ? ln.args[2] : ln.file)::String)
end

function firstline(ex::Expr)
for a in ex.args
Expand Down
2 changes: 1 addition & 1 deletion test/toplevel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ module Namespace end
JuliaInterpreter.through_methoddef_or_done!(frame) === nothing && break
end
@test Namespace.sin(0) == 10
if Base.VERSION >= v"1.5"
if Base.VERSION >= v"1.1"
@test Base.sin(0) == 0
else
@test_broken Base.sin(0) == 0
Expand Down

0 comments on commit 98ec8aa

Please sign in to comment.