Skip to content

Commit 98ec8aa

Browse files
authored
compat with Julia 1.x (#445)
* compat with Julia 1.x * work around compiler error on 1.2 * rm travis/appveyor
1 parent 661e106 commit 98ec8aa

File tree

6 files changed

+64
-80
lines changed

6 files changed

+64
-80
lines changed

.github/workflows/CI.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
on:
3+
- push
4+
- pull_request
5+
jobs:
6+
test:
7+
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
version:
13+
- '1.0'
14+
- '1.1'
15+
- '1.2'
16+
- '1.3'
17+
- '1.4'
18+
- '1.5'
19+
- 'nightly'
20+
os:
21+
- ubuntu-latest
22+
- macOS-latest
23+
- windows-latest
24+
arch:
25+
- x64
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: julia-actions/setup-julia@v1
29+
with:
30+
version: ${{ matrix.version }}
31+
arch: ${{ matrix.arch }}
32+
- uses: actions/cache@v1
33+
env:
34+
cache-name: cache-artifacts
35+
with:
36+
path: ~/.julia/artifacts
37+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
38+
restore-keys: |
39+
${{ runner.os }}-test-${{ env.cache-name }}-
40+
${{ runner.os }}-test-
41+
${{ runner.os }}-
42+
- uses: julia-actions/julia-buildpkg@v1
43+
- uses: julia-actions/julia-runtest@v1

.travis.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
1010

1111
[compat]
1212
CodeTracking = "0.5.9, 1"
13-
julia = "~1.0, 1.5"
13+
julia = "1"
1414

1515
[extras]
1616
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"

appveyor.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/utils.jl

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,25 @@ function lineoffset(framecode::FrameCode)
296296
end
297297

298298
getline(ln) = Int(isexpr(ln, :line) ? ln.args[1] : ln.line)::Int
299-
getfile(ln) = CodeTracking.maybe_fixup_stdlib_path(String(isexpr(ln, :line) ? ln.args[2] : ln.file)::String)
299+
# work around compiler error on 1.2
300+
@static if v"1.2.0" <= VERSION < v"1.3"
301+
getfile(ln) = begin
302+
path = if isexpr(ln, :line)
303+
String(ln.args[2])
304+
else
305+
try
306+
file = String(ln.file)
307+
isfile(file)
308+
file
309+
catch err
310+
""
311+
end
312+
end
313+
CodeTracking.maybe_fixup_stdlib_path(path)
314+
end
315+
else
316+
getfile(ln) = CodeTracking.maybe_fixup_stdlib_path(String(isexpr(ln, :line) ? ln.args[2] : ln.file)::String)
317+
end
300318

301319
function firstline(ex::Expr)
302320
for a in ex.args

test/toplevel.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ module Namespace end
244244
JuliaInterpreter.through_methoddef_or_done!(frame) === nothing && break
245245
end
246246
@test Namespace.sin(0) == 10
247-
if Base.VERSION >= v"1.5"
247+
if Base.VERSION >= v"1.1"
248248
@test Base.sin(0) == 0
249249
else
250250
@test_broken Base.sin(0) == 0

0 commit comments

Comments
 (0)