Skip to content

Commit 92a27d0

Browse files
dependabot[bot]jverbusclaude
authored
Upgrade ONNX to 1.21.0 and align dependencies (onnxruntime, numpy, Python >=3.11) (#83)
* Bump onnx from 1.17.0 to 1.21.0 in /isolation-forest-onnx Bumps [onnx](https://github.com/onnx/onnx) from 1.17.0 to 1.21.0. - [Release notes](https://github.com/onnx/onnx/releases) - [Changelog](https://github.com/onnx/onnx/blob/main/docs/Changelog-ml.md) - [Commits](onnx/onnx@v1.17.0...v1.21.0) --- updated-dependencies: - dependency-name: onnx dependency-version: 1.21.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> * Pin ONNX model IR version to 10 for onnxruntime compatibility onnx 1.21.0 defaults to IR version 13, which is unsupported by onnxruntime < 1.24.1. Since the model only uses opset 14, IR version 10 is sufficient and ensures broad onnxruntime compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Upgrade onnxruntime, numpy, and Python version for onnx 1.21.0 compatibility - Upgrade onnxruntime from 1.19.2/1.18.0 to 1.24.1 (supports IR version 13 that onnx 1.21.0 produces by default) - Upgrade numpy from 1.26.4 to 2.2.6 and fix np.trapz -> np.trapezoid (trapz was removed in numpy 2.0) - Update python_requires from >=3.9 to >=3.10 (required by onnx 1.21.0) - Remove the ir_version=10 pin since onnxruntime 1.24.1 natively supports IR version 13 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Align Python version in CI and Black config with python_requires >=3.10 - Update pypi-publish job from Python 3.9 to 3.10 - Update Black target-version from py39 to py310 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Pin ONNX model IR version to 10 for maximum runtime portability The model only uses opset 14, which is fully supported by IR version 10. Pinning avoids requiring onnxruntime >= 1.24.1 or other recent runtimes just to load the model, maximizing cross-platform compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Add explicit Python setup to the build job The build job runs Gradle which creates a Python venv for the isolation-forest-onnx tests. Without setup-python, it relies on whatever python3 the runner provides, which is implicit and fragile. Pin to 3.10 to match python_requires. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Raise minimum Python to 3.12 onnxruntime 1.24.x only ships Linux wheels for Python 3.11+, and 3.12 is the current ubuntu-latest default. Since this is a converter tool (not a foundational library), targeting 3.12 is a practical baseline that ensures all dependencies have prebuilt wheels. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Set python_requires to >=3.11 based on actual dependency floor onnxruntime 1.24.1 only ships wheels for Python 3.11+, making that the true minimum. CI remains on 3.12 (runner default with full wheel coverage), but the package contract should reflect what users can actually install, not what CI happens to run. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: James Verbus <james.verbus@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a97198b commit 92a27d0

6 files changed

Lines changed: 17 additions & 10 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ jobs:
7171
with:
7272
distribution: 'temurin'
7373
java-version: ${{ matrix.java-version }}
74+
- name: Set up Python
75+
uses: actions/setup-python@v6 # https://github.com/actions/setup-python
76+
with:
77+
python-version: '3.12'
7478
- name: Perform build
7579
env:
7680
SCALA_VERSION: ${{ matrix.scala-version }}
@@ -112,7 +116,7 @@ jobs:
112116
- name: Setup Python
113117
uses: actions/setup-python@v6 # https://github.com/actions/setup-python
114118
with:
115-
python-version: '3.9'
119+
python-version: '3.12'
116120
- name: Publish to PyPI
117121
run: ./gradlew publishPythonPackage
118122
env:

isolation-forest-onnx/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.black]
22
line-length = 88
3-
target-version = ['py39']
3+
target-version = ['py311']
44
exclude = '''
55
/(
66
venv
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
avro-python3==1.9.1
2-
numpy==1.26.4
3-
onnx==1.17.0
4-
onnxruntime==1.19.2
2+
numpy==2.2.6
3+
onnx==1.21.0
4+
onnxruntime==1.24.1
55
protobuf==5.29.6

isolation-forest-onnx/setup.cfg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ keywords = isolation forest, ONNX
1313
packages = isolationforestonnx
1414
package_dir =
1515
= src
16-
python_requires = >=3.9
16+
python_requires = >=3.11
1717
install_requires =
1818
avro_python3==1.9.1
19-
numpy==1.26.4
20-
onnx==1.17.0
21-
onnxruntime==1.18.0
19+
numpy==2.2.6
20+
onnx==1.21.0
21+
onnxruntime==1.24.1
2222
protobuf==5.29.6
2323

2424
[options.extras_require]

isolation-forest-onnx/src/isolationforestonnx/isolation_forest_converter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,9 @@ def convert(self) -> ModelProto:
161161
helper.make_opsetid("", 14),
162162
],
163163
)
164+
# Pin IR version for maximum portability across ONNX runtimes.
165+
# The model only uses opset 14, which is fully supported by IR 10.
166+
model.ir_version = 10
164167

165168
try:
166169
checker.check_model(model)

isolation-forest-onnx/test/test_isolation_forest_converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def _roc_auc_score(y_true, y_score):
6969
fpr = np.concatenate(([0], fpr))
7070

7171
# Compute the AUC using trapezoidal integration
72-
auc = np.trapz(tpr, fpr)
72+
auc = np.trapezoid(tpr, fpr)
7373

7474
return auc
7575

0 commit comments

Comments
 (0)