From 85961a12270c7cbbe09a52d3711513e2abab17ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 16 Mar 2026 09:19:42 +0100 Subject: [PATCH] chore: use dependency groups for devel deps This separaters that from runtime extras. --- .github/workflows/mypy.yml | 4 +-- .github/workflows/setup.yml | 2 +- .github/workflows/update-generated.yml | 3 ++- pyproject.toml | 37 +++++++++++++++++--------- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index e6164bded..f1a06b542 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -34,11 +34,9 @@ jobs: uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: '3.14' - - name: Install pip dependencies - run: uv pip install --system -e .[dev] - name: Run mypy run: | echo "::add-matcher::.github/matchers/mypy.json" - mypy --show-column-numbers weblate_language_data scripts/*.py + uv run --all-extras mypy --show-column-numbers weblate_language_data scripts/*.py echo "::remove-matcher owner=mypy::" diff --git a/.github/workflows/setup.yml b/.github/workflows/setup.yml index 9fd7bff9b..190ae5dee 100644 --- a/.github/workflows/setup.yml +++ b/.github/workflows/setup.yml @@ -24,7 +24,7 @@ jobs: cache-dependency-glob: '' version: 0.10.10 - name: Install dependencies - run: uv pip install --system -e .[dev] + run: uv sync --all-extras --dev - name: build sdist run: uv build - name: twine diff --git a/.github/workflows/update-generated.yml b/.github/workflows/update-generated.yml index 4fef4f996..fe54b504d 100644 --- a/.github/workflows/update-generated.yml +++ b/.github/workflows/update-generated.yml @@ -57,8 +57,9 @@ jobs: ${{ runner.os }}-prek-${{ steps.get-date.outputs.previous_cache_tag }} ${{ runner.os }}-prek- - name: Install dependencies - run: uv pip install --system -e .[dev] + run: uv sync --all-extras --dev - run: | + source .venv/bin/activate # Touch all the files to make sure timestamps are more recent touch modules/cldr-json/cldr-json/cldr-localenames-full/main/en/languages.json touch modules/gettext/gettext-tools/src/plural-table.c diff --git a/pyproject.toml b/pyproject.toml index f004ec168..65a3d9491 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,30 @@ requires = [ "translate-toolkit" ] +[dependency-groups] +build = [ + "translate-toolkit==3.19.3" +] +dev = [ + {include-group = "build"}, + {include-group = "lint"}, + {include-group = "test"}, + {include-group = "types"} +] +lint = [ + {include-group = "pre-commit"} +] +pre-commit = [ + "prek==0.3.6" +] +test = [ +] +types = [ + "django-types==0.23.0", + "mypy==1.19.1", + "types-setuptools==82.0.0.20260210" +] + [project] authors = [ {email = "michal@weblate.org", name = "Michal Čihař"} @@ -41,22 +65,9 @@ requires-python = ">=3.11" version = "2026.3" [project.optional-dependencies] -dev = [ - "translate-toolkit==3.19.3", - "weblate-language-data[lint,test,types]" -] django = [ "Django" ] -lint = [ - "prek==0.3.6" -] -test = [ -] -types = [ - "django-stubs==5.2.9", - "mypy==1.19.1" -] [project.readme] content-type = "text/x-rst"