Skip to content

Build on python 3.12 #130

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 15 commits into from
Sep 8, 2024
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/check-urls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheels-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions CHANGELOGS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Change Logs
0.5.1
=====

* :pr:`130` numpy 2.0
* :pr:`132` builds against scikit-learn==1.5.0, python 3.12

0.5.0
Expand Down
1 change: 1 addition & 0 deletions _doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,5 @@ Source are available at `sdpython/mlinsights <https://github.com/sdpython/mlinsi
Older versions
++++++++++++++

* `0.5.1 <../v0.5.1/index.html>`_
* `0.5.0 <../v0.5.0/index.html>`_
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
strategy:
matrix:
Python311-Linux:
python.version: '3.11'
python.version: '3.12'
maxParallel: 3

steps:
Expand Down
66 changes: 33 additions & 33 deletions mlinsights/ext_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -547,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
20 changes: 11 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand All @@ -39,17 +39,19 @@ dev = [
"clang-format",
"cmakelang",
"coverage",
"cython",
"cython>=3.0.10",
"cython-lint",
"furo",
"isort",
"joblib",
"lightgbm",
"matplotlib",
"numpy>=2.0",
"onnx-array-api",
"onnxruntime",
"pandas",
"psutil",
"pybind11>=2.12.0",
"pytest",
"pytest-cov",
"ruff",
Expand All @@ -67,10 +69,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",
Expand Down Expand Up @@ -106,23 +108,23 @@ 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
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 = ["x86_64"]
archs = ["arm64", "universal2"]
build = "cp*"
skip = "cp36-* cp37-* cp38-* cp39-* cp313-* pypy* pp*"
skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* 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-* pypy*"
skip = "cp36-* cp37-* cp38-* cp39-* cp313-* cp314-* pypy*"

[tool.cython-lint]
max-line-length = 88
Expand Down
6 changes: 4 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ chardet
clang-format
cmakelang
coverage
cython>=3.0.5
cython>=3.0.10
cython-lint
furo; sys_platform == 'linux'
ijson
Expand All @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cython>=3.0.5
pybind11
cython>=3.0.10
numpy
pybind11>=2.12.0
scikit-learn>=1.3.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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é",
Expand Down
Loading