TEST: wasabi noreturn

This commit is contained in:
Adriane Boyd 2023-06-06 20:54:21 +02:00
parent c936db2faf
commit cc520fa9a9

View File

@ -84,91 +84,93 @@ jobs:
- name: Run mypy - name: Run mypy
run: | run: |
python -m pip uninstall -y wasabi
python -m pip install https://github.com/explosion/wasabi/archive/refs/heads/kab/no-return.zip
python -m mypy spacy python -m mypy spacy
if: matrix.python_version != '3.6' if: matrix.python_version != '3.6'
- name: Delete source directory and .egg-info # - name: Delete source directory and .egg-info
run: | # run: |
rm -rf spacy *.egg-info # rm -rf spacy *.egg-info
shell: bash # shell: bash
#
- name: Uninstall all packages # - name: Uninstall all packages
run: | # run: |
python -m pip freeze # python -m pip freeze
python -m pip freeze --exclude pywin32 > installed.txt # python -m pip freeze --exclude pywin32 > installed.txt
python -m pip uninstall -y -r installed.txt # python -m pip uninstall -y -r installed.txt
#
- name: Install from sdist # - name: Install from sdist
run: | # run: |
SDIST=$(python -c "import os;print(os.listdir('./dist')[-1])" 2>&1) # SDIST=$(python -c "import os;print(os.listdir('./dist')[-1])" 2>&1)
SPACY_NUM_BUILD_JOBS=2 python -m pip install dist/$SDIST # SPACY_NUM_BUILD_JOBS=2 python -m pip install dist/$SDIST
shell: bash # shell: bash
#
- name: Test import # - name: Test import
run: python -W error -c "import spacy" # run: python -W error -c "import spacy"
#
# - name: "Test download CLI" ## - name: "Test download CLI"
# run: | ## run: |
# python -m spacy download ca_core_news_sm ## python -m spacy download ca_core_news_sm
# python -m spacy download ca_core_news_md ## python -m spacy download ca_core_news_md
# python -c "import spacy; nlp=spacy.load('ca_core_news_sm'); doc=nlp('test')" ## python -c "import spacy; nlp=spacy.load('ca_core_news_sm'); doc=nlp('test')"
# if: matrix.python_version == '3.9' ## if: matrix.python_version == '3.9'
# ##
# - name: "Test download_url in info CLI" ## - name: "Test download_url in info CLI"
# run: | ## run: |
# python -W error -m spacy info ca_core_news_sm | grep -q download_url ## python -W error -m spacy info ca_core_news_sm | grep -q download_url
# if: matrix.python_version == '3.9' ## if: matrix.python_version == '3.9'
# ##
# - name: "Test no warnings on load (#11713)" ## - name: "Test no warnings on load (#11713)"
# run: | ## run: |
# python -W error -c "import ca_core_news_sm; nlp = ca_core_news_sm.load(); doc=nlp('test')" ## python -W error -c "import ca_core_news_sm; nlp = ca_core_news_sm.load(); doc=nlp('test')"
# if: matrix.python_version == '3.9' ## if: matrix.python_version == '3.9'
#
- name: "Test convert CLI" # - name: "Test convert CLI"
run: | # run: |
python -m spacy convert extra/example_data/ner_example_data/ner-token-per-line-conll2003.json . # python -m spacy convert extra/example_data/ner_example_data/ner-token-per-line-conll2003.json .
if: matrix.python_version == '3.9' # if: matrix.python_version == '3.9'
#
- name: "Test debug config CLI" # - name: "Test debug config CLI"
run: | # run: |
python -m spacy init config -p ner -l ca ner.cfg # python -m spacy init config -p ner -l ca ner.cfg
python -m spacy debug config ner.cfg --paths.train ner-token-per-line-conll2003.spacy --paths.dev ner-token-per-line-conll2003.spacy # python -m spacy debug config ner.cfg --paths.train ner-token-per-line-conll2003.spacy --paths.dev ner-token-per-line-conll2003.spacy
if: matrix.python_version == '3.9' # if: matrix.python_version == '3.9'
#
- name: "Test debug data CLI" # - name: "Test debug data CLI"
run: | # run: |
# will have errors due to sparse data, check for summary in output # # will have errors due to sparse data, check for summary in output
python -m spacy debug data ner.cfg --paths.train ner-token-per-line-conll2003.spacy --paths.dev ner-token-per-line-conll2003.spacy | grep -q Summary # python -m spacy debug data ner.cfg --paths.train ner-token-per-line-conll2003.spacy --paths.dev ner-token-per-line-conll2003.spacy | grep -q Summary
if: matrix.python_version == '3.9' # if: matrix.python_version == '3.9'
#
- name: "Test train CLI" # - name: "Test train CLI"
run: | # run: |
python -m spacy train ner.cfg --paths.train ner-token-per-line-conll2003.spacy --paths.dev ner-token-per-line-conll2003.spacy --training.max_steps 10 --gpu-id -1 # python -m spacy train ner.cfg --paths.train ner-token-per-line-conll2003.spacy --paths.dev ner-token-per-line-conll2003.spacy --training.max_steps 10 --gpu-id -1
if: matrix.python_version == '3.9' # if: matrix.python_version == '3.9'
#
# - name: "Test assemble CLI" ## - name: "Test assemble CLI"
# run: | ## run: |
# python -c "import spacy; config = spacy.util.load_config('ner.cfg'); config['components']['ner'] = {'source': 'ca_core_news_sm'}; config.to_disk('ner_source_sm.cfg')" ## python -c "import spacy; config = spacy.util.load_config('ner.cfg'); config['components']['ner'] = {'source': 'ca_core_news_sm'}; config.to_disk('ner_source_sm.cfg')"
# PYTHONWARNINGS="error,ignore::DeprecationWarning" python -m spacy assemble ner_source_sm.cfg output_dir ## PYTHONWARNINGS="error,ignore::DeprecationWarning" python -m spacy assemble ner_source_sm.cfg output_dir
# if: matrix.python_version == '3.9' ## if: matrix.python_version == '3.9'
# ##
# - name: "Test assemble CLI vectors warning" ## - name: "Test assemble CLI vectors warning"
# run: | ## run: |
# python -c "import spacy; config = spacy.util.load_config('ner.cfg'); config['components']['ner'] = {'source': 'ca_core_news_md'}; config.to_disk('ner_source_md.cfg')" ## python -c "import spacy; config = spacy.util.load_config('ner.cfg'); config['components']['ner'] = {'source': 'ca_core_news_md'}; config.to_disk('ner_source_md.cfg')"
# python -m spacy assemble ner_source_md.cfg output_dir 2>&1 | grep -q W113 ## python -m spacy assemble ner_source_md.cfg output_dir 2>&1 | grep -q W113
# if: matrix.python_version == '3.9' ## if: matrix.python_version == '3.9'
#
- name: "Install test requirements" # - name: "Install test requirements"
run: | # run: |
python -m pip install -U -r requirements.txt # python -m pip install -U -r requirements.txt
#
- name: "Run CPU tests" # - name: "Run CPU tests"
run: | # run: |
python -m pytest --pyargs spacy -W error # python -m pytest --pyargs spacy -W error
if: "!(startsWith(matrix.os, 'macos') && matrix.python_version == '3.11')" # if: "!(startsWith(matrix.os, 'macos') && matrix.python_version == '3.11')"
#
- name: "Run CPU tests with thinc-apple-ops" # - name: "Run CPU tests with thinc-apple-ops"
run: | # run: |
python -m pip install 'spacy[apple]' # python -m pip install 'spacy[apple]'
python -m pytest --pyargs spacy # python -m pytest --pyargs spacy
if: startsWith(matrix.os, 'macos') && matrix.python_version == '3.11' # if: startsWith(matrix.os, 'macos') && matrix.python_version == '3.11'