Skip to content

Commit 07d24d9

Browse files
omusararslan
authored andcommitted
Drop support for Julia 0.6 (#47)
* Drop Julia 0.6 support * Drop Compat dependency * Drop sprintcompact * Test against Julia 1.1 * Add Project.toml
1 parent 1fd5ca2 commit 07d24d9

File tree

8 files changed

+32
-46
lines changed

8 files changed

+32
-46
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
*.jl.cov
22
*.jl.*.cov
33
*.jl.mem
4+
5+
Manifest.toml

.travis.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,11 @@ os:
44
- linux
55
- osx
66
julia:
7-
- 0.6
87
- 1.0
8+
- 1.1
99
- nightly
1010
notifications:
1111
email: false
1212
after_success:
13-
- |
14-
julia -e '
15-
VERSION >= v"0.7.0-DEV.3656" && using Pkg
16-
VERSION >= v"0.7.0-DEV.5183" || cd(Pkg.dir("FixedPointDecimals"))
17-
Pkg.add("Coverage"); using Coverage
18-
Coveralls.submit(process_folder())'
19-
- |
20-
julia -e '
21-
VERSION >= v"0.7.0-DEV.3656" && using Pkg
22-
VERSION >= v"0.7.0-DEV.5183" || cd(Pkg.dir("FixedPointDecimals"))
23-
Pkg.add("Coverage"); using Coverage
24-
Codecov.submit(process_folder())'
13+
- julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Coveralls.submit(process_folder())'
14+
- julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'

Project.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name = "FixedPointDecimals"
2+
uuid = "fb4d412d-6eee-574d-9565-ede6634db7b0"
3+
authors = ["Fengyang Wang <fengyang.wang.0@gmail.com>", "Curtis Vogt <curtis.vogt@gmail.com>"]
4+
5+
[compat]
6+
julia = "0.7, 1.0"
7+
8+
[extras]
9+
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
10+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
11+
12+
[targets]
13+
test = ["Printf", "Test"]

REQUIRE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
julia 0.6
2-
Compat 1.1.0
1+
julia 0.7

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
environment:
22
matrix:
3-
- julia_version: 0.6
4-
- julia_version: 1
3+
- julia_version: 1.0
4+
- julia_version: 1.1
55
- julia_version: nightly
66

77
platform:

src/FixedPointDecimals.jl

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,10 @@ module FixedPointDecimals
2727

2828
export FixedDecimal, RoundThrows
2929

30-
using Compat: lastindex, something
31-
32-
import Compat: floatmin, floatmax
33-
3430
import Base: reinterpret, zero, one, abs, sign, ==, <, <=, +, -, /, *, div, rem, divrem,
3531
fld, mod, fldmod, fld1, mod1, fldmod1, isinteger, typemin, typemax,
3632
print, show, string, convert, parse, promote_rule, min, max,
37-
trunc, round, floor, ceil, eps, float, widemul, decompose
33+
floatmin, floatmax, trunc, round, floor, ceil, eps, float, widemul, decompose
3834

3935
const BitInteger = Union{Int8, UInt8, Int16, UInt16, Int32, UInt32, Int64,
4036
UInt64, Int128, UInt128}
@@ -223,14 +219,7 @@ as a floating point number.
223219
This is equivalent to counting the number of bits needed to represent the
224220
integer, excluding any trailing zeros.
225221
"""
226-
required_precision(::Integer)
227-
228-
# https://github.com/JuliaLang/julia/pull/27908
229-
if VERSION < v"0.7.0-beta.183"
230-
required_precision(n::Integer) = ndigits(n, 2) - trailing_zeros(n)
231-
else
232-
required_precision(n::Integer) = ndigits(n, base=2) - trailing_zeros(n)
233-
end
222+
required_precision(n::Integer) = ndigits(n, base=2) - trailing_zeros(n)
234223

235224
"""
236225
_apply_exact_float(f, T, x::Real, i::Integer)

test/runtests.jl

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
using FixedPointDecimals
2-
import FixedPointDecimals: FD, value
3-
using Compat
4-
using Compat.Test
5-
using Compat.Printf
2+
using FixedPointDecimals: FD, value
3+
using Test
4+
using Printf
65
using Base.Checked: checked_mul
76

87
include("utils.jl")
@@ -788,12 +787,12 @@ end
788787

789788
@testset "show" begin
790789
@testset "compact" begin
791-
@test sprintcompact(FD2(1.00)) == "1.0"
792-
@test sprintcompact(FD2(1.23)) == "1.23"
793-
@test sprintcompact(FD2(42.40)) == "42.4"
794-
@test sprintcompact(FD2(-42.40)) == "-42.4"
795-
@test sprintcompact(FD2(-0.01)) == "-0.01"
796-
@test sprintcompact(FD2(0)) == "0.0"
790+
@test sprint(show, FD2(1.00), context=:compact=>true) == "1.0"
791+
@test sprint(show, FD2(1.23), context=:compact=>true) == "1.23"
792+
@test sprint(show, FD2(42.40), context=:compact=>true) == "42.4"
793+
@test sprint(show, FD2(-42.40), context=:compact=>true) == "-42.4"
794+
@test sprint(show, FD2(-0.01), context=:compact=>true) == "-0.01"
795+
@test sprint(show, FD2(0), context=:compact=>true) == "0.0"
797796

798797
@test repr(typemin(FixedDecimal{Int64, 2})) ==
799798
"FixedDecimal{Int64,2}(-92233720368547758.08)"

test/utils.jl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,3 @@ function ceil_alt(::Type{FD{T,f}}, val::AbstractFloat) where {T<:Integer, f}
4141
s, v, r = integer_alt(T, f, val)
4242
reinterpret(FD{T,f}, copysign(v + (s > 0 ? r : zero(T)), s))
4343
end
44-
45-
if VERSION < v"0.7.0-DEV.4524"
46-
sprintcompact(x...) = sprint(showcompact, x...)
47-
else
48-
sprintcompact(x...) = sprint(show, x..., context=:compact=>true)
49-
end

0 commit comments

Comments
 (0)