Skip to content

Commit 3a117eb

Browse files
Merge branch 'main' into jc/semantic-session-manager
2 parents d9aacf9 + ce0f710 commit 3a117eb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+7111
-450
lines changed

.github/workflows/lint.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
name: check
2+
name: Lint
33

44
on:
55
pull_request:
@@ -21,7 +21,7 @@ jobs:
2121
# Starting new jobs is also relatively slow,
2222
# so linting on fewer versions makes CI faster.
2323
python-version:
24-
- "3.8"
24+
- "3.9"
2525
- "3.11"
2626

2727
steps:
@@ -30,19 +30,17 @@ jobs:
3030
uses: actions/setup-python@v2
3131
with:
3232
python-version: ${{ matrix.python-version }}
33+
- name: Install Poetry
34+
uses: snok/install-poetry@v1
3335
- name: Install dependencies
3436
run: |
35-
python -m pip install --upgrade pip
36-
pip install .[dev,all]
37-
37+
poetry install --all-extras
3838
- name: check-sort-import
3939
run: |
40-
make check-sort-imports
41-
40+
poetry run check-sort-imports
4241
- name: check-black-format
4342
run: |
44-
make check-format
45-
43+
poetry run check-format
4644
- name: check-mypy
4745
run: |
48-
make mypy
46+
poetry run mypy

.github/workflows/publish.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version of this deployment'
8+
required: true
9+
10+
env:
11+
PYTHON_VERSION: "3.11"
12+
POETRY_VERSION: "1.4.2"
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: ${{ env.PYTHON_VERSION }}
25+
26+
- name: Install Poetry
27+
uses: snok/install-poetry@v1
28+
29+
- name: Set Version
30+
run: poetry version ${{ github.event.inputs.version }}
31+
32+
- name: Build package
33+
run: poetry build
34+
35+
- name: Upload build
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: dist
39+
path: dist/
40+
41+
# test-pypi-publish:
42+
# needs: build
43+
# runs-on: ubuntu-latest
44+
45+
# steps:
46+
# - uses: actions/checkout@v4
47+
48+
# - name: Set up Python
49+
# uses: actions/setup-python@v4
50+
# with:
51+
# python-version: ${{ env.PYTHON_VERSION }}
52+
53+
# - name: Install Poetry
54+
# uses: snok/install-poetry@v1
55+
56+
# - uses: actions/download-artifact@v4
57+
# with:
58+
# name: dist
59+
# path: dist/
60+
61+
# - name: Publish to TestPyPI
62+
# env:
63+
# POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TESTPYPI }}
64+
# run: poetry config repositories.test-pypi https://test.pypi.org/legacy/; poetry config pypi-token.test-pypi $POETRY_PYPI_TOKEN_TESTPYPI; poetry publish --repository test-pypi
65+
66+
# pre-release-checks:
67+
# needs: test-pypi-publish
68+
# runs-on: ubuntu-latest
69+
70+
# steps:
71+
# - uses: actions/checkout@v4
72+
73+
# - name: Set up Python
74+
# uses: actions/setup-python@v4
75+
# with:
76+
# python-version: ${{ env.PYTHON_VERSION }}
77+
78+
# - name: Install Poetry
79+
# uses: snok/install-poetry@v1
80+
81+
# - name: Install dependencies
82+
# run: |
83+
# poetry install --all-extras
84+
85+
# - name: Install published package from TestPyPI
86+
# env:
87+
# OPENAI_API_KEY: ${{ secrets.OPENAI_KEY }}
88+
# GCP_LOCATION: ${{ secrets.GCP_LOCATION }}
89+
# GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
90+
# COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
91+
# AZURE_OPENAI_API_KEY: ${{secrets.AZURE_OPENAI_API_KEY}}
92+
# AZURE_OPENAI_ENDPOINT: ${{secrets.AZURE_OPENAI_ENDPOINT}}
93+
# AZURE_OPENAI_DEPLOYMENT_NAME: ${{secrets.AZURE_OPENAI_DEPLOYMENT_NAME}}
94+
# OPENAI_API_VERSION: ${{secrets.OPENAI_API_VERSION}}
95+
# run:
96+
# poetry run pip install --index-url https://test.pypi.org/simple/ --no-deps redisvl-test; poetry run test-cov
97+
98+
publish:
99+
needs: build #pre-release-checks
100+
runs-on: ubuntu-latest
101+
102+
steps:
103+
- uses: actions/checkout@v4
104+
105+
- name: Set up Python
106+
uses: actions/setup-python@v4
107+
with:
108+
python-version: ${{ env.PYTHON_VERSION }}
109+
110+
- name: Install Poetry
111+
uses: snok/install-poetry@v1
112+
113+
- uses: actions/download-artifact@v4
114+
with:
115+
name: dist
116+
path: dist/
117+
118+
- name: Publish to PyPI
119+
env:
120+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI }}
121+
run: poetry publish
122+
123+
create-release:
124+
needs: publish
125+
runs-on: ubuntu-latest
126+
127+
steps:
128+
- uses: actions/checkout@v4
129+
130+
- uses: actions/download-artifact@v4
131+
with:
132+
name: dist
133+
path: dist/
134+
135+
- name: Create Release
136+
uses: ncipollo/release-action@v1
137+
with:
138+
artifacts: "dist/*"
139+
token: ${{ secrets.GITHUB_TOKEN }}
140+
draft: false
141+
generateReleaseNotes: true
142+
tag: ${{ github.event.inputs.version }}
143+
commit: main

.github/workflows/run_tests.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: [3.8, 3.9, '3.10', 3.11]
18+
python-version: [3.9, '3.10', 3.11]
1919
connection: ['hiredis', 'plain']
20-
redis-stack-version: ['6.2.6-v9', 'latest']
20+
redis-stack-version: ['6.2.6-v9', 'latest', 'edge']
2121

2222
services:
2323
redis:
@@ -33,20 +33,21 @@ jobs:
3333
python-version: ${{ matrix.python-version }}
3434
cache: 'pip'
3535

36+
- name: Install Poetry
37+
uses: snok/install-poetry@v1
38+
3639
- name: Install dependencies
3740
run: |
38-
python -m pip install --upgrade pip
39-
pip install .[dev,all]
41+
poetry install --all-extras
4042
4143
- name: Install hiredis if needed
4244
if: matrix.connection == 'hiredis'
4345
run: |
44-
pip install hiredis
46+
poetry add hiredis
4547
46-
- name: Start Redis
48+
- name: Set Redis version
4749
run: |
48-
REDIS_URL=redis://localhost:6379
49-
echo REDIS_URL=$REDIS_URL >> $GITHUB_ENV
50+
echo "REDIS_VERSION=${{ matrix.redis-stack-version }}" >> $GITHUB_ENV
5051
5152
- name: Authenticate to Google Cloud
5253
uses: google-github-actions/auth@v1
@@ -60,13 +61,17 @@ jobs:
6061
GCP_LOCATION: ${{ secrets.GCP_LOCATION }}
6162
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
6263
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
64+
AZURE_OPENAI_API_KEY: ${{secrets.AZURE_OPENAI_API_KEY}}
65+
AZURE_OPENAI_ENDPOINT: ${{secrets.AZURE_OPENAI_ENDPOINT}}
66+
AZURE_OPENAI_DEPLOYMENT_NAME: ${{secrets.AZURE_OPENAI_DEPLOYMENT_NAME}}
67+
OPENAI_API_VERSION: ${{secrets.OPENAI_API_VERSION}}
6368
run: |
64-
make test-cov
69+
poetry run test-cov
6570
6671
- name: Run tests
6772
if: matrix.connection != 'plain' || matrix.redis-stack-version != 'latest'
6873
run: |
69-
SKIP_VECTORIZERS=True make test-cov
74+
SKIP_VECTORIZERS=True SKIP_RERANKERS=True poetry run test-cov
7075
7176
- name: Run notebooks
7277
if: matrix.connection == 'plain' && matrix.redis-stack-version == 'latest'
@@ -75,11 +80,16 @@ jobs:
7580
GCP_LOCATION: ${{ secrets.GCP_LOCATION }}
7681
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
7782
COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }}
83+
AZURE_OPENAI_API_KEY: ${{secrets.AZURE_OPENAI_API_KEY}}
84+
AZURE_OPENAI_ENDPOINT: ${{secrets.AZURE_OPENAI_ENDPOINT}}
85+
AZURE_OPENAI_DEPLOYMENT_NAME: ${{secrets.AZURE_OPENAI_DEPLOYMENT_NAME}}
86+
OPENAI_API_VERSION: ${{secrets.OPENAI_API_VERSION}}
7887
run: |
79-
cd docs/ && treon -v --exclude="./examples/openai_qna.ipynb"
88+
cd docs/ && poetry run treon -v --exclude="./examples/openai_qna.ipynb"
8089
8190
- name: Publish coverage results
82-
uses: codecov/codecov-action@v2
91+
uses: codecov/codecov-action@v4
8392
with:
8493
token: ${{ secrets.CODECOV_TOKEN }}
85-
fail_ci_if_error: true
94+
files: ./coverage.xml
95+
fail_ci_if_error: true

.github/workflows/test-publish.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ __pycache__/
22
redisvl.egg-info/
33
.coverage.*
44
.coverage
5+
coverage.xml
56
scratch
67
.DS_Store
78
*.csv
89
wiki_schema.yaml
910
docs/_build/
10-
.venv
11+
.venv
12+
coverage.xml
13+
dist/

0 commit comments

Comments
 (0)