Skip to content

Commit 1035fdf

Browse files
authored
Use onnx-weekly in CI, remove dependency on onnxconveter-common (#1179)
* Use onnx-weekly in CI Signed-off-by: xadupre <xadupre@microsoft.com> * remove dependency on onnxconverter-common Signed-off-by: xadupre <xadupre@microsoft.com> * BOOL Signed-off-by: xadupre <xadupre@microsoft.com> * fix wrong import Signed-off-by: xadupre <xadupre@microsoft.com> * fix examples Signed-off-by: xadupre <xadupre@microsoft.com> --------- Signed-off-by: xadupre <xadupre@microsoft.com>
1 parent f99cdff commit 1035fdf

28 files changed

+1050
-279
lines changed

.github/workflows/linux-ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
documentation: 1
1414
numpy_version: '>=2.0'
1515
scipy_version: '>=1.7.0'
16-
onnx_version: 'onnx>=1.17.0'
16+
onnx_version: 'onnx-weekly'
1717
onnxrt_version: 'onnxruntime>=1.20.1'
1818
python_version: '3.12'
1919
- sklearn_version: '==1.5.2'
@@ -89,6 +89,9 @@ jobs:
8989
${{ runner.os }}-pip-
9090
${{ runner.os }}-
9191
92+
- name: Uninstall onnx
93+
run: pip uninstall -y onnx
94+
9295
- name: Install specific versions
9396
run: pip install "${{ matrix.onnx_version }}" "${{ matrix.onnxrt_version }}" "numpy${{ matrix.numpy_version }}" "scikit-learn${{ matrix.sklearn_version}}" "scipy${{ matrix.scipy_version }}"
9497

CHANGELOGS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## 1.19.0
44

5+
* Removes dependency on onnxconverter-common
6+
[#1179](https://github.com/onnx/sklearn-onnx/issues/1179)
57
* Implements converter for QuantileTransformer
68
[#1164](https://github.com/onnx/sklearn-onnx/issues/1164),
79
* Refactors KNNImputer converter with local function to match

docs/examples/plot_benchmark_pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from timeit import timeit
3030
from skl2onnx.helpers import compare_objects
3131
import onnxruntime as rt
32-
from onnxconverter_common.data_types import FloatTensorType
32+
from skl2onnx.common.data_types import FloatTensorType
3333
from skl2onnx import convert_sklearn
3434
import numpy as np
3535
import pandas as pd

docs/examples/plot_custom_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import os
3535
from onnx.tools.net_drawer import GetPydotGraph, GetOpNodeProducer
3636
import onnxruntime as rt
37-
from onnxconverter_common.onnx_ops import apply_identity, apply_cast, apply_greater
37+
from skl2onnx.common._apply_operation import apply_identity, apply_cast, apply_greater
3838
from skl2onnx import to_onnx, get_model_alias
3939
from skl2onnx.proto import onnx_proto
4040
from skl2onnx.common._registration import get_shape_calculator

docs/examples/plot_investigate_pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import pickle
3131
from skl2onnx.helpers import collect_intermediate_steps
3232
import onnxruntime as rt
33-
from onnxconverter_common.data_types import FloatTensorType
33+
from skl2onnx.common.data_types import FloatTensorType
3434
from skl2onnx import convert_sklearn
3535
import numpy as np
3636
import pandas as pd

docs/tests/test_documentation_examples.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ def add_test_methods(cls):
8383
}:
8484
reason = "unstable, xgboost not ready"
8585

86+
if not reason and name in {"plot_weird_pandas_and_hash.py"}:
87+
try:
88+
import onnxruntime_extensions # noqa: F401
89+
except ImportError:
90+
reason = "onnxruntime_extensions not available"
91+
8692
if reason:
8793

8894
@unittest.skip(reason)

docs/tutorial/plot_jcustom_syntax.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"""
2727

2828
from skl2onnx.common.data_types import guess_proto_type
29-
from onnxconverter_common.onnx_ops import apply_sub
29+
from skl2onnx.common._apply_operation import apply_sub
3030
from onnxruntime import InferenceSession
3131
from skl2onnx import update_registered_converter
3232
from skl2onnx import to_onnx
@@ -128,7 +128,6 @@ def decorrelate_transformer_converter(scope, operator, container):
128128

129129
op_name = scope.get_unique_operator_name("sub")
130130
sub_name = scope.get_unique_variable_name("sub")
131-
# This function is defined in package onnxconverter_common.
132131
# Most common operators can be added to the graph with
133132
# these functions. It handles the case when specifications
134133
# changed accross opsets (a parameter becomes an input

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,14 @@ select = [
4848
"**/__init__.py" = ["F401"]
4949
"docs/**" = ["B018", "E402"]
5050
"skl2onnx/algebra/onnx_ops.py" = ["F821"]
51-
"skl2onnx/common/_apply_operation.py" = ["F403", "F405"]
51+
"skl2onnx/common/_apply_operation.py" = ["F403", "F405", "RUF005"]
52+
"skl2onnx/common/data_types.py" = ["ISC003"]
5253
"tests/**" = [
5354
"B007", "B019", "B028", "B904",
5455
"C401", "C403", "C405", "C406", "C408", "C413", "C416", "C417",
5556
"PIE808", "PIE810",
56-
"RUF005", "RUF012", "RUF010", "RUF015",
57-
"SIM102", "SIM105", "SIM113", "SIM114", "SIM118", "SIM300",
57+
"RUF005", "RUF012", "RUF010", "RUF015", "RUF046", "RUF051",
58+
"SIM102", "SIM105", "SIM113", "SIM114", "SIM118", "SIM300", "SIM905",
5859
"UP015", "UP018", "UP028", "UP030", "UP031", "UP032"
5960
]
6061
"tests_onnxmltools/**" = ["B028", "B904", "C403", "C408", "C413", "C417", "PIE808", "PIE810", "RUF010", "RUF015", "SIM102", "SIM105", "SIM118", "UP015", "UP028", "UP030", "UP031", "UP032"]

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
onnx>=1.2.1
22
scikit-learn>=1.1
3-
onnxconverter-common>=1.7.0

skl2onnx/_supported_operators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ def build_sklearn_operator_name_map():
529529
}
530530
)
531531
if None in res:
532-
del res[None]
532+
del res[None] # noqa: RUF051
533533
return res
534534

535535

0 commit comments

Comments
 (0)