Skip to content

Commit 5924222

Browse files
authored
Merge branch 'main' into main
2 parents 42e29b6 + 3f9b6fb commit 5924222

36 files changed

Lines changed: 1611 additions & 678 deletions

.ci/check-whitespace.jl

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#!/usr/bin/env julia
2+
3+
const patterns = split("""
4+
*.jl
5+
*.md
6+
*.yml
7+
*Makefile
8+
""")
9+
10+
const is_gha = something(tryparse(Bool, get(ENV, "GITHUB_ACTIONS", "false")), false)
11+
12+
# Note: `git ls-files` gives `/` as a path separator on Windows,
13+
# so we just use `/` for all platforms.
14+
allow_tabs(path) =
15+
endswith(path, "Makefile") ||
16+
endswith(path, ".make") ||
17+
endswith(path, ".mk")
18+
19+
function check_whitespace()
20+
errors = Set{Tuple{String,Int,String}}()
21+
files_to_check = filter(arg -> !startswith(arg, "-"), ARGS)
22+
if isempty(files_to_check)
23+
if "--stdin" in ARGS
24+
files_to_check = collect(eachline(stdin))
25+
else
26+
files_to_check = collect(eachline(`git ls-files -- $patterns`))
27+
end
28+
end
29+
30+
files_fixed = 0
31+
if "--fix" in ARGS
32+
for path in files_to_check
33+
content = newcontent = read(path, String)
34+
isempty(content) && continue
35+
if !allow_tabs(path)
36+
tabpattern = r"^([ \t]+)"m => (x -> replace(x, r"((?: {4})*)( *\t)" => s"\1 ")) # Replace tab sequences at start of line after any number of 4-space groups
37+
newcontent = replace(newcontent, tabpattern)
38+
end
39+
newcontent = replace(newcontent,
40+
r"\s*$" => '\n', # Remove trailing whitespace and normalize line ending at eof
41+
r"\s*?[\r\n]" => '\n', # Remove trailing whitespace and normalize line endings on each line
42+
r"\xa0" => ' ' # Replace non-breaking spaces
43+
)
44+
if content != newcontent
45+
write(path, newcontent)
46+
files_fixed += 1
47+
end
48+
end
49+
if files_fixed > 0
50+
println(stderr, "Fixed whitespace issues in $files_fixed files.")
51+
end
52+
end
53+
54+
for path in files_to_check
55+
lineno = 0
56+
non_blank = 0
57+
58+
file_err(msg) = push!(errors, (path, 0, msg))
59+
line_err(msg) = push!(errors, (path, lineno, msg))
60+
61+
isfile(path) || continue
62+
for line in eachline(path, keep=true)
63+
lineno += 1
64+
contains(line, '\r') && file_err("non-UNIX line endings")
65+
contains(line, '\ua0') && line_err("non-breaking space")
66+
allow_tabs(path) ||
67+
contains(line, '\t') && line_err("tab")
68+
endswith(line, '\n') || line_err("no trailing newline")
69+
line = chomp(line)
70+
endswith(line, r"\s") && line_err("trailing whitespace")
71+
contains(line, r"\S") && (non_blank = lineno)
72+
end
73+
non_blank < lineno && line_err("trailing blank lines")
74+
end
75+
76+
if isempty(errors)
77+
println(stderr, "Whitespace check found no issues.")
78+
exit(0)
79+
else
80+
println(stderr, "Whitespace check found $(length(errors)) issues:")
81+
for (path, lineno, msg) in sort!(collect(errors))
82+
if lineno == 0
83+
println(stderr, "$path -- $msg")
84+
if is_gha
85+
println(stdout, "::warning title=Whitespace check,file=", path, "::", msg)
86+
end
87+
else
88+
println(stderr, "$path:$lineno -- $msg")
89+
if is_gha
90+
println(stdout, "::warning title=Whitespace check,file=", path, ",line=", lineno, "::", msg)
91+
end
92+
end
93+
end
94+
exit(1)
95+
end
96+
end
97+
98+
check_whitespace()

.github/workflows/CompatHelper.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
run: which julia
1616
continue-on-error: true
1717
- name: Install Julia, but only if it is not already available in the PATH
18-
uses: julia-actions/setup-julia@v2
18+
uses: julia-actions/setup-julia@v3
1919
with:
2020
version: '1'
2121
arch: ${{ runner.arch }}

.github/workflows/Whitespace.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Whitespace
2+
3+
permissions: {}
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
11+
jobs:
12+
whitespace:
13+
name: Check whitespace
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 2
16+
steps:
17+
- name: Checkout the JuliaSparse/SparseArrays.jl repository
18+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
19+
with:
20+
persist-credentials: false
21+
- uses: julia-actions/setup-julia@f6f565d9f7cf12f53dc8045742460d6260ad3b39 # v3.0.1
22+
with:
23+
version: '1.11.6'
24+
- name: Check whitespace
25+
run: |
26+
julia .ci/check-whitespace.jl

