From d59cea05845a1412b3ff232a625d01e78bf4dc45 Mon Sep 17 00:00:00 2001 From: xadupre Date: Sat, 15 Mar 2025 14:55:39 +0100 Subject: [PATCH 01/14] build --- .github/workflows/documentation.yml | 2 +- .github/workflows/mypy.yml | 2 +- .github/workflows/rstcheck.yml | 2 +- .github/workflows/wheels-linux.yml | 2 +- .github/workflows/wheels-mac.yml | 2 +- .github/workflows/wheels-windows.yml | 2 +- azure-pipelines.yml | 70 ++++++++++++++++++++++++++++ pyproject.toml | 11 +++-- setup.py | 14 +++--- 9 files changed, 89 insertions(+), 18 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 8f05f7a0..03ce0f13 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.12' - uses: tlylt/install-graphviz@v1 diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index c0a52594..1eddb32d 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -7,7 +7,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.12' - name: Install mypy run: pip install mypy - name: Run mypy diff --git a/.github/workflows/rstcheck.yml b/.github/workflows/rstcheck.yml index 4a48174e..3cebbfeb 100644 --- a/.github/workflows/rstcheck.yml +++ b/.github/workflows/rstcheck.yml @@ -16,7 +16,7 @@ jobs: # Used to host cibuildwheel - uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.12' - name: Install requirements run: python -m pip install -r requirements.txt diff --git a/.github/workflows/wheels-linux.yml b/.github/workflows/wheels-linux.yml index f16510cf..d186ef5d 100644 --- a/.github/workflows/wheels-linux.yml +++ b/.github/workflows/wheels-linux.yml @@ -30,7 +30,7 @@ jobs: # Used to host cibuildwheel - uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.12 - name: Install cibuildwheel run: python -m pip install cibuildwheel diff --git a/.github/workflows/wheels-mac.yml b/.github/workflows/wheels-mac.yml index 5c06eb09..b6b8d5cd 100644 --- a/.github/workflows/wheels-mac.yml +++ b/.github/workflows/wheels-mac.yml @@ -26,7 +26,7 @@ jobs: # Used to host cibuildwheel - uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.12' - name: Install cibuildwheel run: python -m pip install cibuildwheel diff --git a/.github/workflows/wheels-windows.yml b/.github/workflows/wheels-windows.yml index d0dd75a7..93c7a8db 100644 --- a/.github/workflows/wheels-windows.yml +++ b/.github/workflows/wheels-windows.yml @@ -25,7 +25,7 @@ jobs: # Used to host cibuildwheel - uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.12' - name: Install cibuildwheel run: python -m pip install cibuildwheel diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3e54602c..d938468a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,4 +1,74 @@ jobs: +- job: 'TestLinuxWheelNoCuda313' + pool: + vmImage: 'ubuntu-latest' + strategy: + matrix: + Python311-Linux: + python.version: '3.13' + maxParallel: 3 + + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '$(python.version)' + architecture: 'x64' + - script: sudo apt-get update + displayName: 'AptGet Update' + - script: sudo apt-get install -y graphviz + displayName: 'Install Graphviz' + - script: python -m pip install --upgrade pip setuptools wheel + displayName: 'Install tools' + - script: pip install -r requirements.txt + displayName: 'Install Requirements' + - script: pip install -r requirements-dev.txt + displayName: 'Install Requirements dev' + - script: | + ruff check . + displayName: 'Ruff' + - script: | + black --diff . + displayName: 'Black' + - script: | + cmake-lint _cmake/Find* --disabled-codes C0103 C0113 --line-width=88 + cmake-lint _cmake/CMake* --disabled-codes C0103 C0113 --line-width=88 + displayName: 'cmake-lint' + - script: | + rstcheck -r ./_doc ./mlinsights + displayName: 'rstcheck' + - script: | + cython-lint . + displayName: 'cython-lint' + - script: | + export USE_CUDA=0 + python -m pip install -e . --config-settings="--use_cuda=0" -v + displayName: 'pip install -e . --config-settings="--use_cuda=0" -v' + - script: | + python -m pytest _unittests --durations=10 + displayName: 'Runs Unit Tests' + - script: | + # --config-settings does not work yet. + # python -m pip wheel . --config-settings="--use_cuda=0" -v + export USE_CUDA=0 + python -m pip wheel . --config-settings="--use_cuda=0" -v + displayName: 'build wheel' + - script: | + mkdir dist + cp mlinsights*.whl dist + displayName: 'copy wheel' + - script: | + pip install auditwheel-symbols + auditwheel-symbols --manylinux 2014 dist/*.whl || exit 0 + displayName: 'Audit wheel' + - script: | + pip install abi3audit + abi3audit dist/*.whl || exit 0 + displayName: 'abi3audit wheel' + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'wheel-linux-pip-$(python.version)' + targetPath: 'dist' + - job: 'TestLinuxWheelNoCuda' pool: vmImage: 'ubuntu-latest' diff --git a/pyproject.toml b/pyproject.toml index abe94ef6..4b9a0356 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,9 +14,10 @@ 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++." @@ -24,7 +25,7 @@ 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] @@ -108,7 +109,7 @@ 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-* cp314-* cp315-* pypy* *musllinux*" manylinux-x86_64-image = "manylinux2014" before-build = "pip install auditwheel-symbols abi3audit" build-verbosity = 1 @@ -118,13 +119,13 @@ repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit [tool.cibuildwheel.macos] archs = ["arm64", "universal2"] build = "cp*" -skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy* pp*" +skip = "cp36-* cp37-* cp38-* cp39-* 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-* cp314-* cp315-* pypy*" [tool.cython-lint] max-line-length = 88 diff --git a/setup.py b/setup.py index 983267eb..272abffe 100644 --- a/setup.py +++ b/setup.py @@ -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: @@ -295,7 +295,7 @@ 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: @@ -303,9 +303,9 @@ def finalize_options(self): 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 @@ -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([]) From b4224a7b6bf4ab50bbc9b94b0ffc6deb7184ef02 Mon Sep 17 00:00:00 2001 From: xadupre Date: Sat, 15 Mar 2025 15:00:16 +0100 Subject: [PATCH 02/14] update actions --- .github/workflows/black-ruff.yml | 4 ++-- .github/workflows/check-urls.yml | 2 +- .github/workflows/clang.yml | 2 +- .github/workflows/cmakelint.yml | 2 +- .github/workflows/documentation.yml | 4 ++-- .github/workflows/mypy.yml | 4 ++-- .github/workflows/rstcheck.yml | 4 ++-- .github/workflows/wheels-linux.yml | 4 ++-- .github/workflows/wheels-mac.yml | 4 ++-- .github/workflows/wheels-windows.yml | 4 ++-- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/black-ruff.yml b/.github/workflows/black-ruff.yml index 9a047430..fae3f729 100644 --- a/.github/workflows/black-ruff.yml +++ b/.github/workflows/black-ruff.yml @@ -4,7 +4,7 @@ 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" @@ -12,5 +12,5 @@ jobs: ruff-format-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: chartboost/ruff-action@v1 diff --git a/.github/workflows/check-urls.yml b/.github/workflows/check-urls.yml index b348ab24..ea8fa791 100644 --- a/.github/workflows/check-urls.yml +++ b/.github/workflows/check-urls.yml @@ -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 diff --git a/.github/workflows/clang.yml b/.github/workflows/clang.yml index 0c30a714..964dced7 100644 --- a/.github/workflows/clang.yml +++ b/.github/workflows/clang.yml @@ -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" diff --git a/.github/workflows/cmakelint.yml b/.github/workflows/cmakelint.yml index 36265e9d..07f2ad6c 100644 --- a/.github/workflows/cmakelint.yml +++ b/.github/workflows/cmakelint.yml @@ -8,7 +8,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Format CMake files id: cmake-format diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 03ce0f13..0b9463ab 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -17,9 +17,9 @@ 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.12' diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 1eddb32d..0632a5c7 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -4,8 +4,8 @@ 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.12' - name: Install mypy diff --git a/.github/workflows/rstcheck.yml b/.github/workflows/rstcheck.yml index 3cebbfeb..332f3596 100644 --- a/.github/workflows/rstcheck.yml +++ b/.github/workflows/rstcheck.yml @@ -11,10 +11,10 @@ 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.12' diff --git a/.github/workflows/wheels-linux.yml b/.github/workflows/wheels-linux.yml index d186ef5d..2b29a2f1 100644 --- a/.github/workflows/wheels-linux.yml +++ b/.github/workflows/wheels-linux.yml @@ -25,10 +25,10 @@ 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.12 diff --git a/.github/workflows/wheels-mac.yml b/.github/workflows/wheels-mac.yml index b6b8d5cd..7e2cc0ca 100644 --- a/.github/workflows/wheels-mac.yml +++ b/.github/workflows/wheels-mac.yml @@ -21,10 +21,10 @@ 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.12' diff --git a/.github/workflows/wheels-windows.yml b/.github/workflows/wheels-windows.yml index 93c7a8db..047bb209 100644 --- a/.github/workflows/wheels-windows.yml +++ b/.github/workflows/wheels-windows.yml @@ -20,10 +20,10 @@ 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.12' From c1b56a1d07a292107a3d6cd0c7450e43fb59258f Mon Sep 17 00:00:00 2001 From: xadupre Date: Sat, 15 Mar 2025 15:02:38 +0100 Subject: [PATCH 03/14] update actions --- .github/workflows/documentation.yml | 2 +- .github/workflows/wheels-linux.yml | 2 +- .github/workflows/wheels-mac.yml | 2 +- .github/workflows/wheels-windows.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 0b9463ab..1cbae2b4 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -86,6 +86,6 @@ jobs: exit 1 fi - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: ./dist/html/** diff --git a/.github/workflows/wheels-linux.yml b/.github/workflows/wheels-linux.yml index 2b29a2f1..96513036 100644 --- a/.github/workflows/wheels-linux.yml +++ b/.github/workflows/wheels-linux.yml @@ -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 diff --git a/.github/workflows/wheels-mac.yml b/.github/workflows/wheels-mac.yml index 7e2cc0ca..dbb0dbdb 100644 --- a/.github/workflows/wheels-mac.yml +++ b/.github/workflows/wheels-mac.yml @@ -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 diff --git a/.github/workflows/wheels-windows.yml b/.github/workflows/wheels-windows.yml index 047bb209..2c293600 100644 --- a/.github/workflows/wheels-windows.yml +++ b/.github/workflows/wheels-windows.yml @@ -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 From 981eed74fc33e5b6a2d77a58e956c6bc665ec18c Mon Sep 17 00:00:00 2001 From: xadupre Date: Sat, 15 Mar 2025 15:03:24 +0100 Subject: [PATCH 04/14] update actions --- .github/workflows/documentation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 1cbae2b4..f24abd3b 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -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') }} From 4208bf35e57fba55d827f326f5db1fc4b5715337 Mon Sep 17 00:00:00 2001 From: xadupre Date: Sat, 15 Mar 2025 15:11:29 +0100 Subject: [PATCH 05/14] fix one test --- _unittests/ut_mlmodel/test_kmeans_sklearn.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/_unittests/ut_mlmodel/test_kmeans_sklearn.py b/_unittests/ut_mlmodel/test_kmeans_sklearn.py index 974b024f..253c8284 100644 --- a/_unittests/ut_mlmodel/test_kmeans_sklearn.py +++ b/_unittests/ut_mlmodel/test_kmeans_sklearn.py @@ -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 @@ -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): From f97378cbd88e311a61296ef4880bc6edfdac513d Mon Sep 17 00:00:00 2001 From: xadupre Date: Sat, 15 Mar 2025 15:18:05 +0100 Subject: [PATCH 06/14] build --- .github/workflows/wheels-linux.yml | 2 +- pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheels-linux.yml b/.github/workflows/wheels-linux.yml index 96513036..95d14020 100644 --- a/.github/workflows/wheels-linux.yml +++ b/.github/workflows/wheels-linux.yml @@ -30,7 +30,7 @@ jobs: # Used to host cibuildwheel - uses: actions/setup-python@v5 with: - python-version: '3.12 + python-version: '3.12' - name: Install cibuildwheel run: python -m pip install cibuildwheel diff --git a/pyproject.toml b/pyproject.toml index 4b9a0356..cdf14ed8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -120,12 +120,12 @@ repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit archs = ["arm64", "universal2"] build = "cp*" skip = "cp36-* cp37-* cp38-* cp39-* cp314-* cp315-* pypy* pp*" -before-build = "brew install libomp llvm&&echo 'export PATH=\"/opt/homebrew/opt/llvm/bin:$PATH\"' >> /Users/runner/.bash_profile" +before-build = "brew install libomp llvm&&echo 'export PATH=\"/opt/homebrew/opt/llvm/bin:$PATH\"\\nexport MACOSX_DEPLOYMENT_TARGET=14.0' >> /Users/runner/.bash_profile" [tool.cibuildwheel.windows] archs = ["AMD64"] build = "cp*" -skip = "cp36-* cp37-* cp38-* cp39-* cp314-* cp315-* pypy*" +skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* cp315-* pypy*" [tool.cython-lint] max-line-length = 88 From 859750f58ead4221369a442786c39883e5936386 Mon Sep 17 00:00:00 2001 From: xadupre Date: Sat, 15 Mar 2025 15:18:32 +0100 Subject: [PATCH 07/14] remove 3.13 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cdf14ed8..bf269416 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -109,7 +109,7 @@ manylinux-x86_64-image = "manylinux2014" [tool.cibuildwheel.linux] archs = ["x86_64"] build = "cp*" -skip = "cp36-* cp37-* cp38-* cp39-* cp314-* cp315-* 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 @@ -119,7 +119,7 @@ repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit [tool.cibuildwheel.macos] archs = ["arm64", "universal2"] build = "cp*" -skip = "cp36-* cp37-* cp38-* cp39-* cp314-* cp315-* 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\"\\nexport MACOSX_DEPLOYMENT_TARGET=14.0' >> /Users/runner/.bash_profile" [tool.cibuildwheel.windows] From b12dd24e67c2e50a4aeb165facc12a7cf711d894 Mon Sep 17 00:00:00 2001 From: xadupre Date: Sat, 15 Mar 2025 15:19:31 +0100 Subject: [PATCH 08/14] remove 3.13 --- azure-pipelines.yml | 69 --------------------------------------------- 1 file changed, 69 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d938468a..96c05e78 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,73 +1,4 @@ jobs: -- job: 'TestLinuxWheelNoCuda313' - pool: - vmImage: 'ubuntu-latest' - strategy: - matrix: - Python311-Linux: - python.version: '3.13' - maxParallel: 3 - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - architecture: 'x64' - - script: sudo apt-get update - displayName: 'AptGet Update' - - script: sudo apt-get install -y graphviz - displayName: 'Install Graphviz' - - script: python -m pip install --upgrade pip setuptools wheel - displayName: 'Install tools' - - script: pip install -r requirements.txt - displayName: 'Install Requirements' - - script: pip install -r requirements-dev.txt - displayName: 'Install Requirements dev' - - script: | - ruff check . - displayName: 'Ruff' - - script: | - black --diff . - displayName: 'Black' - - script: | - cmake-lint _cmake/Find* --disabled-codes C0103 C0113 --line-width=88 - cmake-lint _cmake/CMake* --disabled-codes C0103 C0113 --line-width=88 - displayName: 'cmake-lint' - - script: | - rstcheck -r ./_doc ./mlinsights - displayName: 'rstcheck' - - script: | - cython-lint . - displayName: 'cython-lint' - - script: | - export USE_CUDA=0 - python -m pip install -e . --config-settings="--use_cuda=0" -v - displayName: 'pip install -e . --config-settings="--use_cuda=0" -v' - - script: | - python -m pytest _unittests --durations=10 - displayName: 'Runs Unit Tests' - - script: | - # --config-settings does not work yet. - # python -m pip wheel . --config-settings="--use_cuda=0" -v - export USE_CUDA=0 - python -m pip wheel . --config-settings="--use_cuda=0" -v - displayName: 'build wheel' - - script: | - mkdir dist - cp mlinsights*.whl dist - displayName: 'copy wheel' - - script: | - pip install auditwheel-symbols - auditwheel-symbols --manylinux 2014 dist/*.whl || exit 0 - displayName: 'Audit wheel' - - script: | - pip install abi3audit - abi3audit dist/*.whl || exit 0 - displayName: 'abi3audit wheel' - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'wheel-linux-pip-$(python.version)' - targetPath: 'dist' - job: 'TestLinuxWheelNoCuda' pool: From 2ca029d7937dab5a94397cd25088692f16370033 Mon Sep 17 00:00:00 2001 From: xadupre Date: Sat, 15 Mar 2025 15:42:59 +0100 Subject: [PATCH 09/14] =?UTF-8?q?mac=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bf269416..98580e11 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -120,7 +120,7 @@ repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit archs = ["arm64", "universal2"] build = "cp*" 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\"\\nexport MACOSX_DEPLOYMENT_TARGET=14.0' >> /Users/runner/.bash_profile" +before-build = "brew install libomp llvm&&echo 'export PATH=\"/opt/homebrew/opt/llvm/bin:$PATH\"' >> /Users/runner/.bash_profile&&export MACOSX_DEPLOYMENT_TARGET=14.0" [tool.cibuildwheel.windows] archs = ["AMD64"] From 05821593e6ab276f62e8f664f86361dd336f658f Mon Sep 17 00:00:00 2001 From: xadupre Date: Sat, 15 Mar 2025 15:46:38 +0100 Subject: [PATCH 10/14] fix missing env --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 98580e11..3cb93fa2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -117,10 +117,11 @@ repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit # repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} || exit 0" [tool.cibuildwheel.macos] +environment = "MACOSX_DEPLOYMENT_TARGET=14.0" archs = ["arm64", "universal2"] build = "cp*" 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&&export MACOSX_DEPLOYMENT_TARGET=14.0" +before-build = "brew install libomp llvm&&echo 'export PATH=\"/opt/homebrew/opt/llvm/bin:$PATH\"' >> /Users/runner/.bash_profile" [tool.cibuildwheel.windows] archs = ["AMD64"] From a96b2e8fa050a34e097b2c025fdab777db0a496c Mon Sep 17 00:00:00 2001 From: xadupre Date: Sat, 15 Mar 2025 15:49:49 +0100 Subject: [PATCH 11/14] fix build --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3cb93fa2..bcfc8479 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -118,7 +118,7 @@ repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit [tool.cibuildwheel.macos] environment = "MACOSX_DEPLOYMENT_TARGET=14.0" -archs = ["arm64", "universal2"] +archs = ["universal2"] build = "cp*" 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" From 6619a4818b745310d270920db907e40892e76c96 Mon Sep 17 00:00:00 2001 From: xadupre Date: Sat, 15 Mar 2025 15:55:08 +0100 Subject: [PATCH 12/14] try --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bcfc8479..97dd846c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -118,7 +118,7 @@ repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit [tool.cibuildwheel.macos] environment = "MACOSX_DEPLOYMENT_TARGET=14.0" -archs = ["universal2"] +archs = "x86_64 arm64" build = "cp*" 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" From e22be729886327563986355c0b7a1adbd6163871 Mon Sep 17 00:00:00 2001 From: xadupre Date: Sat, 15 Mar 2025 16:00:17 +0100 Subject: [PATCH 13/14] agzin --- pyproject.toml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 97dd846c..0239437f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -117,8 +117,15 @@ repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit # repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} || exit 0" [tool.cibuildwheel.macos] -environment = "MACOSX_DEPLOYMENT_TARGET=14.0" -archs = "x86_64 arm64" +archs = "x86_64 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-* cp315-* pypy* pp*" before-build = "brew install libomp llvm&&echo 'export PATH=\"/opt/homebrew/opt/llvm/bin:$PATH\"' >> /Users/runner/.bash_profile" From 442be2cd7ff8fa525c767ad5018ecc323f72d848 Mon Sep 17 00:00:00 2001 From: xadupre Date: Sat, 15 Mar 2025 16:04:07 +0100 Subject: [PATCH 14/14] remove x86 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0239437f..c6d950a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -117,7 +117,7 @@ repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit # repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} || exit 0" [tool.cibuildwheel.macos] -archs = "x86_64 arm64" # or "universal2" for a single universal wheel +archs = "arm64" # or "universal2" for a single universal wheel environment = """ MACOSX_DEPLOYMENT_TARGET=14.0 LDFLAGS='-L$(brew --prefix libomp)/lib'