Skip to content

Commit 69a6eb1

Browse files
authored
Update CI (#134)
* build * update actions * update actions * update actions * fix one test * build * remove 3.13 * remove 3.13 * macé * fix missing env * fix build * try * agzin * remove x86
1 parent 5e05cde commit 69a6eb1

14 files changed

+57
-48
lines changed

.github/workflows/black-ruff.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ jobs:
44
black-format-check:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
7+
- uses: actions/checkout@v4
88
- uses: psf/black@stable
99
with:
1010
options: "--diff --check"
1111
src: "."
1212
ruff-format-check:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616
- uses: chartboost/ruff-action@v1

.github/workflows/check-urls.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121

2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424

2525
- name: urls-checker-code
2626
uses: urlstechie/urlchecker-action@main

.github/workflows/clang.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
clang-format-checking:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v2
7+
- uses: actions/checkout@v4
88
- uses: RafikFarhad/clang-format-github-action@v3
99
with:
1010
sources: "src/**/*.h,src/**/*.c,test/**/*.c"

.github/workflows/cmakelint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
steps:
1010
- name: Checkout repository
11-
uses: actions/checkout@v2
11+
uses: actions/checkout@v4
1212

1313
- name: Format CMake files
1414
id: cmake-format

.github/workflows/documentation.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
os: [ubuntu-latest]
1818

1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121

22-
- uses: actions/setup-python@v4
22+
- uses: actions/setup-python@v5
2323
with:
24-
python-version: '3.11'
24+
python-version: '3.12'
2525

2626
- uses: tlylt/install-graphviz@v1
2727

@@ -35,7 +35,7 @@ jobs:
3535
run: python -m pip install -r requirements-dev.txt
3636

3737
- name: Cache pip
38-
uses: actions/cache@v2
38+
uses: actions/cache@v4
3939
with:
4040
path: ~/.cache/pip
4141
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }}
@@ -86,6 +86,6 @@ jobs:
8686
exit 1
8787
fi
8888
89-
- uses: actions/upload-artifact@v3
89+
- uses: actions/upload-artifact@v4
9090
with:
9191
path: ./dist/html/**

.github/workflows/mypy.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ jobs:
44
mypy:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v3
8-
- uses: actions/setup-python@v4
7+
- uses: actions/checkout@v4
8+
- uses: actions/setup-python@v5
99
with:
10-
python-version: '3.11'
10+
python-version: '3.12'
1111
- name: Install mypy
1212
run: pip install mypy
1313
- name: Run mypy

.github/workflows/rstcheck.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ jobs:
1111
os: [ubuntu-latest]
1212

1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515

1616
# Used to host cibuildwheel
17-
- uses: actions/setup-python@v4
17+
- uses: actions/setup-python@v5
1818
with:
19-
python-version: '3.11'
19+
python-version: '3.12'
2020

2121
- name: Install requirements
2222
run: python -m pip install -r requirements.txt

.github/workflows/wheels-linux.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ jobs:
2525
os: [ubuntu-latest]
2626

2727
steps:
28-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
2929

3030
# Used to host cibuildwheel
31-
- uses: actions/setup-python@v4
31+
- uses: actions/setup-python@v5
3232
with:
33-
python-version: '3.11'
33+
python-version: '3.12'
3434

3535
- name: Install cibuildwheel
3636
run: python -m pip install cibuildwheel
@@ -41,6 +41,6 @@ jobs:
4141
- name: Build wheels
4242
run: python -m cibuildwheel --output-dir wheelhouse
4343

44-
- uses: actions/upload-artifact@v3
44+
- uses: actions/upload-artifact@v4
4545
with:
4646
path: ./wheelhouse/*.whl

.github/workflows/wheels-mac.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ jobs:
2121
os: [macOS-latest]
2222

2323
steps:
24-
- uses: actions/checkout@v3
24+
- uses: actions/checkout@v4
2525

2626
# Used to host cibuildwheel
27-
- uses: actions/setup-python@v4
27+
- uses: actions/setup-python@v5
2828
with:
29-
python-version: '3.11'
29+
python-version: '3.12'
3030

3131
- name: Install cibuildwheel
3232
run: python -m pip install cibuildwheel
@@ -37,6 +37,6 @@ jobs:
3737
- name: Build wheels
3838
run: python -m cibuildwheel --output-dir wheelhouse
3939

40-
- uses: actions/upload-artifact@v3
40+
- uses: actions/upload-artifact@v4
4141
with:
4242
path: ./wheelhouse/*.whl

.github/workflows/wheels-windows.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ jobs:
2020
os: [windows-latest]
2121

2222
steps:
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424

2525
# Used to host cibuildwheel
26-
- uses: actions/setup-python@v4
26+
- uses: actions/setup-python@v5
2727
with:
28-
python-version: '3.10'
28+
python-version: '3.12'
2929

3030
- name: Install cibuildwheel
3131
run: python -m pip install cibuildwheel
@@ -36,6 +36,6 @@ jobs:
3636
- name: Build wheels
3737
run: python -m cibuildwheel
3838

39-
- uses: actions/upload-artifact@v3
39+
- uses: actions/upload-artifact@v4
4040
with:
4141
path: ./wheelhouse/*.whl

_unittests/ut_mlmodel/test_kmeans_sklearn.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
assert_array_equal,
66
assert_array_almost_equal,
77
assert_almost_equal,
8-
assert_raise_message,
98
)
109
from sklearn.metrics.cluster import v_measure_score
1110
from sklearn.datasets import make_blobs
@@ -112,12 +111,12 @@ def _check_fitted_model(self, km):
112111
self.assertGreater(km.inertia_, 0.0)
113112

114113
# check error on dataset being too small
115-
assert_raise_message(
116-
ValueError,
117-
"n_samples=1 should be >= n_clusters=%d" % km.n_clusters,
118-
km.fit,
119-
[[0.0, 1.0]],
120-
)
114+
try:
115+
km.fit([[0.0, 1.0]])
116+
except Exception as e:
117+
self.assertIn(
118+
f"n_samples=1 should be >= n_clusters={km.n_clusters}", str(e)
119+
)
121120

122121
@ignore_warnings(UserWarning)
123122
def test_k_means_new_centers(self):

azure-pipelines.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
jobs:
2+
23
- job: 'TestLinuxWheelNoCuda'
34
pool:
45
vmImage: 'ubuntu-latest'

pyproject.toml

+15-6
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@ classifiers = [
1414
"Operating System :: Unix",
1515
"Operating System :: MacOS",
1616
"Programming Language :: Python :: 3",
17-
"Programming Language :: Python :: 3.9",
1817
"Programming Language :: Python :: 3.10",
1918
"Programming Language :: Python :: 3.11",
19+
"Programming Language :: Python :: 3.12",
20+
"Programming Language :: Python :: 3.13",
2021
]
2122
dependencies = ["numpy", "onnx>=1.14.0", "scipy"]
2223
description = "Extends the list of supported operators in onnx reference implementation and onnxruntime, or implements faster versions in C++."
2324
keywords = ["onnx", "cython", "scikit-learn", "machine-learning"]
2425
license = {file = "LICENSE.txt"}
2526
name = "mlinsights"
2627
readme = "README.rst"
27-
requires-python = ">=3.9"
28+
requires-python = ">=3.10"
2829
version = "0.5.1"
2930

3031
[project.urls]
@@ -108,23 +109,31 @@ manylinux-x86_64-image = "manylinux2014"
108109
[tool.cibuildwheel.linux]
109110
archs = ["x86_64"]
110111
build = "cp*"
111-
skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy* *musllinux*"
112+
skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* cp315-* pypy* *musllinux*"
112113
manylinux-x86_64-image = "manylinux2014"
113114
before-build = "pip install auditwheel-symbols abi3audit"
114115
build-verbosity = 1
115116
repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit {wheel} ; auditwheel repair -w {dest_dir} {wheel} || exit 0"
116117
# repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} || exit 0"
117118

118119
[tool.cibuildwheel.macos]
119-
archs = ["arm64", "universal2"]
120+
archs = "arm64" # or "universal2" for a single universal wheel
121+
environment = """
122+
MACOSX_DEPLOYMENT_TARGET=14.0
123+
LDFLAGS='-L$(brew --prefix libomp)/lib'
124+
CPPFLAGS='-I$(brew --prefix libomp)/include'
125+
CFLAGS='-I$(brew --prefix libomp)/include -arch x86_64 -arch arm64'
126+
CXXFLAGS='-I$(brew --prefix libomp)/include -arch x86_64 -arch arm64'
127+
DYLD_LIBRARY_PATH='$(brew --prefix libomp)/lib:$DYLD_LIBRARY_PATH'
128+
"""
120129
build = "cp*"
121-
skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy* pp*"
130+
skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* cp315-* pypy* pp*"
122131
before-build = "brew install libomp llvm&&echo 'export PATH=\"/opt/homebrew/opt/llvm/bin:$PATH\"' >> /Users/runner/.bash_profile"
123132

124133
[tool.cibuildwheel.windows]
125134
archs = ["AMD64"]
126135
build = "cp*"
127-
skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy*"
136+
skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* cp315-* pypy*"
128137

129138
[tool.cython-lint]
130139
max-line-length = 88

setup.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ def initialize_options(self):
265265
self._parent.initialize_options(self)
266266

267267
# boolean
268-
b_values = {0, 1, "1", "0", True, False}
269-
t_values = {1, "1", True}
268+
b_values = {0, 1, "1", "0", True, False} # noqa: B033
269+
t_values = {1, "1", True} # noqa: B033
270270
for att in ["use_nvtx", "use_cuda", "manylinux"]:
271271
v = getattr(self, att)
272272
if v is not None:
@@ -295,17 +295,17 @@ def initialize_options(self):
295295
def finalize_options(self):
296296
self._parent.finalize_options(self)
297297

298-
b_values = {0, 1, "1", "0", True, False, "True", "False"}
298+
b_values = {0, 1, "1", "0", True, False, "True", "False"} # noqa: B033
299299
if self.use_nvtx not in b_values:
300300
raise ValueError(f"use_nvtx={self.use_nvtx!r} must be in {b_values}.")
301301
if self.use_cuda is None:
302302
self.use_cuda = find_cuda()
303303
if self.use_cuda not in b_values:
304304
raise ValueError(f"use_cuda={self.use_cuda!r} must be in {b_values}.")
305305

306-
self.use_nvtx = self.use_nvtx in {1, "1", True, "True"}
307-
self.use_cuda = self.use_cuda in {1, "1", True, "True"}
308-
self.manylinux = self.manylinux in {1, "1", True, "True"}
306+
self.use_nvtx = self.use_nvtx in {1, "1", True, "True"} # noqa: B033
307+
self.use_cuda = self.use_cuda in {1, "1", True, "True"} # noqa: B033
308+
self.manylinux = self.manylinux in {1, "1", True, "True"} # noqa: B033
309309

310310
if self.cuda_version in (None, ""):
311311
self.cuda_version = None
@@ -599,7 +599,7 @@ def get_ext_modules():
599599
add_cuda = False
600600
elif "--use-cuda=0" in sys.argv:
601601
add_cuda = False
602-
elif os.environ.get("USE_CUDA", None) in {0, "0", False}:
602+
elif os.environ.get("USE_CUDA", None) in {0, "0", False}: # noqa: B033
603603
add_cuda = False
604604
if add_cuda:
605605
cuda_extensions.extend([])

0 commit comments

Comments
 (0)