.github/workflows/ci.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,20 @@ jobs:
3030
- os: macOS-latest
3131
julia-arch: aarch64
3232
julia-version: 'nightly'
33-
- os: macOS-13
33+
- os: macOS-15-intel
3434
julia-arch: x64
3535
julia-version: 'nightly'
3636
steps:
37-
- uses: actions/checkout@v4
38-
- uses: julia-actions/setup-julia@v2
37+
- uses: actions/checkout@v6
38+
- uses: julia-actions/setup-julia@v3
3939
with:
4040
version: ${{ matrix.julia-version }}
4141
arch: ${{ matrix.julia-arch }}
42-
- uses: julia-actions/cache@v2
42+
- uses: julia-actions/cache@v3
4343
- uses: julia-actions/julia-buildpkg@v1
4444
- uses: julia-actions/julia-runtest@v1
4545
- uses: julia-actions/julia-processcoverage@v1
46-
- uses: codecov/codecov-action@v5
46+
- uses: codecov/codecov-action@v6
4747
with:
4848
file: lcov.info
4949
token: ${{ secrets.CODECOV_TOKEN }}
@@ -62,21 +62,21 @@ jobs:
6262
julia-arch:
6363
- x64
6464
steps:
65-
- uses: actions/checkout@v4
66-
- uses: julia-actions/setup-julia@v2
65+
- uses: actions/checkout@v6
66+
- uses: julia-actions/setup-julia@v3
6767
with:
6868
version: ${{ matrix.julia-version }}
6969
arch: ${{ matrix.julia-arch }}
70-
- uses: julia-actions/cache@v2
70+
- uses: julia-actions/cache@v3
7171
- uses: julia-actions/julia-buildpkg@v1
7272
- uses: julia-actions/julia-runtest@v1
7373
env:
7474
SPARSEARRAYS_AQUA_TEST: true
7575
docs:
7676
runs-on: ubuntu-latest
7777
steps:
78-
- uses: actions/checkout@v4
79-
- uses: julia-actions/setup-julia@v2
78+
- uses: actions/checkout@v6
79+
- uses: julia-actions/setup-julia@v3
8080
with:
8181
version: 'nightly'
8282
- name: Generate docs

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "SparseArrays"
22
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
3-
version = "1.12.0"
3+
version = "1.13.0"
44

55
[deps]
66
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
@@ -19,7 +19,7 @@ Pkg = "<0.0.1, 1"
1919
Printf = "<0.0.1, 1"
2020
Random = "<0.0.1, 1"
2121
Serialization = "<0.0.1, 1"
22-
SuiteSparse_jll = "7.8.0"
22+
SuiteSparse_jll = "7.10.1"
2323
Test = "<0.0.1, 1"
2424
julia = "1.11"
2525

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ struct SparseVector{Tv,Ti<:Integer} <: AbstractSparseVector{Tv,Ti}
8585
end
8686
```
8787

88-
As for [`SparseMatrixCSC`](@ref), the `SparseVector` type can also contain explicitly
88+
Like [`SparseMatrixCSC`](@ref), the `SparseVector` type can also contain explicitly
8989
stored zeros. (See [Sparse Matrix Storage](@ref man-csc).).
9090

9191
## Sparse Vector and Matrix Constructors

gen/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SuiteSparse*

gen/Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
VER=7.10.1
2+
3+
all: clean download
4+
mkdir -p SuiteSparse-$(VER)
5+
cd SuiteSparse-$(VER) && tar -zxvf ../SuiteSparse.v$(VER).x86_64-linux-gnu.tar.gz
6+
julia --project -e "using Pkg; Pkg.instantiate()"
7+
julia --project generator.jl ./SuiteSparse-$(VER)
8+
9+
clean:
10+
rm -fr *.tar.gz SuiteSparse*
11+
12+
download:
13+
curl -L -O https://github.com/JuliaBinaryWrappers/SuiteSparse_jll.jl/releases/download/SuiteSparse-v$(VER)%2B0/SuiteSparse.v$(VER).x86_64-linux-gnu.tar.gz

gen/Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ JuliaFormatter = "98e50ef6-434e-11e9-1051-2b60c6c9e899"
44
SuiteSparse_jll = "bea87d4a-7f5b-5778-9afe-8cc45184846c"
55

66
[compat]
7-
Clang = "0.18"
8-
JuliaFormatter = "1.0.45"
7+
Clang = "0.18, 0.19"
8+
JuliaFormatter = "2"

gen/README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
# How to auto-generate the wrappers
22

33
1. `cd` to this directory
4-
2. run `julia --project generator.jl`, then you could find the updated wrappers in the `lib` folder
4+
2. Update the SuiteSparse version in `Makefile`
5+
3. run `make`, then you could find the updated wrappers in the `lib` folder
56

6-
## How to upgrade SuiteSparse_jll
7-
8-
1. update `SuiteSparse_jll` in Yggdrasil to the desired version
9-
2. `cd` to this directory
10-
3. run `julia --project generator.jl <SuiteSparse artifact directory>`
11-
12-
## How to upgrade Clang.jl
7+
# How to upgrade Clang.jl
138

149
1. `cd` to this directory
1510
2. if you want to change major version, change the compat bound in `Project.toml`.

0 commit comments

Comments
 (0)