Skip to content

Commit

Permalink
Replace extra-dependencies by dependency groups (#598)
Browse files Browse the repository at this point in the history
* Use PEP 735 groups instead of extra-dependencies in pyproject.toml

Doc, test and CI dependencies are not useful for published package.
CI includes doc group with hatch-vcs when publishing documentation.

Signed-off-by: Patrick ZAJDA <[email protected]>

* Update workflows to use dependencies groups

Signed-off-by: Patrick ZAJDA <[email protected]>

---------

Signed-off-by: Patrick ZAJDA <[email protected]>
  • Loading branch information
Nardol authored Jan 16, 2025
1 parent 015de25 commit b86d8e7
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
cache-suffix: lint

- name: 📦 Install dependencies
run: uv sync --frozen --extra lint
run: uv sync --frozen --group lint

- name: Pre-commit cache
uses: actions/[email protected]
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
run: uv python install ${{ matrix.python-version }}

- name: 📦 Install dependencies
run: uv sync --frozen --extra test
run: uv sync --frozen --group test

- name: 🏃 Run tests
run: uv run pytest tests
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
id: python

- name: 📦 Install dependencies
run: uv sync --frozen --extra doc
run: uv sync --frozen --group doc

- name: Build documentation using sphinx
run: uv run make -C docs html
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
id: python

- name: 📦 Install dependencies
run: uv sync --frozen --extra doc --extra ci
run: uv sync --frozen --group ci

- name: Get version
id: get-version
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ dependencies = [
"aiohttp>=3.8.0,<4.0",
]

[project.optional-dependencies]
[dependency-groups]
doc = [
"Sphinx==8.1.3",
"furo==2024.8.6",
Expand All @@ -51,6 +51,7 @@ test = [
"pytest-cov==6.0.0",
]
ci = [
{include-group = "doc"},
"hatch-vcs==0.4.0"
]

Expand Down
38 changes: 25 additions & 13 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b86d8e7

Please sign in to comment.