Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update build matrix and job run conditions (#38)
* Update build matrix and job run conditions. * Limit concurrency. * Fix build matrix Python version error. Add missing external markers to REST tests. * Test on installed package. * Fix Python version typo. * Test commit. * Test commit. * Add env block. * Install dev requirements for tests. * Remove dependency check from query functions. * Use python -m in install from sdist step. * Test uninstalling dotenv before reinstalling it. * Add import guard for minichain and langchain. * Add Pytest skip markers for LangChain and MiniChain tests. * Add Pytest skip markers for NER MiniChain tests. * Change backend to REST from minichain. * Set max-parallel to 2. * Add Literal to compat.py. * Remove max-parallel. * Add version guards for minichain and langchain in requirements-dev.txt. * Fix env markers in requirements-dev.txt. * Remove inheritance in NoopTask_Incorrect. * Disable fail-fast for test purposes. * Upgrade pip. * Narrow down Python range for MiniChain. * Add pytest config in pyproject.toml. * Add external marker to pytest config. * Drop mypy validation step due to fix of pre-commit config in other PR. * Update spacy_llm/tests/backends/test_minichain.py Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com> * Update spacy_llm/tests/backends/test_langchain.py Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com> * Use :: instead of : for filterwarnings config. * Reverse package/warning order in filterwarnings config. * Use : instead of :: for filterwarnings config. * Use deprecation warning marker in tests instead of in pytest config. * Reverse filterwarnings order. * Use : instead of :: for filterwarnings. * Move filterwarning to pyproject.toml. * Remove upper Python version bounds for langchain and minichain dependencies. Bumped minimal version for minichain to 3.8. * Limit upper Python version bound for minichain. * Move filterwarnings to new pytest config in setup.cfg. * Update requirements-dev.txt Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com> * Attempt to fix file path for Jinja NER tests. * Add MANIFEST.in. * Add .json and .jsonl files. * Add test output. * Add test output. * Fix paths in test_ner.py. * Fix EXAMPLES_DIR. * Add pytest mark for filterwarnings in compat.py. * Guard pytest import. * Move pytest settings to pyproject.toml. * Add testpaths. * Remove debugging step. Limit build matrix temporarily. * Remove regex in filter warning. * Add workaround for depreciation warning originating from minichain. * Add workaround for depreciation warning originating from minichain. * Add ignore in pytest call. * Remove .catch_warnings(). * Move pytest config entirely into pyproject.toml. * Ignore all DepreciationWarnings. * Fix paths in text_textcat.py. * Fix paths in text_textcat.py. * Fix paths in text_textcat.py. * Restore all platforms. --------- Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>
- Loading branch information
1 parent
2c4100c
commit f18d732
Showing
16 changed files
with
131 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,96 @@ | ||
name: Regression Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- "*.md" | ||
pull_request: | ||
types: [ opened, synchronize, reopened, edited ] | ||
types: [opened, synchronize, reopened, edited] | ||
paths-ignore: | ||
- "*.md" | ||
workflow_dispatch: | ||
|
||
env: | ||
MODULE_NAME: 'spacy_llm' | ||
RUN_MYPY: 'false' | ||
|
||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python_version: ["3.11"] | ||
include: | ||
- os: ubuntu-20.04 | ||
python_version: "3.6" | ||
- os: windows-latest | ||
python_version: "3.7" | ||
- os: macos-latest | ||
python_version: "3.8" | ||
- os: ubuntu-latest | ||
python_version: "3.9" | ||
- os: windows-latest | ||
python_version: "3.10" | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.9 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
cache: "pip" | ||
python-version: ${{ matrix.python_version }} | ||
|
||
- name: Build sdist | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install -U build pip setuptools | ||
python -m pip install -U -r requirements.txt | ||
python -m build --sdist | ||
- name: Run mypy | ||
shell: bash | ||
if: ${{ env.RUN_MYPY == 'true' }} | ||
run: | | ||
python -m mypy $MODULE_NAME | ||
- name: Delete source directory | ||
shell: bash | ||
run: | | ||
rm -rf $MODULE_NAME | ||
- name: Uninstall all packages | ||
run: | | ||
python -m pip freeze > installed.txt | ||
python -m pip uninstall -y -r installed.txt | ||
- name: Install from sdist | ||
shell: bash | ||
run: | | ||
SDIST=$(python -c "import os;print(os.listdir('./dist')[-1])" 2>&1) | ||
python -m pip uninstall dotenv | ||
python -m pip uninstall python-dotenv | ||
python -m pip install python-dotenv | ||
python -m pip install dist/$SDIST | ||
- name: Test import | ||
shell: bash | ||
run: | | ||
python -c "import $MODULE_NAME" -Werror | ||
- name: Install dependencies | ||
- name: Install test requirements | ||
run: | | ||
pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install -r requirements-dev.txt | ||
python -m pip install -U -r requirements.txt | ||
python -m pip install -U -r requirements-dev.txt | ||
- name: Run tests | ||
shell: bash | ||
env: | ||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
run: | | ||
pytest spacy_llm/tests | ||
python -m pytest --pyargs $MODULE_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
recursive-include spacy_llm *.py *.txt *.cfg *.jinja *.toml *.yml *.json *.jsonl | ||
include LICENSE | ||
include README.md | ||
include pyproject.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.