Skip to content

Commit 3ef0d6e

Browse files
committed
chore: switch from poetry to uv
1 parent c18d93f commit 3ef0d6e

File tree

7 files changed

+1922
-1962
lines changed

7 files changed

+1922
-1962
lines changed

.github/labeler.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ images:
1515
OCR:
1616
- changed-files:
1717
- any-glob-to-any-file: 'tests/​test_ocr.py'
18-
18+
1919
tests:
2020
- changed-files:
2121
- any-glob-to-any-file: 'tests/test_utils.py'
22-
- any-glob-to-any-file: 'tests/test_api.py'
23-
- any-glob-to-any-file: 'tests/test_ocr.py'
24-
- any-glob-to-any-file: 'tests/test_redis.py'
25-
- any-glob-to-any-file: 'tests/test_images.py'
26-
- any-glob-to-any-file: 'tests/test_api_config.py'
22+
- any-glob-to-any-file: 'tests/test_api.py'
23+
- any-glob-to-any-file: 'tests/test_ocr.py'
24+
- any-glob-to-any-file: 'tests/test_redis.py'
25+
- any-glob-to-any-file: 'tests/test_images.py'
26+
- any-glob-to-any-file: 'tests/test_api_config.py'
2727

2828
utils:
2929
- changed-files:
@@ -32,7 +32,7 @@ utils:
3232

3333
dependencies:
3434
- changed-files:
35-
- any-glob-to-any-file: 'poetry.lock'
35+
- any-glob-to-any-file: 'uv.lock'
3636

3737
documentation:
3838
- changed-files:

.github/workflows/ci.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
paths:
66
- "openfoodfacts/**"
77
- "pyproject.toml"
8-
- "poetry.lock"
8+
- "uv.lock"
99
- "tests/**"
1010

1111
jobs:
@@ -19,25 +19,24 @@ jobs:
1919
- uses: actions/setup-python@v5
2020
with:
2121
python-version: ${{ matrix.python-version }}
22-
- name: Install Poetry
23-
uses: snok/install-poetry@v1.4
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v7
2424
with:
25-
virtualenvs-create: true
26-
virtualenvs-in-project: true
25+
version: "0.10.2"
2726
- name: Load cached venv
28-
id: cached-poetry-dependencies
27+
id: cached-uv-dependencies
2928
uses: actions/cache@v4
3029
with:
3130
path: .venv
32-
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
31+
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/uv.lock') }}
3332
- name: Install dependencies
34-
run: poetry install --with=dev --all-extras
35-
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
33+
run: uv sync --all-extras
34+
if: steps.cached-uv-dependencies.outputs.cache-hit != 'true'
3635

3736
- name: Launch quality checks
3837
run: |
39-
poetry run ruff check .
40-
poetry run mypy .
38+
uv run ruff check .
39+
uv run mypy .
4140
- name: Test with pytest
4241
run: |
43-
poetry run pytest tests
42+
uv run pytest tests

.github/workflows/pypi.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ jobs:
1414
uses: actions/setup-python@v5
1515
with:
1616
python-version: 3.11
17-
- uses: abatilo/actions-poetry@v4.0.0
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v7
1819
with:
19-
poetry-version: 2.3.2
20-
- name: Run poetry build
21-
run: poetry build
22-
- name: Run poetry publish
23-
run: POETRY_PYPI_TOKEN_PYPI=${{ secrets.PYPI_TOKEN }} poetry publish
20+
version: "0.10.2"
21+
- name: Run uv build
22+
run: uv build
23+
- name: Run uv publish
24+
run: UV_PUBLISH_TOKEN=${{ secrets.PYPI_TOKEN }} uv publish

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Contributors:
111111
- [Benoît Prieur](https://github.com/benprieur)
112112
- [Aadarsh A](https://github.com/aadarsh-ram)
113113

114-
We use poetry as a dependency manager and ruff as a linter/formatter.
114+
We use uv as a dependency manager and ruff as a linter/formatter.
115115

116116
## Copyright and License
117117

poetry.lock

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

pyproject.toml

Lines changed: 14 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,7 @@ dependencies = [
1616
"pydantic>=2.0.0,<3.0.0",
1717
"tqdm>=4.0.0,<5.0.0",
1818
]
19-
dynamic = ["classifiers"]
2019

21-
[tool.poetry]
22-
include = [
23-
{path = "tests", format = "sdist"},
24-
]
2520
classifiers = [
2621
"Development Status :: 5 - Production/Stable",
2722
"Intended Audience :: Developers",
@@ -60,28 +55,19 @@ use_parentheses = true
6055
ensure_newline_before_comments = true
6156
line_length = 88
6257

63-
[tool.poetry.dependencies]
64-
python = ">=3.10,<4.0"
65-
redis = { version = "~7.1.1", optional = true, extras = ["hiredis"] }
66-
Pillow = { version = ">=9.3,<12.2", optional = true }
67-
tritonclient = {extras = ["grpc"], version = ">2.0.0,<3.0.0", optional = true}
68-
opencv-python-headless = {version = ">4.0.0,<5.0.0", optional = true}
69-
70-
[tool.poetry.group.dev.dependencies]
71-
requests-mock = "1.12.1"
72-
mypy = "1.17.1"
73-
coverage = {version = "7.13.4", extras = ["toml"]}
74-
pytest = "9.0.2"
75-
types-requests = "2.32.4.20260107"
76-
types-tqdm = "4.67.3.20260205"
77-
types-redis = "^4.6.0.20240425"
78-
ruff = "0.15.0"
58+
[dependency-groups]
59+
dev = [
60+
"requests-mock==1.12.1",
61+
"mypy==1.17.1",
62+
"coverage[toml]==7.13.4",
63+
"pytest==9.0.2",
64+
"types-requests==2.32.4.20260107",
65+
"types-tqdm==4.67.3.20260205",
66+
"types-redis==4.6.0.20240425",
67+
"ruff==0.15.0",
68+
]
7969

8070
[project.optional-dependencies]
81-
redis = ["redis"]
82-
pillow = ["Pillow"]
83-
ml = ["tritonclient[grpc]", "opencv-python-headless", "Pillow", "albumentations>=2.0.0"]
84-
85-
[build-system]
86-
requires = ["poetry-core"]
87-
build-backend = "poetry.core.masonry.api"
71+
redis = ["redis[hiredis]~=7.1.1"]
72+
pillow = ["Pillow>=9.3,<12.2"]
73+
ml = ["tritonclient[grpc]>2.0.0,<3.0.0", "opencv-python-headless>4.0.0,<5.0.0", "Pillow", "albumentations>=2.0.0"]

0 commit comments

Comments
 (0)