Skip to content

Commit 8a54eb7

Browse files
authored
Merge pull request #3 from JuliaString/spj/updateci
Clean up for Julia 1.0, use GitHub Actions for CI
2 parents b767a0d + 7fc8495 commit 8a54eb7

File tree

9 files changed

+37
-346
lines changed

9 files changed

+37
-346
lines changed

.drone.yml

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,3 @@
1-
---
2-
kind: pipeline
3-
name: linux - arm - Julia 1.0
4-
5-
platform:
6-
os: linux
7-
arch: arm
8-
9-
steps:
10-
- name: build
11-
image: julia:1.0
12-
commands:
13-
- "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'"
14-
15-
---
16-
kind: pipeline
17-
name: linux - arm - Julia 1.5
18-
platform:
19-
os: linux
20-
arch: arm
21-
22-
steps:
23-
- name: build
24-
image: julia:1.5
25-
commands:
26-
- "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'"
27-
28-
---
29-
kind: pipeline
30-
name: linux - arm64 - Julia 1.0
31-
32-
platform:
33-
os: linux
34-
arch: arm64
35-
36-
steps:
37-
- name: build
38-
image: julia:1.0
39-
commands:
40-
- "julia --project=. --check-bounds=yes --color=yes -e 'using InteractiveUtils; versioninfo(verbose=true); using Pkg; Pkg.build(); Pkg.test(coverage=true)'"
41-
421
---
432
kind: pipeline
443
name: linux - arm64 - Julia 1.5

.travis.yml

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

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ keywords = ["Strings", "Characters", "Encodings"]
44
license = "MIT"
55
desc = "Basic API for string encodings, character sets, etc."
66
authors = ["ScottPJones <scottjones@alum.mit.edu>"]
7-
version = "1.0.0"
7+
version = "1.1.0"
88

99
[deps]
1010
Unicode = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
@@ -18,5 +18,5 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1818
test = ["Test"]
1919

2020
[compat]
21-
julia = "^1.0.0"
22-
ModuleInterfaceTools = "≥ 1.0.0"
21+
julia = "1"
22+
ModuleInterfaceTools = "1"

src/StrAPI.jl

Lines changed: 28 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@ __precompile__(true)
22
"""
33
StrAPI package
44
5-
Copyright 2017-2018 Gandalf Software, Inc., Scott P. Jones
5+
Copyright 2017-2020 Gandalf Software, Inc., Scott P. Jones
66
Licensed under MIT License, see LICENSE.md
77
"""
88
module StrAPI
99

1010
using ModuleInterfaceTools
1111
using ModuleInterfaceTools: m_eval, _stdout, _stderr
1212

13-
const NEW_ITERATE = VERSION >= v"0.7.0-DEV.5127"
14-
1513
const MaybeSub{T} = Union{T, SubString{T}} where {T<:AbstractString}
1614

1715
const CodeUnitTypes = Union{UInt8, UInt16, UInt32}
@@ -23,8 +21,7 @@ quotesym(s...) = Expr(:quote, symstr(s...))
2321

2422
@api public StringError
2523

26-
@api develop NEW_ITERATE, CodeUnitTypes, CodePoints, MaybeSub, symstr, quotesym,
27-
_stdout, "@preserve"
24+
@api develop CodeUnitTypes, CodePoints, MaybeSub, symstr, quotesym, _stdout, "@preserve"
2825

2926
@api base convert, getindex, length, map, collect, hash, sizeof, size, strides,
3027
pointer, unsafe_load, string, read, write, reverse,
@@ -37,48 +34,43 @@ quotesym(s...) = Expr(:quote, symstr(s...))
3734
# Conditionally import or export names that are only in v0.6 or in master
3835
@api base! codeunit, codeunits, ncodeunits, codepoint, thisind, firstindex, lastindex
3936

40-
@static NEW_ITERATE ? (@api base iterate) : (@api base start, next, done)
41-
42-
@static if V6_COMPAT
43-
include("compat.jl")
44-
else # !V6_COMPAT
45-
import Base.GC: @preserve
37+
@api base iterate
4638

47-
function find end
48-
function ind2chr end
49-
function chr2ind end
39+
import Base.GC: @preserve
5040

51-
# Handle changes in array allocation
52-
create_vector(T, len) = Vector{T}(undef, len)
41+
function find end
42+
function ind2chr end
43+
function chr2ind end
5344

