From c2f3e2d215fc639140ba4f5276dee78a4628c443 Mon Sep 17 00:00:00 2001 From: Xavier Dupre Date: Mon, 20 May 2024 11:40:39 +0200 Subject: [PATCH 01/13] Build on python 3.12 --- azure-pipelines.yml | 2 +- pyproject.toml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d9efe5d..1846681 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,7 +5,7 @@ jobs: strategy: matrix: Python311-Linux: - python.version: '3.11' + python.version: '3.12' maxParallel: 3 steps: diff --git a/pyproject.toml b/pyproject.toml index 2b1fecb..87cc6b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -108,7 +108,7 @@ manylinux-x86_64-image = "manylinux2014" [tool.cibuildwheel.linux] archs = ["x86_64"] build = "cp*" -skip = "cp36-* cp37-* cp38-* cp39-* cp312-* pypy* *musllinux*" +skip = "cp36-* cp37-* cp38-* cp39-* cp313-* pypy* *musllinux*" manylinux-x86_64-image = "manylinux2014" before-build = "pip install auditwheel-symbols abi3audit" build-verbosity = 1 @@ -118,12 +118,12 @@ repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit [tool.cibuildwheel.macos] archs = ["x86_64"] build = "cp*" -skip = "cp36-* cp37-* cp38-* cp39-* cp312-* pypy* pp*" +skip = "cp36-* cp37-* cp38-* cp39-* cp313-* pypy* pp*" [tool.cibuildwheel.windows] archs = ["AMD64"] build = "cp*" -skip = "cp36-* cp37-* cp38-* cp39-* cp312-* pypy*" +skip = "cp36-* cp37-* cp38-* cp39-* cp313-* pypy*" [tool.cython-lint] max-line-length = 88 From f920cca639eab48688b9123c31c831b0dc9f2511 Mon Sep 17 00:00:00 2001 From: Xavier Dupre Date: Mon, 20 May 2024 11:43:46 +0200 Subject: [PATCH 02/13] mac --- pyproject.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 87cc6b2..2583221 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -108,7 +108,7 @@ manylinux-x86_64-image = "manylinux2014" [tool.cibuildwheel.linux] archs = ["x86_64"] build = "cp*" -skip = "cp36-* cp37-* cp38-* cp39-* cp313-* pypy* *musllinux*" +skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy* *musllinux*" manylinux-x86_64-image = "manylinux2014" before-build = "pip install auditwheel-symbols abi3audit" build-verbosity = 1 @@ -118,12 +118,13 @@ repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit [tool.cibuildwheel.macos] archs = ["x86_64"] build = "cp*" -skip = "cp36-* cp37-* cp38-* cp39-* cp313-* pypy* pp*" +before-build = "brew install llvm libomp" +skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy* pp*" [tool.cibuildwheel.windows] archs = ["AMD64"] build = "cp*" -skip = "cp36-* cp37-* cp38-* cp39-* cp313-* pypy*" +skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy*" [tool.cython-lint] max-line-length = 88 From 8ad51c2258b42fe57f93a6b3efa210be02323708 Mon Sep 17 00:00:00 2001 From: Xavier Dupre Date: Mon, 20 May 2024 12:29:09 +0200 Subject: [PATCH 03/13] disable one test on mac --- .../test_LONG_search_images_torch.py | 3 +- mlinsights/ext_test_case.py | 33 +++++++++++++++++++ pyproject.toml | 4 +-- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/_unittests/ut_search_rank/test_LONG_search_images_torch.py b/_unittests/ut_search_rank/test_LONG_search_images_torch.py index 2fc6109..b89539f 100644 --- a/_unittests/ut_search_rank/test_LONG_search_images_torch.py +++ b/_unittests/ut_search_rank/test_LONG_search_images_torch.py @@ -7,10 +7,11 @@ from io import StringIO import pandas import numpy -from mlinsights.ext_test_case import ExtTestCase, unzip_files +from mlinsights.ext_test_case import ExtTestCase, unzip_files, skipif_ci_apple class TestSearchPredictionsImagesTorch(ExtTestCase): + @skipif_ci_apple("crash") def test_search_predictions_torch(self): from mlinsights.search_rank import SearchEnginePredictionImages diff --git a/mlinsights/ext_test_case.py b/mlinsights/ext_test_case.py index bcd4010..49e12d0 100644 --- a/mlinsights/ext_test_case.py +++ b/mlinsights/ext_test_case.py @@ -45,6 +45,39 @@ def call_f(self): return wrapper +def is_azure() -> bool: + "Tells if the job is running on Azure DevOps." + return os.environ.get("AZURE_HTTP_USER_AGENT", "undefined") != "undefined" + + +def is_windows() -> bool: + return sys.platform == "win32" + + +def is_apple() -> bool: + return sys.platform == "darwin" + + +def skipif_ci_windows(msg) -> Callable: + """ + Skips a unit test if it runs on :epkg:`azure pipeline` on :epkg:`Windows`. + """ + if is_windows() and is_azure(): + msg = f"Test does not work on azure pipeline (Windows). {msg}" + return unittest.skip(msg) + return lambda x: x + + +def skipif_ci_apple(msg) -> Callable: + """ + Skips a unit test if it runs on :epkg:`azure pipeline` on :epkg:`Windows`. + """ + if is_apple() and is_azure(): + msg = f"Test does not work on azure pipeline (Apple). {msg}" + return unittest.skip(msg) + return lambda x: x + + def measure_time( stmt: Union[str, Callable], context: Optional[Dict[str, Any]] = None, diff --git a/pyproject.toml b/pyproject.toml index 2583221..3a62f6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -147,10 +147,10 @@ disable_error_code = ["override", "index"] exclude = [".eggs", ".git", "build", "dist"] line-length = 88 -[tool.ruff.mccabe] +[tool.ruff.lint.mccabe] max-complexity = 10 -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] "_unittests/ut_plotting/test_dot.py" = ["E501"] "mlinsights/mlbatch/__init__.py" = ["F401"] "mlinsights/metrics/__init__.py" = ["F401"] From 9235fb054ccdc426cbf7291371bd96d7d5ffd1fe Mon Sep 17 00:00:00 2001 From: Xavier Dupre Date: Mon, 20 May 2024 13:05:18 +0200 Subject: [PATCH 04/13] switch architecture --- .github/workflows/check-urls.yml | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-urls.yml b/.github/workflows/check-urls.yml index e3fc14d..b348ab2 100644 --- a/.github/workflows/check-urls.yml +++ b/.github/workflows/check-urls.yml @@ -23,7 +23,7 @@ jobs: - uses: actions/checkout@v3 - name: urls-checker-code - uses: urlstechie/urlchecker-action@master + uses: urlstechie/urlchecker-action@main with: subfolder: mlinsights file_types: .md,.py,.rst,.ipynb @@ -35,7 +35,7 @@ jobs: # force_pass : true - name: urls-checker-docs - uses: urlstechie/urlchecker-action@master + uses: urlstechie/urlchecker-action@main with: subfolder: _doc file_types: .md,.py,.rst,.ipynb diff --git a/pyproject.toml b/pyproject.toml index 3a62f6c..492dfd0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -116,7 +116,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"] +archs = ["universal2"] build = "cp*" before-build = "brew install llvm libomp" skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy* pp*" From 78e5ac34bbdcf4083780e113d69dc81ca73233d1 Mon Sep 17 00:00:00 2001 From: Xavier Dupre Date: Mon, 20 May 2024 13:10:23 +0200 Subject: [PATCH 05/13] switch architecture --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 492dfd0..119fe49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -116,7 +116,7 @@ repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit # repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} || exit 0" [tool.cibuildwheel.macos] -archs = ["universal2"] +archs = ["arm64"] build = "cp*" before-build = "brew install llvm libomp" skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy* pp*" From da989b87d6b11762df3efa142cbd836f7f116459 Mon Sep 17 00:00:00 2001 From: Xavier Dupre Date: Mon, 20 May 2024 14:13:59 +0200 Subject: [PATCH 06/13] build --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 119fe49..492dfd0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -116,7 +116,7 @@ repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit # repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} || exit 0" [tool.cibuildwheel.macos] -archs = ["arm64"] +archs = ["universal2"] build = "cp*" before-build = "brew install llvm libomp" skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy* pp*" From 2bf30ed664126414754b7fa597b9e2108f8ab1af Mon Sep 17 00:00:00 2001 From: Xavier Dupre Date: Tue, 21 May 2024 15:28:28 +0200 Subject: [PATCH 07/13] update ci --- .github/workflows/wheels-mac.yml | 2 +- pyproject.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheels-mac.yml b/.github/workflows/wheels-mac.yml index 403f5a1..5c06eb0 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.10' + python-version: '3.11' - name: Install cibuildwheel run: python -m pip install cibuildwheel diff --git a/pyproject.toml b/pyproject.toml index 492dfd0..cdf2072 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -116,13 +116,13 @@ repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit # repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} || exit 0" [tool.cibuildwheel.macos] -archs = ["universal2"] +archs = ["arm64", "x86_64"] build = "cp*" before-build = "brew install llvm libomp" skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy* pp*" [tool.cibuildwheel.windows] -archs = ["AMD64"] +archs = ["x86_64"] build = "cp*" skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy*" From 949eb46fc21adffd2007e5b33055dac97a3a1ff4 Mon Sep 17 00:00:00 2001 From: Xavier Dupre Date: Tue, 21 May 2024 15:57:26 +0200 Subject: [PATCH 08/13] ci --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cdf2072..65c868f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -116,13 +116,13 @@ repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit # repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} || exit 0" [tool.cibuildwheel.macos] -archs = ["arm64", "x86_64"] +archs = ["arm64", "AMD64"] build = "cp*" before-build = "brew install llvm libomp" skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy* pp*" [tool.cibuildwheel.windows] -archs = ["x86_64"] +archs = ["AMD64"] build = "cp*" skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy*" From 6440575ccb8f1671fb17b7976b050f56727cb2d9 Mon Sep 17 00:00:00 2001 From: Xavier Dupre Date: Fri, 7 Jun 2024 14:48:14 +0200 Subject: [PATCH 09/13] update arch --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 65c868f..cfbdc3c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -116,7 +116,7 @@ repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} ; abi3audit # repair-wheel-command = "auditwheel-symbols --manylinux 2014 {wheel} || exit 0" [tool.cibuildwheel.macos] -archs = ["arm64", "AMD64"] +archs = ["arm64", "universal2"] build = "cp*" before-build = "brew install llvm libomp" skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy* pp*" From 037b7ff87d0b92224c9bd14ef8c7b52df2df1a48 Mon Sep 17 00:00:00 2001 From: Xavier Dupre Date: Thu, 20 Jun 2024 14:44:58 +0200 Subject: [PATCH 10/13] numpy Signed-off-by: Xavier Dupre --- CHANGELOGS.rst | 5 +++++ pyproject.toml | 10 ++++++---- requirements-dev.txt | 6 ++++-- requirements.txt | 5 +++-- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CHANGELOGS.rst b/CHANGELOGS.rst index 4fbdf49..6afdfa9 100644 --- a/CHANGELOGS.rst +++ b/CHANGELOGS.rst @@ -3,6 +3,11 @@ Change Logs =========== +0.5.1 +===== + +* :pr:`130`build with python 3.12, numpy 2.0 + 0.5.0 ===== diff --git a/pyproject.toml b/pyproject.toml index cfbdc3c..f99f70f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ dev = [ "clang-format", "cmakelang", "coverage", - "cython", + "cython>=3.0.10", "cython-lint", "flake8", "furo", @@ -48,10 +48,12 @@ dev = [ "joblib", "lightgbm", "matplotlib", + "numpy>=2.0", "onnx-array-api", "onnxruntime", "pandas", "psutil", + "pybind11>=2.12.0", "pytest", "pytest-cov", "ruff", @@ -69,10 +71,10 @@ dev = [ requires = [ "abi3audit; sys_platform == 'linux'", "auditwheel-symbols; sys_platform == 'linux'", - "Cython", + "Cython>=3.0.10", "cmake", - "numpy", - "pybind11", + "numpy>=2.0", + "pybind11>=2.12.0", "scikit-learn>=1.3.0", "scipy", "setuptools", diff --git a/requirements-dev.txt b/requirements-dev.txt index d77508d..d8a8ef7 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ chardet clang-format cmakelang coverage -cython>=3.0.5 +cython>=3.0.10 cython-lint furo; sys_platform == 'linux' ijson @@ -14,14 +14,16 @@ matplotlib memory_profiler>=0.55 notebook numba +numpy>=2.0 onnxruntime pandas_streaming -pybind11 +pybind11>=2.12.0 pytest pytest-cov pytest-subtests rstcheck[sphinx,toml] ruff +scikit-learn>=1.5.0 seaborn skl2onnx>=1.14.1 sphinx<7.2; sys_platform == 'linux' # furo still fails with sphinx==7.2.0 (issue unused furo.css) diff --git a/requirements.txt b/requirements.txt index 9822557..b389725 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ -cython>=3.0.5 -pybind11 +cython>=3.0.10 +numpy +pybind11>=2.12.0 scikit-learn>=1.3.0 From 2b8db88189631a661fc91b85aff617a76c19065d Mon Sep 17 00:00:00 2001 From: Xavier Dupre Date: Thu, 20 Jun 2024 14:46:36 +0200 Subject: [PATCH 11/13] upgrade version Signed-off-by: Xavier Dupre --- _doc/index.rst | 1 + mlinsights/__init__.py | 2 +- pyproject.toml | 2 +- setup.py | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/_doc/index.rst b/_doc/index.rst index 61b856f..e0881fb 100644 --- a/_doc/index.rst +++ b/_doc/index.rst @@ -98,4 +98,5 @@ Source are available at `sdpython/mlinsights `_ * `0.5.0 <../v0.5.0/index.html>`_ diff --git a/mlinsights/__init__.py b/mlinsights/__init__.py index aa2cdee..09e4d34 100644 --- a/mlinsights/__init__.py +++ b/mlinsights/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -__version__ = "0.5.0" +__version__ = "0.5.1" __author__ = "Xavier Dupré" __github__ = "https://github.com/sdpython/mlinsights" __url__ = "https://sdpython.github.io/doc/dev/mlinsights/" diff --git a/pyproject.toml b/pyproject.toml index f99f70f..392872f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ license = {file = "LICENSE.txt"} name = "mlinsights" readme = "README.rst" requires-python = ">=3.9" -version = "0.5.0" +version = "0.5.1" [project.urls] homepage = "https://sdpython.github.io/doc/mlinsights/dev/" diff --git a/setup.py b/setup.py index 8727a80..8293b85 100644 --- a/setup.py +++ b/setup.py @@ -670,7 +670,7 @@ def get_package_data(): setup( name="mlinsights", - version=get_version_str(here, "0.5.0"), + version=get_version_str(here, "0.5.1"), description=get_description(), long_description=get_long_description(here), author="Xavier Dupré", From a352dae946056af2563e26546c330b2259c97f59 Mon Sep 17 00:00:00 2001 From: Xavier Dupre Date: Thu, 20 Jun 2024 15:05:14 +0200 Subject: [PATCH 12/13] fix import issue --- mlinsights/mlbatch/pipeline_cache.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mlinsights/mlbatch/pipeline_cache.py b/mlinsights/mlbatch/pipeline_cache.py index edd3a47..b5aa75d 100644 --- a/mlinsights/mlbatch/pipeline_cache.py +++ b/mlinsights/mlbatch/pipeline_cache.py @@ -1,6 +1,10 @@ from sklearn.base import clone from sklearn.pipeline import Pipeline, _fit_transform_one -from sklearn.utils import _print_elapsed_time +try: + from sklearn.utils._user_interface import _print_elapsed_time +except ImportError: + # old scikit-learn + from sklearn.utils import _print_elapsed_time from sklearn.utils.validation import check_memory from .cache_model import MLCache From 14a3afe6c4ee4041dad47b131dc4eaf57439a04a Mon Sep 17 00:00:00 2001 From: xadupre Date: Sun, 8 Sep 2024 11:00:04 +0200 Subject: [PATCH 13/13] type --- mlinsights/ext_test_case.py | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/mlinsights/ext_test_case.py b/mlinsights/ext_test_case.py index cb8d441..32dc71d 100644 --- a/mlinsights/ext_test_case.py +++ b/mlinsights/ext_test_case.py @@ -580,36 +580,3 @@ def unzip_files( elif not info.filename.endswith("/"): files.append(tos) return files - - -def is_azure() -> bool: - "Tells if the job is running on Azure DevOps." - return os.environ.get("AZURE_HTTP_USER_AGENT", "undefined") != "undefined" - - -def is_windows() -> bool: - return sys.platform == "win32" - - -def is_apple() -> bool: - return sys.platform == "darwin" - - -def skipif_ci_windows(msg) -> Callable: - """ - Skips a unit test if it runs on :epkg:`azure pipeline` on :epkg:`Windows`. - """ - if is_windows() and is_azure(): - msg = f"Test does not work on azure pipeline (Windows). {msg}" - return unittest.skip(msg) - return lambda x: x - - -def skipif_ci_apple(msg) -> Callable: - """ - Skips a unit test if it runs on :epkg:`azure pipeline` on :epkg:`Windows`. - """ - if is_apple() and is_azure(): - msg = f"Test does not work on azure pipeline (Apple). {msg}" - return unittest.skip(msg) - return lambda x: x pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy