Skip to content

Commit 534f84c

Browse files
authored
Feat/poetry to uv (#29)
Update from poetry to uv. Fix minor dtype bug for sentence-transformers
1 parent 17c6bbf commit 534f84c

File tree

10 files changed

+3875
-6126
lines changed

10 files changed

+3875
-6126
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,17 @@ jobs:
1515
- name: Check out repository
1616
uses: actions/checkout@v4
1717

18-
- name: Install Python
19-
uses: actions/setup-python@v5
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v7
2020
with:
2121
python-version: ${{ env.PYTHON_VERSION }}
22+
enable-cache: true
2223

23-
- name: Install Poetry
24-
uses: snok/install-poetry@v1
25-
with:
26-
version: latest
27-
virtualenvs-create: true
28-
virtualenvs-in-project: true
29-
30-
- name: Load cached venv
31-
id: cached-poetry-dependencies
32-
uses: actions/cache@v3
33-
with:
34-
path: .venv
35-
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
36-
37-
- name: Install dependencies
38-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
39-
run: poetry install --only=main
24+
- name: Sync dependencies
25+
run: uv sync --no-dev-dependencies
4026

4127
- name: Build package
42-
run: poetry build
28+
run: uv build
4329

4430
- name: Upload build
4531
uses: actions/upload-artifact@v4
@@ -55,28 +41,11 @@ jobs:
5541
- name: Check out repository
5642
uses: actions/checkout@v4
5743

58-
- name: Install Python
59-
uses: actions/setup-python@v5
44+
- name: Install uv
45+
uses: astral-sh/setup-uv@v7
6046
with:
6147
python-version: ${{ env.PYTHON_VERSION }}
62-
63-
- name: Install Poetry
64-
uses: snok/install-poetry@v1
65-
with:
66-
version: latest
67-
virtualenvs-create: true
68-
virtualenvs-in-project: true
69-
70-
- name: Load cached venv
71-
id: cached-poetry-dependencies
72-
uses: actions/cache@v3
73-
with:
74-
path: .venv
75-
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
76-
77-
- name: Install dependencies
78-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
79-
run: poetry install --only=main
48+
enable-cache: true
8049

8150
- name: Download build artifacts
8251
uses: actions/download-artifact@v4
@@ -86,5 +55,5 @@ jobs:
8655

8756
- name: Publish to PyPI
8857
env:
89-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI }}
90-
run: poetry publish
58+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI }}
59+
run: uv publish --token $UV_PUBLISH_TOKEN

.github/workflows/test.yml

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
services:
1414
redis:
15-
image: redis/redis-stack:latest
15+
image: ${{ matrix.redis-image }}
1616
ports:
1717
- 6379:6379
1818
options: >-
@@ -24,34 +24,26 @@ jobs:
2424
strategy:
2525
matrix:
2626
python-version: ["3.12"]
27+
redis-version: ["latest", "8.4.0"]
28+
include:
29+
- redis-version: "latest"
30+
redis-image: redis/redis-stack:latest
31+
- redis-version: "8.4.0"
32+
redis-image: redis:8.4.0
2733

2834
steps:
29-
- uses: actions/checkout@v4
30-
31-
- name: Set up Python ${{ matrix.python-version }}
32-
uses: actions/setup-python@v4
33-
with:
34-
python-version: ${{ matrix.python-version }}
35-
36-
- name: Install Poetry
37-
uses: snok/install-poetry@v1
38-
with:
39-
version: latest
40-
virtualenvs-create: true
41-
virtualenvs-in-project: true
42-
43-
- name: Load cached venv
44-
id: cached-poetry-dependencies
45-
uses: actions/cache@v3
46-
with:
47-
path: .venv
48-
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
49-
50-
- name: Install dependencies
51-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
52-
run: poetry install --all-extras
53-
54-
- name: Run tests
55-
run: poetry run test
56-
env:
57-
REDIS_URL: redis://localhost:6379/0
35+
- uses: actions/checkout@v4
36+
37+
- name: Install uv
38+
uses: astral-sh/setup-uv@v7
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
enable-cache: true
42+
43+
- name: Sync dependencies
44+
run: uv sync
45+
46+
- name: Run tests
47+
run: uv run test
48+
env:
49+
REDIS_URL: redis://localhost:6379/0

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"python.testing.pytestArgs": [
3-
"tests"
3+
"."
44
],
55
"python.testing.unittestEnabled": false,
66
"python.testing.pytestEnabled": true

CLAUDE.md

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

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.PHONY: install format lint test clean redis-start redis-stop check-types check
22

33
install:
4-
poetry install --all-extras
4+
uv sync
55

66
redis-start:
77
docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest
@@ -10,16 +10,16 @@ redis-stop:
1010
docker stop redis-stack
1111

1212
format:
13-
poetry run format
14-
poetry run sort-imports
13+
uv run format
14+
uv run sort-imports
1515

1616
check-types:
17-
poetry run check-mypy
17+
uv run check-mypy
1818

1919
lint: format check-types
20-
20+
2121
test:
22-
poetry run test
22+
uv run test
2323

2424
check: lint test
2525

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ optimizer = CacheThresholdOptimizer(cache, test_data, eval_metric="precision") #
449449
optimizer = CacheThresholdOptimizer(cache, test_data, eval_metric="recall") # Recall
450450
```
451451

452-
For a complete example, see [docs/examples/threshold_optimization/00_threshold_optimization.ipynb](https://github.com/redis-applied-ai/redis-retrieval-optimizer/blob/1be3e2683a301a6bebe298ec8d126b7429701bc9/docs/examples/threshold_optimization/00_threshold_optimization.ipynb).
452+
For complete an example, see [docs/examples/threshold_optimization/00_threshold_optimization.ipynb](https://github.com/redis-applied-ai/redis-retrieval-optimizer/blob/1be3e2683a301a6bebe298ec8d126b7429701bc9/docs/examples/threshold_optimization/00_threshold_optimization.ipynb).
453453

454454
## 🔧 Custom Processors and Search Methods
455455

0 commit comments

Comments
 (0)