Skip to content

Commit 9c17f53

Browse files
authored
Merge pull request #523 from powerapi-ng/build/dependency-groups
build: Improve development dependencies handling
2 parents 9b67dd5 + ef61983 commit 9c17f53

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,24 @@ jobs:
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727

28+
- name: Install uv
29+
uses: astral-sh/setup-uv@b5f58b2abc5763ade55e4e9d0fe52cd1ff7979ca # v5.2.1
30+
2831
- name: Install dependencies
2932
run: |
30-
python -m pip install --upgrade pip
31-
pip install -e ".[devel]"
33+
uv sync --extra everything --dev
3234
3335
- name: Lint with flake8
3436
run: |
35-
flake8 --count --show-source --statistics src/ tests/
37+
uv run flake8 --count --show-source --statistics src/ tests/
3638
3739
- name: Static code analysis with pylint
3840
run: |
39-
pylint src/ tests/
41+
uv run pylint src/ tests/
4042
4143
- name: Test with pytest
4244
run: |
43-
pytest --cov=powerapi --cov-report=term --cov-report=xml tests/unit
45+
uv run pytest --cov=powerapi --cov-report=term --cov-report=xml tests/unit
4446
4547
- name: Upload coverage reports to Codecov
4648
if: ${{ matrix.python-version }} == "3.10"

pyproject.toml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,21 @@ dependencies = [
3333
]
3434

3535
[project.optional-dependencies]
36+
# Databases:
37+
mongodb = ["pymongo >= 3.7.2"]
38+
influxdb = ["influxdb-client >= 1.30.0"]
39+
opentsdb = ["opentsdb-py >= 0.6.0"]
40+
prometheus = ["prometheus-client >= 0.9.0"]
41+
42+
# Plaforms:
43+
kubernetes = ["kubernetes >= 27.0.2"]
44+
45+
# Aliases:
46+
all-databases = ["powerapi[mongodb, influxdb, opentsdb, prometheus]"]
47+
all-platforms = ["powerapi[kubernetes]"]
48+
everything = ["powerapi[all-databases, all-platforms]"]
49+
50+
[dependency-groups]
3651
test = [
3752
"pytest >= 7.0.1",
3853
"pytest-timeout >= 1.4.2",
@@ -50,20 +65,11 @@ lint = [
5065
"pylint >= 2.16.0"
5166
]
5267

53-
# Databases:
54-
mongodb = ["pymongo >= 3.7.2"]
55-
influxdb = ["influxdb-client >= 1.30.0"]
56-
opentsdb = ["opentsdb-py >= 0.6.0"]
57-
prometheus = ["prometheus-client >= 0.9.0"]
58-
59-
# Plaforms:
60-
kubernetes = ["kubernetes >= 27.0.2"]
61-
62-
# Aliases:
63-
all-databases = ["powerapi[mongodb, influxdb, opentsdb, prometheus]"]
64-
all-platforms = ["powerapi[kubernetes]"]
65-
everything = ["powerapi[all-databases, all-platforms]"]
66-
devel = ["powerapi[everything, test, docs, lint]"]
68+
dev = [
69+
{include-group = 'test'},
70+
{include-group = 'docs'},
71+
{include-group = 'lint'}
72+
]
6773

6874
[project.urls]
6975
homepage = "https://powerapi.org"
@@ -72,4 +78,3 @@ repository = "https://github.com/powerapi-ng/powerapi"
7278

7379
[tool.setuptools.dynamic]
7480
version = {attr = "powerapi.__version__"}
75-

0 commit comments

Comments
 (0)