mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
36ecba224e
* Set up CI for tests with GPU agent * Update tests for enabled GPU * Fix steps filename * Add parallel build jobs as a setting * Fix test requirements * Fix install test requirements condition * Fix pipeline models test * Reset current ops in prefer/require testing * Fix more tests * Remove separate test_models test * Fix regression 5551 * fix StaticVectors for GPU use * fix vocab tests * Fix regression test 5082 * Move azure steps to .github and reenable default pool jobs * Consolidate/rename azure steps Co-authored-by: svlandeg <sofie.vanlandeghem@gmail.com>
58 lines
2.0 KiB
YAML
58 lines
2.0 KiB
YAML
parameters:
|
|
python_version: ''
|
|
architecture: ''
|
|
prefix: ''
|
|
gpu: false
|
|
num_build_jobs: 1
|
|
|
|
steps:
|
|
- task: UsePythonVersion@0
|
|
inputs:
|
|
versionSpec: ${{ parameters.python_version }}
|
|
architecture: ${{ parameters.architecture }}
|
|
|
|
- script: |
|
|
${{ parameters.prefix }} python -m pip install -U pip setuptools
|
|
${{ parameters.prefix }} python -m pip install -U -r requirements.txt
|
|
displayName: "Install dependencies"
|
|
|
|
- script: |
|
|
${{ parameters.prefix }} python setup.py build_ext --inplace -j ${{ parameters.num_build_jobs }}
|
|
${{ parameters.prefix }} python setup.py sdist --formats=gztar
|
|
displayName: "Compile and build sdist"
|
|
|
|
- task: DeleteFiles@1
|
|
inputs:
|
|
contents: "spacy"
|
|
displayName: "Delete source directory"
|
|
|
|
- script: |
|
|
${{ parameters.prefix }} python -m pip freeze --exclude torch --exclude cupy-cuda110 > installed.txt
|
|
${{ parameters.prefix }} python -m pip uninstall -y -r installed.txt
|
|
displayName: "Uninstall all packages"
|
|
|
|
- bash: |
|
|
${{ parameters.prefix }} SDIST=$(python -c "import os;print(os.listdir('./dist')[-1])" 2>&1)
|
|
${{ parameters.prefix }} python -m pip install dist/$SDIST
|
|
displayName: "Install from sdist"
|
|
|
|
- script: |
|
|
${{ parameters.prefix }} python -m pip install -U -r requirements.txt
|
|
displayName: "Install test requirements"
|
|
|
|
- script: |
|
|
${{ parameters.prefix }} python -m pip install -U cupy-cuda110
|
|
${{ parameters.prefix }} python -m pip install "torch==1.7.1+cu110" -f https://download.pytorch.org/whl/torch_stable.html
|
|
displayName: "Install GPU requirements"
|
|
condition: eq(${{ parameters.gpu }}, true)
|
|
|
|
- script: |
|
|
${{ parameters.prefix }} python -m pytest --pyargs spacy
|
|
displayName: "Run CPU tests"
|
|
condition: eq(${{ parameters.gpu }}, false)
|
|
|
|
- script: |
|
|
${{ parameters.prefix }} python -m pytest --pyargs spacy -p spacy.tests.enable_gpu
|
|
displayName: "Run GPU tests"
|
|
condition: eq(${{ parameters.gpu }}, true)
|