Skip to content

Commit

Permalink
Python: Azure Search installation and tests improvements (#2030)
Browse files Browse the repository at this point in the history
* Move Azure Search dependencies to own group
* Improve Azure Search integration tests: try to delete collections when
tests fail
* Wait 1 sec after upsert to reduce random failures

---------

Co-authored-by: Abby Harrison <[email protected]>
  • Loading branch information
dluc and awharrison-28 authored Jul 17, 2023
1 parent 3c878bb commit 95d672a
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 88 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/python-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Python Unit Tests
on:
workflow_dispatch:
pull_request:
branches: [ "main", "feature*" ]
branches: ["main", "feature*"]
paths:
- 'python/**'
- "python/**"

jobs:
python-unit-tests:
Expand All @@ -14,19 +14,19 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ ubuntu-latest, windows-latest, macos-latest ]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install poetry pytest
cd python
poetry install --without chromadb --without hugging_face
- name: Test with pytest
run: |
cd python && poetry run pytest ./tests/unit
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install poetry pytest
cd python
poetry install --without chromadb --without hugging_face --without azure_search --without weaviate --without pinecone --without postgres
- name: Test with pytest
run: |
cd python && poetry run pytest ./tests/unit
103 changes: 64 additions & 39 deletions python/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ openai = "^0.27.0"
aiofiles = "^23.1.0"
python-dotenv = "1.0.0"
regex = "^2023.6.3"
azure-search-documents = {version = "11.4.0b6", allow-prereleases = true}
azure-core = "^1.28.0"
azure-identity = "^1.13.0"

[tool.poetry.group.dev.dependencies]
pre-commit = "3.3.3"
Expand Down Expand Up @@ -44,6 +41,11 @@ psycopg-pool = "^3.1.7"
psycopg = "^3.1.9"
psycopg-binary = "^3.1.9"

[tool.poetry.group.azure_search.dependencies]
azure-search-documents = {version = "11.4.0b6", allow-prereleases = true}
azure-core = "^1.28.0"
azure-identity = "^1.13.0"

[tool.isort]
profile = "black"

Expand Down
Loading

0 comments on commit 95d672a

Please sign in to comment.