Skip to content

Update CI #134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Mar 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/black-ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ jobs:
black-format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: psf/black@stable
with:
options: "--diff --check"
src: "."
ruff-format-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
2 changes: 1 addition & 1 deletion .github/workflows/check-urls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: urls-checker-code
uses: urlstechie/urlchecker-action@main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
clang-format-checking:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: RafikFarhad/clang-format-github-action@v3
with:
sources: "src/**/*.h,src/**/*.c,test/**/*.c"
2 changes: 1 addition & 1 deletion .github/workflows/cmakelint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Format CMake files
id: cmake-format
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'

- uses: tlylt/install-graphviz@v1

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

- name: Cache pip
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }}
Expand Down Expand Up @@ -86,6 +86,6 @@ jobs:
exit 1
fi

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: ./dist/html/**
6 changes: 3 additions & 3 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ jobs:
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'
- name: Install mypy
run: pip install mypy
- name: Run mypy
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/rstcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Used to host cibuildwheel
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'

- name: Install requirements
run: python -m pip install -r requirements.txt
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/wheels-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ jobs:
os: [ubuntu-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Used to host cibuildwheel
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'

- name: Install cibuildwheel
run: python -m pip install cibuildwheel
Expand All @@ -41,6 +41,6 @@ jobs:
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
8 changes: 4 additions & 4 deletions .github/workflows/wheels-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
os: [macOS-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Used to host cibuildwheel
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'

- name: Install cibuildwheel
run: python -m pip install cibuildwheel
Expand All @@ -37,6 +37,6 @@ jobs:
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
8 changes: 4 additions & 4 deletions .github/workflows/wheels-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
os: [windows-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Used to host cibuildwheel
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.12'

- name: Install cibuildwheel
run: python -m pip install cibuildwheel
Expand All @@ -36,6 +36,6 @@ jobs:
- name: Build wheels
run: python -m cibuildwheel

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
13 changes: 6 additions & 7 deletions _unittests/ut_mlmodel/test_kmeans_sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
assert_array_equal,
assert_array_almost_equal,
assert_almost_equal,
assert_raise_message,
)
from sklearn.metrics.cluster import v_measure_score
from sklearn.datasets import make_blobs
Expand Down Expand Up @@ -112,12 +111,12 @@ def _check_fitted_model(self, km):
self.assertGreater(km.inertia_, 0.0)

# check error on dataset being too small
assert_raise_message(
ValueError,
"n_samples=1 should be >= n_clusters=%d" % km.n_clusters,
km.fit,
[[0.0, 1.0]],
)
try:
km.fit([[0.0, 1.0]])
except Exception as e:
self.assertIn(
f"n_samples=1 should be >= n_clusters={km.n_clusters}", str(e)
)

@ignore_warnings(UserWarning)
def test_k_means_new_centers(self):
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
jobs:

- job: 'TestLinuxWheelNoCuda'
pool:
vmImage: 'ubuntu-latest'
Expand Down
21 changes: 15 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@ classifiers = [
"Operating System :: Unix",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = ["numpy", "onnx>=1.14.0", "scipy"]
description = "Extends the list of supported operators in onnx reference implementation and onnxruntime, or implements faster versions in C++."
keywords = ["onnx", "cython", "scikit-learn", "machine-learning"]
license = {file = "LICENSE.txt"}
name = "mlinsights"
readme = "README.rst"
requires-python = ">=3.9"
requires-python = ">=3.10"
version = "0.5.1"

[project.urls]
Expand Down Expand Up @@ -108,23 +109,31 @@ manylinux-x86_64-image = "manylinux2014"
[tool.cibuildwheel.linux]
archs = ["x86_64"]
build = "cp*"
skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy* *musllinux*"
skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* cp315-* pypy* *musllinux*"
manylinux-x86_64-image = "manylinux2014"
before-build = "pip install auditwheel-symbols abi3audit"
build-verbosity = 1
repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit {wheel} ; auditwheel repair -w {dest_dir} {wheel} || exit 0"
# repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} || exit 0"

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

[tool.cibuildwheel.windows]
archs = ["AMD64"]
build = "cp*"
skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy*"
skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* cp315-* pypy*"

[tool.cython-lint]
max-line-length = 88
Expand Down
14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ def initialize_options(self):
self._parent.initialize_options(self)

# boolean
b_values = {0, 1, "1", "0", True, False}
t_values = {1, "1", True}
b_values = {0, 1, "1", "0", True, False} # noqa: B033
t_values = {1, "1", True} # noqa: B033
for att in ["use_nvtx", "use_cuda", "manylinux"]:
v = getattr(self, att)
if v is not None:
Expand Down Expand Up @@ -295,17 +295,17 @@ def initialize_options(self):
def finalize_options(self):
self._parent.finalize_options(self)

b_values = {0, 1, "1", "0", True, False, "True", "False"}
b_values = {0, 1, "1", "0", True, False, "True", "False"} # noqa: B033
if self.use_nvtx not in b_values:
raise ValueError(f"use_nvtx={self.use_nvtx!r} must be in {b_values}.")
if self.use_cuda is None:
self.use_cuda = find_cuda()
if self.use_cuda not in b_values:
raise ValueError(f"use_cuda={self.use_cuda!r} must be in {b_values}.")

self.use_nvtx = self.use_nvtx in {1, "1", True, "True"}
self.use_cuda = self.use_cuda in {1, "1", True, "True"}
self.manylinux = self.manylinux in {1, "1", True, "True"}
self.use_nvtx = self.use_nvtx in {1, "1", True, "True"} # noqa: B033
self.use_cuda = self.use_cuda in {1, "1", True, "True"} # noqa: B033
self.manylinux = self.manylinux in {1, "1", True, "True"} # noqa: B033

if self.cuda_version in (None, ""):
self.cuda_version = None
Expand Down Expand Up @@ -599,7 +599,7 @@ def get_ext_modules():
add_cuda = False
elif "--use-cuda=0" in sys.argv:
add_cuda = False
elif os.environ.get("USE_CUDA", None) in {0, "0", False}:
elif os.environ.get("USE_CUDA", None) in {0, "0", False}: # noqa: B033
add_cuda = False
if add_cuda:
cuda_extensions.extend([])
Expand Down
Loading