Skip to content

Commit d429581

Browse files
authored
Use dependencies groups (#767)
1 parent 1af8940 commit d429581

5 files changed

Lines changed: 78 additions & 13 deletions

File tree

.devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
// "forwardPorts": [],
5454
// Use 'postCreateCommand' to run commands after the container is created.
5555
"postCreateCommand": "scripts/setup.sh",
56-
"postStartCommand": "uv sync --dev",
56+
"postStartCommand": "uv sync --group dev",
5757
"remoteEnv": {
5858
"PATH": "/home/vscode/.local/bin:/home/vscode/.cargo/bin:/workspaces/client.py/.venv/bin:${containerEnv:PATH}"
5959
},

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
liblzma-dev
3333
3434
- name: 🏗 Install the project
35-
run: uv sync --locked --dev
35+
run: uv sync --locked --group lint
3636

3737
# Following steps cannot run by pre-commit.ci as repo = local
3838
- name: Run mypy
@@ -72,7 +72,7 @@ jobs:
7272
liblzma-dev
7373
7474
- name: 🏗 Install the project
75-
run: uv sync --locked --dev
75+
run: uv sync --locked --group test
7676

7777
- name: Run pytest
7878
run: uv run --frozen pytest tests --cov=./ --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
@@ -112,7 +112,7 @@ jobs:
112112
113113
- name: 🏗 Install the project
114114
run: |
115-
uv export --dev > requirements.txt
115+
uv export --group benchmark > requirements.txt
116116
uv pip install -e . --system -r requirements.txt
117117
118118
- name: Run benchmarks

pyproject.toml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,34 @@ cache-keys = [
4949
{ file = "Cargo.toml" },
5050
{ file = "**/*.rs" },
5151
]
52-
dev-dependencies = [
52+
53+
[dependency-groups]
54+
benchmark = [{ include-group = "test" }, "pytest-codspeed>=3.1.2"]
55+
dev = [
56+
{ include-group = "benchmark" },
57+
{ include-group = "test" },
58+
{ include-group = "lint" },
59+
"pycountry==24.6.1",
60+
"maturin[patchelf]>=1.7.8",
61+
"maturin-import-hook>=0.2.0",
62+
]
63+
lint = [
5364
"mypy==1.14.1",
5465
"pre-commit==4.0.1",
55-
"pycountry==24.6.1",
5666
"pylint==3.3.3",
67+
"types-cachetools>=5.5.0.20240820",
68+
"types-mock>=5.1.0.20240425",
69+
"types-pillow>=10.2.0.20240822",
70+
"maturin[patchelf]>=1.7.8",
71+
"maturin-import-hook>=0.2.0",
72+
]
73+
test = [
5774
"pytest-asyncio==0.25.2",
5875
"pytest-cov==6.0.0",
5976
"pytest-docker-fixtures==1.3.19",
6077
"pytest-timeout==2.3.1",
6178
"pytest==8.3.4",
6279
"testfixtures==8.3.0",
63-
"types-cachetools>=5.5.0.20240820",
64-
"types-mock>=5.1.0.20240425",
65-
"types-pillow>=10.2.0.20240822",
66-
"maturin[patchelf]>=1.7.8",
67-
"maturin-import-hook>=0.2.0",
68-
"pytest-codspeed>=3.1.2",
6980
]
7081

7182
[tool.maturin]

scripts/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sudo apt update
1111
sudo apt install -y pkg-config liblzma-dev
1212

1313
# Install project dependencies
14-
uv sync --frozen --dev
14+
uv sync --frozen --group dev
1515

1616
# Setup pre-commit
1717
pre-commit install

uv.lock

Lines changed: 54 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)