diff --git a/.azure-pipelines/linux-CI-nightly.yml b/.azure-pipelines/linux-CI-nightly.yml deleted file mode 100644 index c232ae702..000000000 --- a/.azure-pipelines/linux-CI-nightly.yml +++ /dev/null @@ -1,127 +0,0 @@ -# Python package -# Create and test a Python package on multiple Python versions. -# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/python - -trigger: -- master - -jobs: - -- job: 'Test' - pool: - vmImage: 'ubuntu-latest' - strategy: - matrix: - Py39-Onnx1102-SkLatest: - python.version: '3.9' - numpy.version: '>=1.18.3' - onnx.version: '==1.10.2' - onnxrt.version: '-i https://test.pypi.org/simple/ ort-nightly' - sklearn.version: '>=1.0' - Py39-Onnx190-SkLatest: - python.version: '3.9' - numpy.version: '>=1.18.3' - onnx.version: '==1.9.0' - onnxrt.version: '-i https://test.pypi.org/simple/ ort-nightly' - sklearn.version: '>=1.0' - Py39-Onnx181-SkLatest: - python.version: '3.9' - numpy.version: '>=1.18.3' - onnx.version: '==1.8.1' - onnxrt.version: '-i https://test.pypi.org/simple/ ort-nightly' - sklearn.version: '>=1.0' - Py38-Onnx170-Sk0242: - python.version: '3.8' - numpy.version: '>=1.18.3' - onnx.version: '==1.7.0' - onnxrt.version: '-i https://test.pypi.org/simple/ ort-nightly' - sklearn.version: '==0.24.2' - Py37-Onnx160-Sk0232: - python.version: '3.7' - numpy.version: '==1.18.1' - onnx.version: '==1.6.0' - onnxrt.version: '-i https://test.pypi.org/simple/ ort-nightly' - sklearn.version: '==0.23.2' - maxParallel: 3 - - steps: - - script: | - sudo install -d -m 0777 /home/vsts/.conda/envs - displayName: Fix Conda permissions - - - task: CondaEnvironment@1 - inputs: - createCustomEnvironment: true - environmentName: 'py$(python.version)' - packageSpecs: 'python=$(python.version)' - - - script: | - conda config --set always_yes yes --set changeps1 no - conda install -c conda-forge numpy$(numpy.version) - conda install protobuf - python -m pip install --upgrade pip - displayName: 'Install environment' - - - script: | - conda install numpy$(numpy.version) - pip install openpyxl cerberus - displayName: 'install numpy' - - - script: | - conda install scikit-learn$(sklearn.version) - displayName: 'install scikit-learn' - - - script: | - pip install onnx$(onnx.version) - displayName: 'install onnx' - - - script: | - pip install flatbuffers - pip install $(onnxrt.version) - displayName: 'install onnxruntime' - - - script: | - pip install -r requirements.txt - git clone https://github.com/microsoft/onnxconverter-common - cd onnxconverter-common - pip install -e . - cd .. - pip install -r requirements-dev.txt - pip install pytest - displayName: 'install requirements' - - - script: | - pip install -e . - displayName: 'install' - - - script: | - echo "---------------" - pip show numpy - echo "---------------" - pip show onnx - echo "---------------" - pip show onnxruntime - echo "---------------" - pip show onnxconverter-common - echo "---------------" - pip show scikit-learn - echo "---------------" - displayName: 'version' - - - script: | - pytest tests --durations=0 --basetemp=temp --doctest-modules --junitxml=junit/test-results.xml - displayName: 'pytest' - - - script: | - python -m pip install openpyxl - python tests/benchmark.py - displayName: 'benchmark' - - - task: PublishTestResults@2 - inputs: - testResultsFiles: '**/test-results.xml' - testCoverageFiles: 'htmlcov/**' - testBenchmarkFiles: 'TESTDUMP/*.xlsx' - testRunTitle: 'Python $(python.version)' - condition: succeededOrFailed() diff --git a/.azure-pipelines/linux-conda-CI.yml b/.azure-pipelines/linux-conda-CI.yml deleted file mode 100644 index f5bdae960..000000000 --- a/.azure-pipelines/linux-conda-CI.yml +++ /dev/null @@ -1,395 +0,0 @@ -# Python package -# Create and test a Python package on multiple Python versions. -# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/python - -trigger: -- master - -jobs: - -- job: 'CI_Linux' - pool: - vmImage: 'ubuntu-latest' - strategy: - matrix: - - Py311-Onnx160-Rt171-Skl140: - do.bench: '0' - python.version: '3.11' # onnxruntime-extensions needs to be update to switch to 3.12 - numpy.version: '>=1.21.1' - scipy.version: '>=1.7.0' - onnx.version: 'onnx==1.16.0' # -i https://test.pypi.org/simple/ onnx==1.15.0rc2' - onnx.target_opset: '' - onnxrt.version: 'onnxruntime==1.17.1' - sklearn.version: '>=1.4.0' - pandas.version: '' - lgbm.version: '' - onnxcc.version: '>=1.8.1' - run.example: '1' - - Py311-Onnx150-Rt170-Skl140: - do.bench: '0' - python.version: '3.11' # onnxruntime-extensions needs to be update to switch to 3.12 - numpy.version: '>=1.21.1' - scipy.version: '>=1.7.0' - onnx.version: 'onnx==1.15.0' # -i https://test.pypi.org/simple/ onnx==1.15.0rc2' - onnx.target_opset: '' - onnxrt.version: 'onnxruntime==1.17.0' - sklearn.version: '>=1.4.0' - pandas.version: '' - lgbm.version: '' - onnxcc.version: '>=1.8.1' - run.example: '0' - - Py311-Onnx150-Rt163-Skl140: - do.bench: '0' - python.version: '3.11' - numpy.version: '>=1.21.1' - scipy.version: '>=1.7.0' - onnx.version: 'onnx==1.15.0' # -i https://test.pypi.org/simple/ onnx==1.15.0rc2' - onnx.target_opset: '' - onnxrt.version: 'onnxruntime==1.16.3' - sklearn.version: '==1.4.0' - pandas.version: '' - lgbm.version: '' - onnxcc.version: '>=1.8.1' - run.example: '0' - - Py311-Onnx150-Rt161-Skl132: - do.bench: '0' - python.version: '3.11' - numpy.version: '>=1.21.1' - scipy.version: '>=1.7.0' - onnx.version: 'onnx==1.15.0' # -i https://test.pypi.org/simple/ onnx==1.15.0rc2' - onnx.target_opset: '' - onnxrt.version: 'onnxruntime==1.16.1' - sklearn.version: '==1.3.2' - pandas.version: '' - lgbm.version: '' - onnxcc.version: '>=1.8.1' - run.example: '0' - - Py311-Onnx141-Rt160-Skl131: - do.bench: '0' - python.version: '3.11' - numpy.version: '>=1.21.1' - scipy.version: '>=1.7.0' - onnx.version: 'onnx==1.14.1' - onnx.target_opset: '' - onnxrt.version: 'onnxruntime==1.16.0' - sklearn.version: '==1.3.1' - pandas.version: '' - lgbm.version: '' - onnxcc.version: '>=1.8.1' - run.example: '0' - - Py311-Onnx140-Rt151-Skl130: - do.bench: '0' - python.version: '3.11' - numpy.version: '>=1.21.1' - scipy.version: '>=1.7.0' - onnx.version: 'onnx==1.14.0' - onnx.target_opset: '' - onnxrt.version: 'onnxruntime==1.15.1' - sklearn.version: '==1.3.0' - pandas.version: '' - lgbm.version: '' - onnxcc.version: '>=1.8.1' - run.example: '0' - - Py310-Onnx140-Rt140-Skl122: - do.bench: '0' - python.version: '3.10' - numpy.version: '>=1.21.1' - scipy.version: '>=1.7.0' - onnx.version: 'onnx==1.14.1' - onnx.target_opset: '' - onnxrt.version: 'onnxruntime==1.14.0' - sklearn.version: '==1.2.2' - pandas.version: '' - lgbm.version: '' - onnxcc.version: '>=1.8.1' - run.example: '0' - - Py310-Onnx130-Rt140-Skl121: - do.bench: '0' - python.version: '3.10' - numpy.version: '>=1.21.2' - scipy.version: '>=1.7.0' - onnx.version: 'onnx==1.13.0' - onnx.target_opset: '' - onnxrt.version: 'onnxruntime==1.14.0' - sklearn.version: '==1.2.1' - pandas.version: '' - lgbm.version: '' - onnxcc.version: '>=1.8.1' - run.example: '0' - - Py310-Onnx130-Rt131-Skl120: - do.bench: '0' - python.version: '3.10' - numpy.version: '>=1.21.0' - scipy.version: '>=1.7.0' - onnx.version: 'onnx==1.13.0' - onnx.target_opset: '' - onnxrt.version: 'onnxruntime==1.13.1' - sklearn.version: '==1.2.0' - pandas.version: '' - lgbm.version: '' - onnxcc.version: '>=1.8.1' - run.example: '0' - - Py310-Onnx120-Rt131-Skl120: - do.bench: '0' - python.version: '3.10' - numpy.version: '>=1.21.0' - scipy.version: '>=1.7.0' - onnx.version: 'onnx==1.12.0' - onnx.target_opset: '' - onnxrt.version: 'onnxruntime==1.13.1' - sklearn.version: '==1.2.0' - pandas.version: '' - lgbm.version: '' - onnxcc.version: '>=1.8.1' - run.example: '0' - - Py310-Onnx120-Rt1201-Skl11: - do.bench: '0' - python.version: '3.10' - numpy.version: '>=1.21.0' - scipy.version: '>=1.7.0' - onnx.version: 'onnx==1.12.0' - onnx.target_opset: '' - onnxrt.version: 'onnxruntime==1.12.1' - sklearn.version: '==1.1.3' - pandas.version: '' - lgbm.version: '' - onnxcc.version: '>=1.8.1' - run.example: '0' - - Py39-Onnx120-Rt1111-Skl11: - do.bench: '0' - python.version: '3.9' - numpy.version: '>=1.21.0,<1.23.0' - scipy.version: '>=1.7.0' - onnx.version: 'onnx==1.12.0' - onnx.target_opset: '' - onnxrt.version: 'onnxruntime==1.11.1' - sklearn.version: '==1.1.3' - pandas.version: '' - lgbm.version: '' - onnxcc.version: '>=1.8.1' - run.example: '0' - Py39-Onnx1110-Rt1111-Skl11: - do.bench: '0' - python.version: '3.9' - numpy.version: '>=1.21.0,<1.23.0' - scipy.version: '>=1.7.0' - onnx.version: 'onnx==1.11.0' - onnx.target_opset: '' - onnxrt.version: 'onnxruntime==1.11.1' - sklearn.version: '==1.1.3' - pandas.version: '' - lgbm.version: '' - onnxcc.version: '>=1.8.1' - run.example: '0' - - maxParallel: 3 - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - addToPath: true - architecture: 'x64' - displayName: 'Use Python $(python.version)' - - - script: | - sudo apt-get install -y language-pack-en - sudo locale-gen en_US.UTF-8 - sudo update-locale LANG=en_US.UTF-8 - displayName: 'Install packages' - - - script: | - pip install "numpy$(numpy.version)" - pip install "scipy$(scipy.version)" - pip install protobuf - python -m pip install --upgrade pip - displayName: 'Install environment' - - - script: | - if [ '$(sklearn.version)' == 'git' ] - then - git clone https://github.com/scikit-learn/scikit-learn.git --recursive - python setup.py install - else - pip install "scikit-learn$(sklearn.version)" - fi - displayName: 'install scikit-learn' - - - script: | - pip install $(onnx.version) $(onnxrt.version) - displayName: 'install onnxruntime, onnx' - - - script: | - if [ '$(onnxcc.version)' == 'git' ] - then - pip install git+https://github.com/microsoft/onnxconverter-common --no-deps - else - pip install onnxconverter-common$(onnxcc.version) --no-deps - fi - displayName: 'install onnxconverter-common' - - - script: | - pip install -r requirements.txt - pip install -r requirements-dev.txt - displayName: 'install requirements' - - - script: | - pip show onnx - displayName: 'onnx version' - - - script: | - pip install $(onnx.version) $(onnxrt.version) "numpy$(numpy.version)" scikit-learn$(sklearn.version) scipy$(scipy.version) "pandas$(pandas.version)" - displayName: install onnxruntime, onnx, numpy, scikit-learn, pandas again # to make sure the proper version is installed - - - script: | - pip install -e . - displayName: 'install' - - - script: | - echo "---------------" - pip show numpy - echo "---------------" - pip show pandas - echo "---------------" - pip show scipy - echo "---------------" - pip show pandas - echo "---------------" - pip show onnx - echo "---------------" - pip show onnxruntime - echo "---------------" - pip show onnxconverter-common - echo "---------------" - pip show scikit-learn - echo "---------------" - pip show onnxmltools - echo "---------------" - displayName: 'version' - - - script: | - if [ '$(onnx.target_opset)' != '' ] - then - export TEST_TARGET_OPSET="$(onnx.target_opset)" - fi - cd tests - python -c "from numpy import __version__;print('numpy', __version__)" - python -c "from pandas import __version__;print('pandas', __version__)" - python -c "from scipy import __version__;print('scipy', __version__)" - python -c "from sklearn import __version__;print('sklearn', __version__)" - python -c "from onnxruntime import __version__;print('onnxruntime', __version__)" - python -c "from onnx import __version__;print('onnx', __version__)" - python -c "from skl2onnx import __max_supported_opset__;print('__max_supported_opset__', __max_supported_opset__)" - python -c "import test_utils;print('max_onnxruntime_opset', test_utils.max_onnxruntime_opset())" - python -c "import test_utils;print('TARGET OPSET, IR', test_utils.TARGET_OPSET, test_utils.TARGET_IR)" - python -c "import onnx.defs;print('onnx_opset_version', onnx.defs.onnx_opset_version())" - cd .. - displayName: 'target_opset' - - - script: | - if [ '$(onnx.target_opset)' != '' ] - then - export TEST_TARGET_OPSET="$(onnx.target_opset)" - fi - pytest tests --maxfail=10 --durations=0 --basetemp=temp --doctest-modules --junitxml=junit/test-results.xml - displayName: 'pytest' - - - script: | - # some of this is triggering the following error when importing scipy on python 3.10 - # ImportError: /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' - conda install -c conda-forge "lightgbm${lgbm.version}" "xgboost<2" --no-deps - pip install hummingbird-ml hummingbird "xgboost<2" lightgbm - pip install --no-deps git+https://github.com/microsoft/onnxconverter-common.git - pip install onnxmltools - displayName: 'install onnxmltools' - condition: eq(variables['run.example'], '1') - - - script: | - if [ '$(onnx.target_opset)' != '' ] - then - export TEST_TARGET_OPSET="$(onnx.target_opset)" - fi - pytest tests_onnxmltools --durations=0 --basetemp=temp --maxfail=5 - displayName: 'pytest-onnxmltools' - condition: eq(variables['run.example'], '1') - - - script: | - python -m pip install ruff - ruff skl2onnx tests tests_onnxmltools - displayName: 'ruff' - - - script: | - if [ '$(onnx.target_opset)' != '' ] - then - export TEST_TARGET_OPSET="$(onnx.target_opset)" - fi - if [ '$(do.bench)' == '1' ] - then - pip install openpyxl - coverage run --include=skl2onnx/** tests/benchmark.py - coverage report -m - coverage html - fi - displayName: 'coverage' - - - script: | - pip install -r docs/requirements.txt - pip uninstall -y skl2onnx - python setup.py install - pip install --no-deps git+https://github.com/microsoft/onnxconverter-common.git - pip install --no-deps git+https://github.com/onnx/onnxmltools.git - displayName: 'install for documentation' - condition: eq(variables['run.example'], '1') - - - script: | - if [ '$(onnx.target_opset)' != '' ] - then - export TEST_TARGET_OPSET="$(onnx.target_opset)" - fi - pytest docs/tests --durations=0 --basetemp=temp --doctest-modules -v -v --maxfail=5 - displayName: 'run documentation examples' - condition: eq(variables['run.example'], '1') - - # dot cannot be found but is missing to build the documentation - #- script: | - # if [ '$(onnx.target_opset)' != '' ] - # then - # export TEST_TARGET_OPSET="$(onnx.target_opset)" - # fi - # conda install -c anaconda graphviz - # python -m sphinx -j2 -v -N -T -b html -d build/doctrees docs dist/html - # displayName: 'build documentation' - # condition: eq(variables['run.example'], '1') - - - script: | - if [ '$(onnx.target_opset)' != '' ] - then - export TEST_TARGET_OPSET="$(onnx.target_opset)" - fi - if [ '$(do.bench)' == '1' ] - then - python tests/benchmark.py - fi - displayName: 'benchmark' - condition: eq(variables['run.example'], '0') - - - task: PublishTestResults@2 - inputs: - testResultsFiles: '**/test-results.xml' - testCoverageFiles: 'htmlcov/**' - testBenchmarkFiles: 'TESTDUMP/*.xlsx' - testRunTitle: 'Python $(python.version)' - condition: succeededOrFailed() diff --git a/.azure-pipelines/win32-CI-nightly.yml b/.azure-pipelines/win32-CI-nightly.yml deleted file mode 100644 index 3206260fc..000000000 --- a/.azure-pipelines/win32-CI-nightly.yml +++ /dev/null @@ -1,128 +0,0 @@ -# Python package -# Create and test a Python package on multiple Python versions. -# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/python - -trigger: -- master - -jobs: - -- job: 'Test' - pool: - vmImage: 'windows-latest' - strategy: - matrix: - Py39-Onnx1102-nightlyRT-SkLatest: - python.version: '3.9' - onnx.version: 'onnx==1.10.2' - numpy.version: 'numpy>=1.18.1' - scipy.version: 'scipy' - onnxrt.version: '-i https://test.pypi.org/simple/ ort-nightly' - sklearn.version: '>=1.0' - Py39-Onnx190-nightlyRT-SkLatest: - python.version: '3.9' - onnx.version: 'onnx==1.9.1' - numpy.version: 'numpy>=1.18.1' - scipy.version: 'scipy' - onnxrt.version: '-i https://test.pypi.org/simple/ ort-nightly' - sklearn.version: '>=1.0' - Py39-Onnx180-nightlyRT-SkLatest: - python.version: '3.9' - onnx.version: 'onnx==1.8.1' - numpy.version: 'numpy>=1.18.1' - scipy.version: 'scipy' - onnxrt.version: '-i https://test.pypi.org/simple/ ort-nightly' - sklearn.version: '>=1.0' - Py38-Onnx170-nightlyRT-Sk0242: - python.version: '3.8' - onnx.version: 'onnx==1.7.0' - numpy.version: 'numpy>=1.18.1' - scipy.version: 'scipy' - onnxrt.version: '-i https://test.pypi.org/simple/ ort-nightly' - sklearn.version: '==0.24.2' - Py37-Onnx160-nightlyRT-Npy1180-Sk0232: - python.version: '3.7' - onnx.version: 'onnx==1.6.0' - numpy.version: 'numpy==1.18.1' - scipy.version: 'scipy' - onnxrt.version: '-i https://test.pypi.org/simple/ ort-nightly' - sklearn.version: '==0.23.2' - maxParallel: 3 - - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - architecture: 'x64' - - - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" - displayName: Add conda to PATH - - - script: conda create --yes --quiet --name py$(python.version) -c conda-forge python=$(python.version) protobuf - displayName: Create Anaconda environment - - - script: | - call activate py$(python.version) - python -m pip install --upgrade pip - conda install $(numpy.version) $(scipy.version) - pip install $(onnx.version) - pip install openpyxl cerberus - displayName: 'Install numpy, scipy, onnx' - - - script: | - call activate py$(python.version) - pip install -r requirements.txt - git clone https://github.com/microsoft/onnxconverter-common - cd onnxconverter-common - pip install -e . - cd .. - pip install -r requirements-dev.txt - pip install pytest - displayName: 'install requirements' - - - script: | - call activate py$(python.version) - pip install $(onnx.version) - pip install flatbuffers - pip install $(onnxrt.version) - displayName: 'install onnx, onnxruntime' - - - script: | - call activate py$(python.version) - conda install scikit-learn$(sklearn.version) - displayName: 'install scikit-learn' - - - script: | - call activate py$(python.version) - pip install -e . - displayName: 'install skl2onnx' - - - script: | - call activate py$(python.version) - python -c "import numpy;print('numpy:',numpy.__version__)" - python -c "import scipy;print('scipy:',scipy.__version__)" - python -c "import sklearn;print('sklearn:',sklearn.__version__)" - python -c "import onnx;print('onnx:',onnx.__version__)" - python -c "import onnxconverter_common;print('onnxconverter-common:',onnxconverter_common.__version__)" - python -c "import onnxruntime;print('onnxruntime:',onnxruntime.__version__)" - displayName: 'version' - - - script: | - call activate py$(python.version) - pytest tests --durations=0 --basetemp=temp --doctest-modules --junitxml=junit/test-results.xml - displayName: 'pytest' - - - script: | - call activate py$(python.version) - python -m pip install openpyxl - python tests/benchmark.py - displayName: 'benchmark' - - - task: PublishTestResults@2 - inputs: - testResultsFiles: '**/test-results.xml' - testCoverageFiles: 'htmlcov/**' - testBenchmarkFiles: 'TESTDUMP/*.xlsx' - testRunTitle: 'Python $(python.version)' - condition: succeededOrFailed() diff --git a/.azure-pipelines/win32-conda-CI.yml b/.azure-pipelines/win32-conda-CI.yml deleted file mode 100644 index 6d9952f9f..000000000 --- a/.azure-pipelines/win32-conda-CI.yml +++ /dev/null @@ -1,230 +0,0 @@ -# Python package -# Create and test a Python package on multiple Python versions. -# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/python - -trigger: -- master - -jobs: - -- job: 'CI_Windows' - pool: - vmImage: 'windows-latest' - strategy: - matrix: - Py311-Onnx160-Rt171-Skl140: - python.version: '3.11' # onnxruntime-extensions needs to be update to switch to 3.12 - onnx.version: 'onnx==1.16.0' # '-i https://test.pypi.org/simple/ onnx==1.15.0rc2' - onnx.target_opset: '' - numpy.version: 'numpy>=1.22.3' - scipy.version: 'scipy' - onnxrt.version: 'onnxruntime==1.17.1' - onnxcc.version: 'onnxconverter-common>=1.8.1' - sklearn.version: '>=1.4.0' - Py311-Onnx150-Rt170-Skl140: - python.version: '3.11' # onnxruntime-extensions needs to be update to switch to 3.12 - onnx.version: 'onnx==1.15.0' # '-i https://test.pypi.org/simple/ onnx==1.15.0rc2' - onnx.target_opset: '' - numpy.version: 'numpy>=1.22.3' - scipy.version: 'scipy' - onnxrt.version: 'onnxruntime==1.17.0' - onnxcc.version: 'onnxconverter-common>=1.8.1' - sklearn.version: '>=1.4.0' - Py311-Onnx150-Rt163-Skl140: - python.version: '3.11' - onnx.version: 'onnx==1.15.0' # '-i https://test.pypi.org/simple/ onnx==1.15.0rc2' - onnx.target_opset: '' - numpy.version: 'numpy>=1.22.3' - scipy.version: 'scipy' - onnxrt.version: 'onnxruntime==1.16.3' - onnxcc.version: 'onnxconverter-common>=1.8.1' - sklearn.version: '==1.4.0' - Py311-Onnx150-Rt163-Skl131: - python.version: '3.11' - onnx.version: 'onnx==1.15.0' - onnx.target_opset: '' - numpy.version: 'numpy>=1.22.3' - scipy.version: 'scipy' - onnxrt.version: 'onnxruntime==1.16.1' - onnxcc.version: 'onnxconverter-common>=1.8.1' - sklearn.version: '==1.3.1' - Py311-Onnx141-Rt160-Skl131: - python.version: '3.11' - onnx.version: 'onnx==1.14.1' - onnx.target_opset: '' - numpy.version: 'numpy>=1.22.3' - scipy.version: 'scipy' - onnxrt.version: 'onnxruntime==1.16.0' - onnxcc.version: 'onnxconverter-common>=1.8.1' - sklearn.version: '>=1.3.1' - Py311-Onnx140-Rt151-Skl130: - python.version: '3.11' - onnx.version: 'onnx==1.14.0' - onnx.target_opset: '' - numpy.version: 'numpy>=1.22.3' - scipy.version: 'scipy' - onnxrt.version: 'onnxruntime==1.15.1' - onnxcc.version: 'onnxconverter-common>=1.8.1' - sklearn.version: '==1.3.0' - Py310-Onnx140-Rt140-Skl122: - python.version: '3.10' - onnx.version: 'onnx==1.14.1' - onnx.target_opset: '' - numpy.version: 'numpy>=1.22.3' - scipy.version: 'scipy' - onnxrt.version: 'onnxruntime==1.14.0' - onnxcc.version: 'onnxconverter-common>=1.8.1' - sklearn.version: '==1.2.2' - Py310-Onnx130-Rt140-Skl121: - python.version: '3.10' - onnx.version: 'onnx==1.13.0' - onnx.target_opset: '' - numpy.version: 'numpy>=1.22.3' - scipy.version: 'scipy' - onnxrt.version: 'onnxruntime==1.14.0' - onnxcc.version: 'onnxconverter-common>=1.8.1' - sklearn.version: '==1.2.2' - Py310-Onnx130-Rt131-Skl120: - python.version: '3.10' - onnx.version: 'onnx==1.13.0' - onnx.target_opset: '' - numpy.version: 'numpy>=1.22.3' - scipy.version: 'scipy' - onnxrt.version: 'onnxruntime==1.13.1' - onnxcc.version: 'onnxconverter-common>=1.8.1' - sklearn.version: '==1.2.0' - Py310-Onnx120-Rt131-Skl120: - python.version: '3.10' - onnx.version: 'onnx==1.12.0' - onnx.target_opset: '' - numpy.version: 'numpy>=1.22.3' - scipy.version: 'scipy' - onnxrt.version: 'onnxruntime==1.13.1' - onnxcc.version: 'onnxconverter-common>=1.8.1' - sklearn.version: '==1.2.0' - Py310-Onnx120-Rt120-Skl11: - python.version: '3.10' - onnx.version: 'onnx==1.12.0' - onnx.target_opset: '' - numpy.version: 'numpy>=1.22.3' - scipy.version: 'scipy' - onnxrt.version: 'onnxruntime==1.12.0' - onnxcc.version: 'onnxconverter-common>=1.8.1' - sklearn.version: '==1.1.3' - Py39-Onnx120-Rt1111-Skl11: - python.version: '3.9' - onnx.version: 'onnx==1.12.0' - onnx.target_opset: '' - numpy.version: 'numpy>=1.22.3' - scipy.version: 'scipy' - onnxrt.version: 'onnxruntime==1.11.1' - onnxcc.version: 'onnxconverter-common>=1.8.1' - sklearn.version: '==1.1.3' - Py39-Onnx1110-Rt1111-Skl11: - python.version: '3.9' - onnx.version: 'onnx==1.11.0' - onnx.target_opset: '' - numpy.version: 'numpy>=1.22.3' - scipy.version: 'scipy' - onnxrt.version: 'onnxruntime==1.11.1' - onnxcc.version: 'onnxconverter-common>=1.8.1' - sklearn.version: '==1.1.3' - - maxParallel: 3 - - steps: - - powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts" - displayName: Add conda to PATH - - - script: conda create --yes --quiet --name skl2onnxEnvironment $(numpy.version) "$(scipy.version)" pandas python=$(python.version) pytest - displayName: Create Anaconda environment - - - script: | - call activate skl2onnxEnvironment - python -m pip install --upgrade pip - conda install -y -c conda-forge protobuf - displayName: 'Install protobuf' - - - script: | - call activate skl2onnxEnvironment - python -m pip install typing-extensions>=3.6.2.1 - python -m pip install $(onnx.version) - displayName: 'Install onnx' - - - script: | - call activate skl2onnxEnvironment - python -m pip install $(onnxrt.version) - displayName: 'Install onnxruntime' - - - script: | - call activate skl2onnxEnvironment - python -c "import numpy" - displayName: 'check numpy' - - - script: | - call activate skl2onnxEnvironment - # latest version of scikit-learn are not available on conda - pip install scikit-learn$(sklearn.version) - displayName: 'install scikit-learn' - - - script: | - call activate skl2onnxEnvironment - python -c "import numpy" - displayName: 'check numpy' - - - script: | - call activate skl2onnxEnvironment - python -m pip install ruff - ruff skl2onnx tests tests_onnxmltools - displayName: 'ruff' - - - script: | - call activate skl2onnxEnvironment - pip install $(onnxcc.version) --no-deps - displayName: 'install onnxconverter-common' - - - script: | - call activate skl2onnxEnvironment - pip install -r requirements.txt - pip install -r requirements-dev.txt - displayName: 'install requirements' - - - script: | - call activate skl2onnxEnvironment - pip install -e . - displayName: 'install skl2onnx' - - - script: | - call activate skl2onnxEnvironment - python -c "import numpy" - displayName: 'check numpy' - - - script: | - call activate skl2onnxEnvironment - if "$(onnx.target_opset)" neq "" set TEST_TARGET_OPSET=$(onnx.target_opset) - cd tests - python -c "from numpy import __version__;print('numpy', __version__)" - python -c "from scipy import __version__;print('scipy', __version__)" - python -c "from sklearn import __version__;print('sklearn', __version__)" - python -c "from onnxruntime import __version__;print('onnxruntime', __version__)" - python -c "from onnx import __version__;print('onnx', __version__)" - python -c "from skl2onnx import __max_supported_opset__;print('__max_supported_opset__', __max_supported_opset__)" - python -c "import test_utils;print('max_onnxruntime_opset', test_utils.max_onnxruntime_opset())" - python -c "import test_utils;print('TARGET OPSET, IR', test_utils.TARGET_OPSET, test_utils.TARGET_IR)" - python -c "import onnx.defs;print('onnx_opset_version', onnx.defs.onnx_opset_version())" - cd .. - displayName: 'target_opset' - - - script: | - call activate skl2onnxEnvironment - if "$(onnx.target_opset)" neq "" set TEST_TARGET_OPSET=$(onnx.target_opset) - python -m pytest tests --durations=0 --basetemp=temp --doctest-modules --junitxml=junit/test-results.xml --maxfail=10 - displayName: 'pytest' - - - task: PublishTestResults@2 - inputs: - testResultsFiles: '**/test-results.xml' - testCoverageFiles: 'htmlcov/**' - testRunTitle: 'Python $(python.version)' - condition: succeededOrFailed() diff --git a/.github/workflows/linux-ci.yml b/.github/workflows/linux-ci.yml new file mode 100644 index 000000000..d86d794e7 --- /dev/null +++ b/.github/workflows/linux-ci.yml @@ -0,0 +1,104 @@ +name: CI Linux +on: [push, pull_request] +jobs: + run: + name: Py==${{ matrix.python_version }} - sklearn${{ matrix.sklearn_version }} - ${{ matrix.onnxrt_version }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest] + python_version: ['3.12', '3.11', '3.10', '3.9'] + include: + - python_version: '3.12' + documentation: 0 + numpy_version: '>=1.21.1' + scipy_version: '>=1.7.0' + onnx_version: 'onnx==1.16.0' + onnxrt_version: 'onnxruntime==1.18.0' + sklearn_version: '==1.4.2' + - python_version: '3.11' + documentation: 1 + numpy_version: '>=1.21.1' + scipy_version: '>=1.7.0' + onnx_version: 'onnx<1.16.0' + onnxrt_version: 'onnxruntime==1.17.3' + sklearn_version: '==1.3.2' + - python_version: '3.10' + documentation: 0 + numpy_version: '>=1.21.1' + scipy_version: '>=1.7.0' + onnx_version: 'onnx==1.14.1' + onnxrt_version: 'onnxruntime==1.16.0' + sklearn_version: '==1.2.2' + - python_version: '3.9' + documentation: 0 + numpy_version: '>=1.21.1' + scipy_version: '>=1.7.0' + onnx_version: 'onnx==1.13.0' + onnxrt_version: 'onnxruntime==1.14.0' + sklearn_version: '==1.1.3' + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python_version }} + + - uses: tlylt/install-graphviz@v1 + + - name: Install pandoc + if: matrix.documentation == 1 + run: sudo apt-get install -y pandoc + + - name: Install requirements + run: python -m pip install -r requirements.txt + + - name: Install requirements dev + run: python -m pip install -r requirements-dev.txt + + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + + - name: Install specific versions + run: pip install "${{ matrix.onnx_version }}" "${{ matrix.onnxrt_version }}" "numpy${{ matrix.numpy_version }}" "scikit-learn${{ matrix.sklearn_version}}" "scipy${{ matrix.scipy_version }}" + + - name: Install + run: pip install -e . + + - name: versions + run: | + python -c "from numpy import __version__;print('numpy', __version__)" + python -c "from pandas import __version__;print('pandas', __version__)" + python -c "from scipy import __version__;print('scipy', __version__)" + python -c "from sklearn import __version__;print('sklearn', __version__)" + python -c "from onnxruntime import __version__;print('onnxruntime', __version__)" + python -c "from onnx import __version__;print('onnx', __version__)" + python -c "from skl2onnx import __max_supported_opset__;print('__max_supported_opset__', __max_supported_opset__)" + python -c "import onnx.defs;print('onnx_opset_version', onnx.defs.onnx_opset_version())" + + - name: Run tests + run: | + pytest tests --maxfail=10 --durations=10 + + - name: Run documentation tests + if: matrix.documentation == 1 + run: | + pip install -r docs/requirements.txt + pytest docs/tests --durations=10 --maxfail=5 + # python tests/benchmark.py + + - name: build + run: pip wheel . + + - uses: actions/upload-artifact@v4 + with: + path: ./dist/** diff --git a/.github/workflows/windows-macos-ci.yml b/.github/workflows/windows-macos-ci.yml new file mode 100644 index 000000000..2916a3cbe --- /dev/null +++ b/.github/workflows/windows-macos-ci.yml @@ -0,0 +1,83 @@ +name: CI Win/Mac +on: [push, pull_request] +jobs: + run: + name: ${{ matrix.os }} py==${{ matrix.python_version }} - sklearn==${{ matrix.sklearn_version }} - ${{ matrix.onnxrt_version }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest, macos-latest] + python_version: ['3.11', '3.10', '3.9'] + include: + - python_version: '3.11' + numpy_version: '>=1.21.1' + scipy_version: '>=1.7.0' + onnx_version: 'onnx<1.16.0' + onnxrt_version: 'onnxruntime==1.17.3' + sklearn_version: '==1.3.2' + - python_version: '3.10' + numpy_version: '>=1.21.1' + scipy_version: '>=1.7.0' + onnx_version: 'onnx<1.15' + onnxrt_version: 'onnxruntime<1.17.0' + sklearn_version: '==1.2.2' + - python_version: '3.9' + numpy_version: '>=1.21.1' + scipy_version: '>=1.7.0' + onnx_version: 'onnx<1.14' + onnxrt_version: 'onnxruntime<1.16.0' + sklearn_version: '==1.2.2' + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python_version }} + + - uses: tlylt/install-graphviz@v1 + + - name: Install requirements + run: python -m pip install -r requirements.txt + + - name: Install requirements dev + run: python -m pip install -r requirements-dev.txt + + - name: Cache pip + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + + - name: Install specific versions + run: pip install "${{ matrix.onnx_version }}" "${{ matrix.onnxrt_version }}" "numpy${{ matrix.numpy_version }}" "scikit-learn${{ matrix.sklearn_version}}" "scipy${{ matrix.scipy_version }}" + + - name: Install + run: pip install -e . + + - name: versions + run: | + python -c "from numpy import __version__;print('numpy', __version__)" + python -c "from pandas import __version__;print('pandas', __version__)" + python -c "from scipy import __version__;print('scipy', __version__)" + python -c "from sklearn import __version__;print('sklearn', __version__)" + python -c "from onnxruntime import __version__;print('onnxruntime', __version__)" + python -c "from onnx import __version__;print('onnx', __version__)" + python -c "from skl2onnx import __max_supported_opset__;print('__max_supported_opset__', __max_supported_opset__)" + python -c "import onnx.defs;print('onnx_opset_version', onnx.defs.onnx_opset_version())" + + - name: Run tests + run: | + pytest tests --maxfail=10 --durations=10 + + - name: build + run: pip wheel . + + - uses: actions/upload-artifact@v4 + with: + path: ./dist/** diff --git a/.gitignore b/.gitignore index f2ab678fb..8c9a8ba76 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ build/ # test generated files *.onnx +*.whl .pytest_cache .cache htmlcov diff --git a/README.md b/README.md index 6ac428186..2b032c3c3 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@