Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ images:
OCR:
- changed-files:
- any-glob-to-any-file: 'tests/​test_ocr.py'

tests:
- changed-files:
- any-glob-to-any-file: 'tests/test_utils.py'
- any-glob-to-any-file: 'tests/test_api.py'
- any-glob-to-any-file: 'tests/test_ocr.py'
- any-glob-to-any-file: 'tests/test_redis.py'
- any-glob-to-any-file: 'tests/test_images.py'
- any-glob-to-any-file: 'tests/test_api_config.py'
- any-glob-to-any-file: 'tests/test_api.py'
- any-glob-to-any-file: 'tests/test_ocr.py'
- any-glob-to-any-file: 'tests/test_redis.py'
- any-glob-to-any-file: 'tests/test_images.py'
- any-glob-to-any-file: 'tests/test_api_config.py'

utils:
- changed-files:
Expand All @@ -32,7 +32,7 @@ utils:

dependencies:
- changed-files:
- any-glob-to-any-file: 'poetry.lock'
- any-glob-to-any-file: 'uv.lock'

documentation:
- changed-files:
Expand Down
23 changes: 11 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths:
- "openfoodfacts/**"
- "pyproject.toml"
- "poetry.lock"
- "uv.lock"
- "tests/**"

jobs:
Expand All @@ -19,25 +19,24 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1.4
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
virtualenvs-create: true
virtualenvs-in-project: true
version: "0.10.2"
- name: Load cached venv
id: cached-poetry-dependencies
id: cached-uv-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/uv.lock') }}
- name: Install dependencies
run: poetry install --with=dev --all-extras
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: uv sync --all-extras
if: steps.cached-uv-dependencies.outputs.cache-hit != 'true'

- name: Launch quality checks
run: |
poetry run ruff check .
poetry run mypy .
uv run ruff check .
uv run mypy .
- name: Test with pytest
run: |
poetry run pytest tests
uv run pytest tests
13 changes: 7 additions & 6 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.11
- uses: abatilo/actions-poetry@v4.0.0
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
poetry-version: 2.3.2
- name: Run poetry build
run: poetry build
- name: Run poetry publish
run: POETRY_PYPI_TOKEN_PYPI=${{ secrets.PYPI_TOKEN }} poetry publish
version: "0.10.2"
- name: Run uv build
run: uv build
- name: Run uv publish
run: UV_PUBLISH_TOKEN=${{ secrets.PYPI_TOKEN }} uv publish
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Contributors:
- [Benoît Prieur](https://github.com/benprieur)
- [Aadarsh A](https://github.com/aadarsh-ram)

We use poetry as a dependency manager and ruff as a linter/formatter.
We use uv as a dependency manager and ruff as a linter/formatter.

## Copyright and License

Expand Down
1,908 changes: 0 additions & 1,908 deletions poetry.lock

This file was deleted.

42 changes: 14 additions & 28 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ dependencies = [
"pydantic>=2.0.0,<3.0.0",
"tqdm>=4.0.0,<5.0.0",
]
dynamic = ["classifiers"]

[tool.poetry]
include = [
{path = "tests", format = "sdist"},
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand Down Expand Up @@ -60,28 +55,19 @@ use_parentheses = true
ensure_newline_before_comments = true
line_length = 88

[tool.poetry.dependencies]
python = ">=3.10,<4.0"
redis = { version = "~7.1.1", optional = true, extras = ["hiredis"] }
Pillow = { version = ">=9.3,<12.2", optional = true }
tritonclient = {extras = ["grpc"], version = ">2.0.0,<3.0.0", optional = true}
opencv-python-headless = {version = ">4.0.0,<5.0.0", optional = true}

[tool.poetry.group.dev.dependencies]
requests-mock = "1.12.1"
mypy = "1.17.1"
coverage = {version = "7.13.4", extras = ["toml"]}
pytest = "9.0.2"
types-requests = "2.32.4.20260107"
types-tqdm = "4.67.3.20260205"
types-redis = "^4.6.0.20240425"
ruff = "0.15.0"
[dependency-groups]
dev = [
"requests-mock==1.12.1",
"mypy==1.17.1",
"coverage[toml]==7.13.4",
"pytest==9.0.2",
"types-requests==2.32.4.20260107",
"types-tqdm==4.67.3.20260205",
"types-redis==4.6.0.20240425",
"ruff==0.15.0",
]

[project.optional-dependencies]
redis = ["redis"]
pillow = ["Pillow"]
ml = ["tritonclient[grpc]", "opencv-python-headless", "Pillow", "albumentations>=2.0.0"]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
redis = ["redis[hiredis]~=7.1.1"]
pillow = ["Pillow>=9.3,<12.2"]
ml = ["tritonclient[grpc]>2.0.0,<3.0.0", "opencv-python-headless>4.0.0,<5.0.0", "Pillow", "albumentations>=2.0.0"]
Loading
Loading