Skip to content

Commit

Permalink
Fix Conda issue due to it is deprecated (#283)
Browse files Browse the repository at this point in the history
* Update nightly-CI.yml

Signed-off-by: xiaowuhu<xiaowuhu@microsoft.com>

* Update nightly-CI.yml

Signed-off-by: xiaowuhu<xiaowuhu@microsoft.com>

* Update nightly-CI.yml

Signed-off-by: xiaowuhu<xiaowuhu@microsoft.com>

---------

Signed-off-by: xiaowuhu<xiaowuhu@microsoft.com>
  • Loading branch information
xiaowuhu authored Apr 2, 2024
1 parent 6c834f5 commit 00f2ad5
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions .azure-pipelines/nightly-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ jobs:
- script: sudo install -d -m 0777 /home/vsts/.conda/envs
displayName: Fix Conda permissions

- task: CondaEnvironment@1
- task: UsePythonVersion@0
inputs:
createCustomEnvironment: true
environmentName: 'py$(python.version)'
packageSpecs: 'python=$(python.version)'
versionSpec: '$(python.version)'
addToPath: true
architecture: 'x64'
displayName: 'Use Python $(python.version)'

- script: |
python -m pip install --upgrade pip
conda config --set always_yes yes --set changeps1 no
conda install -c conda-forge protobuf
conda install -c conda-forge numpy
pip install protobuf
pip install numpy
pip install -r requirements.txt
# install ORT dependencies
pip install onnxruntime
Expand All @@ -52,6 +52,7 @@ jobs:
pip install $(ONNX_PATH)
pip install protobuf>=3.20.2
pip install pytest
pip install onnxmltools
pip install -e .
displayName: 'Install dependencies'
Expand All @@ -62,7 +63,7 @@ jobs:
- script: |
python -c "import onnxconverter_common"
pytest tests --doctest-modules --junitxml=junit/test-results-onnxutils.xml
pytest tests --doctest-modules --junitxml=junit/test-results.xml
displayName: 'pytest - onnxutils'
- task: PublishTestResults@2
Expand All @@ -78,19 +79,19 @@ jobs:
matrix:
Python382:
python.version: '3.8'
ONNX_PATH: onnx==1.8.0
ONNX_PATH: onnx==1.13

Python391:
python.version: '3.9'
ONNX_PATH: onnx==1.9.0
ONNX_PATH: onnx==1.13

Python392:
python.version: '3.9'
ONNX_PATH: onnx==1.10.2
ONNX_PATH: onnx==1.13

Python310:
python.version: '3.10'
ONNX_PATH: onnx==1.14.0
ONNX_PATH: onnx==1.14

maxParallel: 4

Expand All @@ -100,14 +101,7 @@ jobs:
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) numpy protobuf
displayName: Create Anaconda environment

- script: |
call activate py$(python.version)
python -m pip install --upgrade pip numpy
echo Test numpy installation... && python -c "import numpy"
pip install -r requirements.txt
Expand All @@ -119,18 +113,18 @@ jobs:
pip install %ONNX_PATH%
pip install protobuf>=3.20.2
pip install pytest
pip install onnxmltools
pip install -e .
displayName: 'Install dependencies'
- script: |
call activate py$(python.version)
pip install flake8
python -m flake8 onnxconverter_common
displayName: 'run flake8 check'
- script: |
call activate py$(python.version)
pytest tests --doctest-modules --junitxml=junit/test-results-onnxutils.xml
pytest tests --doctest-modules --junitxml=junit/test-results.xml
displayName: 'pytest - onnxutils'
- task: PublishTestResults@2
Expand Down

0 comments on commit 00f2ad5

Please sign in to comment.