54-
# Add new short name for deprecated hex function
55-
outhex(v, p=1) = string(v, base=16, pad=p)
45+
# Handle changes in array allocation
46+
create_vector(T, len) = Vector{T}(undef, len)
5647

57-
get_iobuffer(siz) = IOBuffer(sizehint=siz)
48+
# Add new short name for deprecated hex function
49+
outhex(v, p=1) = string(v, base=16, pad=p)
5850

59-
const utf8crc = Base._crc32c
60-
const is_lowercase = islowercase
61-
const is_uppercase = isuppercase
62-
const lowercase_first = lowercasefirst
63-
const uppercase_first = uppercasefirst
51+
get_iobuffer(siz) = IOBuffer(sizehint=siz)
6452

65-
using Base: unsafe_crc32c, Fix2
53+
const utf8crc = Base._crc32c
54+
const is_lowercase = islowercase
55+
const is_uppercase = isuppercase
56+
const lowercase_first = lowercasefirst
57+
const uppercase_first = uppercasefirst
6658

67-
# Location of some methods moved from Base.UTF8proc to Base.Unicode
68-
const UC = Base.Unicode
69-
const Unicode = UC
59+
using Base: unsafe_crc32c, Fix2
7060

71-
import Base.CodeUnits
61+
# Location of some methods moved from Base.UTF8proc to Base.Unicode
62+
const UC = Base.Unicode
63+
const Unicode = UC
7264

73-
@api base IteratorSize
65+
import Base.CodeUnits
7466

75-
const is_letter = isletter
67+
@api base IteratorSize
7668

77-
pwc(c, io, str) = printstyled(io, str; color = c)
69+
const is_letter = isletter
7870

79-
const graphemes = UC.graphemes
71+
pwc(c, io, str) = printstyled(io, str; color = c)
8072

81-
end # !V6_COMPAT
73+
const graphemes = UC.graphemes
8274

8375
@api base isequal, ==, in
8476

@@ -89,10 +81,9 @@ pr_ul(io, l) = pwc(:underline, io, l)
8981

9082
@api develop! pwc, pr_ul
9183

92-
const str_next = @static NEW_ITERATE ? iterate : next
9384
str_done(str::AbstractString, i::Integer) = i > ncodeunits(str)
9485

95-
@api develop! str_next, str_done
86+
@api develop! str_done
9687
@api develop unsafe_crc32c, Fix2, CodeUnits
9788
@api public! is_lowercase, is_uppercase, lowercase_first, uppercase_first
9889

@@ -119,8 +110,6 @@ function _uppercase end
119110
function _titlecase end
120111
@api develop! _write, _print, _isvalid, _lowercase, _uppercase, _titlecase
121112

122-
const curmod = @static V6_COMPAT ? current_module() : @__MODULE__
123-
124113
include("errors.jl")
125114
include("traits.jl")
126115
include("codepoints.jl")
@@ -159,7 +148,7 @@ for (pref, lst) in
159148
? (symstr("is", nam[1]), symstr("is_", nam[2]))
160149
: (symstr("is", nam), symstr("is_", nam)))
161150

162-
m_eval(curmod,
151+
m_eval(@__MODULE__,
163152
(isdefined(Base, oldname)
164153
? Expr(:const, Expr(:(=), newname, oldname))
165154
: Expr(:function, newname)))

src/codepoints.jl

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CodePoints iterator
22
#
3-
# Copyright 2017-2018 Gandalf Software, Inc., Scott P. Jones
3+
# Copyright 2017-2020 Gandalf Software, Inc., Scott P. Jones
44
# Licensed under MIT License, see LICENSE.md
55

66
struct CodePoints{T<:AbstractString}
@@ -24,10 +24,4 @@ julia> collect(codepoints(a))
2424
codepoints(xs) = CodePoints(xs)
2525
eltype(::Type{<:CodePoints{S}}) where {S} = eltype(S)
2626
length(it::CodePoints) = length(it.xs)
27-
@static if NEW_ITERATE
2827
iterate(it::CodePoints, state=1) = iterate(it.xs, state)
29-
else
30-
start(it::CodePoints) = 1
31-
done(it::CodePoints, state) = state > ncodeunits(it.xs)
32-
next(it::CodePoints, state) = next(it.xs, state)
33-
end

0 commit comments

Comments
 (0)