Skip to content

Commit 9a078a0

Browse files
Merge branch 'v0.x.x' into dependabot/pip/black-26.1.0
Signed-off-by: daniel-zullo-frequenz <120166726+daniel-zullo-frequenz@users.noreply.github.com>
2 parents a550bac + 5d56713 commit 9a078a0

12 files changed

Lines changed: 160 additions & 36 deletions

File tree

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ updates:
3838
- "mkdocs-gen-files"
3939
- "mkdocs-literate-nav"
4040
- "mkdocstrings*"
41+
- "mkdocstrings[python]"
4142
- "pydoclint"
4243
- "pytest-asyncio"
4344
mkdocstrings:
4445
patterns:
4546
- "mkdocstrings*"
47+
- "mkdocstrings[python]"
4648

4749
- package-ecosystem: "github-actions"
4850
directory: "/"

.github/workflows/ci-pr.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
submodules: true
3636

3737
- name: Setup Python
38-
uses: frequenz-floss/gh-action-setup-python-with-deps@v1.0.1
38+
uses: frequenz-floss/gh-action-setup-python-with-deps@v1.0.2
3939
with:
4040
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
4141
dependencies: .[dev-mkdocs]
@@ -48,7 +48,7 @@ jobs:
4848
mike set-default $MIKE_VERSION
4949
5050
- name: Upload site
51-
uses: actions/upload-artifact@v5
51+
uses: actions/upload-artifact@v6
5252
with:
5353
name: docs-site
5454
path: site/

.github/workflows/ci.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
submodules: true
8585

8686
- name: Setup Python
87-
uses: frequenz-floss/gh-action-setup-python-with-deps@v1.0.1
87+
uses: frequenz-floss/gh-action-setup-python-with-deps@v1.0.2
8888
with:
8989
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
9090
dependencies: build
@@ -93,7 +93,7 @@ jobs:
9393
run: python -m build
9494

9595
- name: Upload distribution files
96-
uses: actions/upload-artifact@v5
96+
uses: actions/upload-artifact@v6
9797
with:
9898
name: dist-packages
9999
path: dist/
@@ -143,7 +143,7 @@ jobs:
143143
> pyproject.toml
144144
145145
- name: Setup Python
146-
uses: frequenz-floss/gh-action-setup-python-with-deps@v1.0.1
146+
uses: frequenz-floss/gh-action-setup-python-with-deps@v1.0.2
147147
with:
148148
python-version: ${{ matrix.python }}
149149
dependencies: dist/*.whl
@@ -182,7 +182,7 @@ jobs:
182182
submodules: true
183183

184184
- name: Setup Python
185-
uses: frequenz-floss/gh-action-setup-python-with-deps@v1.0.1
185+
uses: frequenz-floss/gh-action-setup-python-with-deps@v1.0.2
186186
with:
187187
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
188188
dependencies: .[dev-mkdocs]
@@ -195,7 +195,7 @@ jobs:
195195
mike set-default $MIKE_VERSION
196196
197197
- name: Upload site
198-
uses: actions/upload-artifact@v5
198+
uses: actions/upload-artifact@v6
199199
with:
200200
name: docs-site
201201
path: site/
@@ -218,7 +218,7 @@ jobs:
218218
submodules: true
219219

220220
- name: Setup Python
221-
uses: frequenz-floss/gh-action-setup-python-with-deps@v1.0.1
221+
uses: frequenz-floss/gh-action-setup-python-with-deps@v1.0.2
222222
with:
223223
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
224224
dependencies: .[dev-mkdocs]

RELEASE_NOTES.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,8 @@ But you might still need to adapt your code:
4545

4646
### Cookiecutter template
4747

48-
- Switched `project.license` to SPDX expressions and added `project.license-files`.
49-
This removes deprecated setuptools license metadata and avoids build warnings.
50-
51-
- Fixed auto-dependabot workflow failing to trigger merge queue CI or complete
52-
auto-merge. The workflow now uses a GitHub App installation token (via
53-
`actions/create-github-app-token`) instead of `GITHUB_TOKEN`, which was
54-
suppressing subsequent workflow runs by design. Workflow permissions have been
55-
reduced to the minimum needed for the workflow (`contents: read` and
56-
`pull-requests: write`).
48+
- Switched `project.license` to SPDX expressions and added `project.license-files`. This removes deprecated setuptools license metadata and avoids build warnings.
49+
50+
- Fixed auto-dependabot workflow failing to trigger merge queue CI or complete auto-merge. The workflow now uses a GitHub App installation token (via `actions/create-github-app-token`) instead of `GITHUB_TOKEN`, which was suppressing subsequent workflow runs by design. Workflow permissions have been reduced to the minimum needed for the workflow (`contents: read` and `pull-requests: write`).
51+
52+
- Fix dependabot group patterns for repo-config and mkdocstrings.

cookiecutter/migrate.py

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ def main() -> None:
4646
print("Adding flake8-datetimez plugin to dev-flake8 dependencies...")
4747
migrate_add_flake8_datetimez()
4848
print("=" * 72)
49+
print("Fixing dependabot repo-config and mkdocstrings patterns...")
50+
migrate_dependabot_patterns()
51+
print("=" * 72)
4952
print("Migrating auto-dependabot workflow to use GitHub App token...")
5053
migrate_auto_dependabot_token()
5154
print("=" * 72)
@@ -323,6 +326,93 @@ def migrate_add_flake8_datetimez() -> None:
323326
print(" Updated pyproject.toml: added flake8-datetimez plugin")
324327

325328

329+
def migrate_dependabot_patterns() -> None:
330+
"""Fix dependabot repo-config and mkdocstrings dependency patterns.
331+
332+
Dependabot wildcards don't work when ``[]`` is involved in optional
333+
dependency specifiers, so we need to list them explicitly in the
334+
include/exclude patterns.
335+
336+
This replaces ``frequenz-repo-config*`` with explicit entries for the
337+
base package, the project-type extra, and the ``extra-lint-examples``
338+
extra, and adds ``mkdocstrings[python]`` alongside ``mkdocstrings*``.
339+
"""
340+
filepath = Path(".github") / "dependabot.yml"
341+
if not filepath.exists():
342+
manual_step(
343+
f"Unable to find {filepath}. Please update your dependabot config "
344+
"manually by replacing any `frequenz-repo-config*` patterns with explicit "
345+
"entries for `frequenz-repo-config`, `frequenz-repo-config[<your-type>]`, and "
346+
"`frequenz-repo-config[extra-lint-examples]`, and add `mkdocstrings[python]` "
347+
"to the patterns for the `mkdocstrings` group if it is missing."
348+
)
349+
return
350+
351+
content = filepath.read_text(encoding="utf-8")
352+
new_content = content
353+
updated = False
354+
355+
project_type = read_project_type()
356+
if project_type is None:
357+
manual_step(
358+
"Unable to detect the cookiecutter project type from "
359+
".cookiecutter-replay.json; cannot determine the correct "
360+
"frequenz-repo-config optional dependency for dependabot.yml. "
361+
"Please replace any `frequenz-repo-config*` patterns with explicit "
362+
"entries for `frequenz-repo-config`, "
363+
"`frequenz-repo-config[<your-type>]`, and "
364+
"`frequenz-repo-config[extra-lint-examples]`."
365+
)
366+
return
367+
368+
# Replace frequenz-repo-config* with explicit entries (appears in both
369+
# exclude-patterns and repo-config group patterns).
370+
old_repo_config = ' - "frequenz-repo-config*"\n'
371+
new_repo_config = (
372+
' - "frequenz-repo-config"\n'
373+
f' - "frequenz-repo-config[{project_type}]"\n'
374+
' - "frequenz-repo-config[extra-lint-examples]"\n'
375+
)
376+
if old_repo_config in new_content:
377+
new_content = new_content.replace(old_repo_config, new_repo_config)
378+
updated = True
379+
elif f'"frequenz-repo-config[{project_type}]"' in new_content:
380+
print(f" Skipped {filepath}: repo-config patterns already updated")
381+
else:
382+
manual_step(
383+
f"Could not find `frequenz-repo-config*` pattern in {filepath}. "
384+
"Please replace it with explicit entries for "
385+
"`frequenz-repo-config`, "
386+
f"`frequenz-repo-config[{project_type}]`, and "
387+
"`frequenz-repo-config[extra-lint-examples]`."
388+
)
389+
390+
# Add mkdocstrings[python] after mkdocstrings* (appears in both
391+
# exclude-patterns and mkdocstrings group patterns).
392+
old_mkdocstrings = ' - "mkdocstrings*"\n'
393+
new_mkdocstrings = (
394+
' - "mkdocstrings*"\n - "mkdocstrings[python]"\n'
395+
)
396+
if old_mkdocstrings in new_content and '"mkdocstrings[python]"' not in new_content:
397+
new_content = new_content.replace(old_mkdocstrings, new_mkdocstrings)
398+
updated = True
399+
elif '"mkdocstrings[python]"' in new_content:
400+
print(f" Skipped {filepath}: mkdocstrings patterns already updated")
401+
else:
402+
manual_step(
403+
f"Could not find `mkdocstrings*` pattern in {filepath}. "
404+
'Please add `"mkdocstrings[python]"` alongside `"mkdocstrings*"` '
405+
"in both the exclude-patterns and the mkdocstrings group."
406+
)
407+
408+
if not updated or new_content == content:
409+
print(f" Skipped {filepath} (already up to date)")
410+
return
411+
412+
replace_file_contents_atomically(filepath, content, new_content, count=1)
413+
print(f" Updated {filepath}: fixed repo-config and mkdocstrings patterns")
414+
415+
326416
def migrate_auto_dependabot_token() -> None:
327417
"""Migrate auto-dependabot workflow to use a GitHub App installation token.
328418

cookiecutter/{{cookiecutter.github_repo_name}}/.github/dependabot.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,28 @@ updates:
3737
{%- if cookiecutter.type == "api" %}
3838
- "frequenz-api-common"
3939
{%- endif %}
40-
- "frequenz-repo-config*"
40+
- "frequenz-repo-config"
41+
- "frequenz-repo-config[{{ cookiecutter.type }}]"
42+
- "frequenz-repo-config[extra-lint-examples]"
4143
- "markdown-callouts"
4244
- "mkdocs-gen-files"
4345
- "mkdocs-literate-nav"
4446
- "mkdocstrings*"
47+
- "mkdocstrings[python]"
4548
- "pydoclint"
4649
- "pytest-asyncio"
4750
# We group repo-config updates as it uses optional dependencies that are
4851
# considered different dependencies otherwise, and will create one PR for
4952
# each if we don't group them.
5053
repo-config:
5154
patterns:
52-
- "frequenz-repo-config*"
55+
- "frequenz-repo-config"
56+
- "frequenz-repo-config[{{ cookiecutter.type }}]"
57+
- "frequenz-repo-config[extra-lint-examples]"
5358
mkdocstrings:
5459
patterns:
5560
- "mkdocstrings*"
61+
- "mkdocstrings[python]"
5662

5763
- package-ecosystem: "github-actions"
5864
directory: "/"

pyproject.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,26 +78,26 @@ dev-flake8 = [
7878
dev-formatting = ["black == 26.1.0", "isort == 7.0.0"]
7979
dev-mkdocs = [
8080
"black == 26.1.0",
81-
"Markdown == 3.10",
81+
"Markdown == 3.10.2",
8282
"mike == 2.1.3",
8383
"mkdocs-gen-files == 0.6.0",
8484
"mkdocs-literate-nav == 0.6.2",
8585
"mkdocs-macros-plugin == 1.5.0",
86-
"mkdocs-material == 9.7.1",
87-
"mkdocstrings[python] == 1.0.0",
88-
"mkdocstrings-python == 2.0.1",
86+
"mkdocs-material == 9.7.2",
87+
"mkdocstrings[python] == 1.0.3",
88+
"mkdocstrings-python == 2.0.2",
8989
]
9090
dev-mypy = [
9191
"mypy == 1.19.1",
92-
"types-setuptools >= 67.6.0, < 81", # Should match the api dependency
93-
"types-Markdown == 3.10.0.20251106",
92+
"types-setuptools >= 67.6.0, < 83", # Should match the api dependency
93+
"types-Markdown == 3.10.2.20260211",
9494
"types-PyYAML == 6.0.12.20250915",
9595
"types-babel == 2.11.0.15",
9696
"types-colorama == 0.4.15.20250801",
9797
# For checking the noxfile, docs/ script, and tests
9898
"frequenz-repo-config[dev-mkdocs,dev-noxfile,dev-pytest]",
9999
]
100-
dev-noxfile = ["nox == 2025.11.12"]
100+
dev-noxfile = ["nox == 2026.2.9"]
101101
dev-pylint = [
102102
# dev-pytest already defines a dependency to pylint because of the examples
103103
# For checking the noxfile, docs/ script, and tests

tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/dependabot.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,28 @@ updates:
3434
- "minor"
3535
exclude-patterns:
3636
- "async-solipsism"
37-
- "frequenz-repo-config*"
37+
- "frequenz-repo-config"
38+
- "frequenz-repo-config[actor]"
39+
- "frequenz-repo-config[extra-lint-examples]"
3840
- "markdown-callouts"
3941
- "mkdocs-gen-files"
4042
- "mkdocs-literate-nav"
4143
- "mkdocstrings*"
44+
- "mkdocstrings[python]"
4245
- "pydoclint"
4346
- "pytest-asyncio"
4447
# We group repo-config updates as it uses optional dependencies that are
4548
# considered different dependencies otherwise, and will create one PR for
4649
# each if we don't group them.
4750
repo-config:
4851
patterns:
49-
- "frequenz-repo-config*"
52+
- "frequenz-repo-config"
53+
- "frequenz-repo-config[actor]"
54+
- "frequenz-repo-config[extra-lint-examples]"
5055
mkdocstrings:
5156
patterns:
5257
- "mkdocstrings*"
58+
- "mkdocstrings[python]"
5359

5460
- package-ecosystem: "github-actions"
5561
directory: "/"

tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/dependabot.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,28 @@ updates:
3535
exclude-patterns:
3636
- "async-solipsism"
3737
- "frequenz-api-common"
38-
- "frequenz-repo-config*"
38+
- "frequenz-repo-config"
39+
- "frequenz-repo-config[api]"
40+
- "frequenz-repo-config[extra-lint-examples]"
3941
- "markdown-callouts"
4042
- "mkdocs-gen-files"
4143
- "mkdocs-literate-nav"
4244
- "mkdocstrings*"
45+
- "mkdocstrings[python]"
4346
- "pydoclint"
4447
- "pytest-asyncio"
4548
# We group repo-config updates as it uses optional dependencies that are
4649
# considered different dependencies otherwise, and will create one PR for
4750
# each if we don't group them.
4851
repo-config:
4952
patterns:
50-
- "frequenz-repo-config*"
53+
- "frequenz-repo-config"
54+
- "frequenz-repo-config[api]"
55+
- "frequenz-repo-config[extra-lint-examples]"
5156
mkdocstrings:
5257
patterns:
5358
- "mkdocstrings*"
59+
- "mkdocstrings[python]"
5460

5561
- package-ecosystem: "github-actions"
5662
directory: "/"

tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/dependabot.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,28 @@ updates:
3434
- "minor"
3535
exclude-patterns:
3636
- "async-solipsism"
37-
- "frequenz-repo-config*"
37+
- "frequenz-repo-config"
38+
- "frequenz-repo-config[app]"
39+
- "frequenz-repo-config[extra-lint-examples]"
3840
- "markdown-callouts"
3941
- "mkdocs-gen-files"
4042
- "mkdocs-literate-nav"
4143
- "mkdocstrings*"
44+
- "mkdocstrings[python]"
4245
- "pydoclint"
4346
- "pytest-asyncio"
4447
# We group repo-config updates as it uses optional dependencies that are
4548
# considered different dependencies otherwise, and will create one PR for
4649
# each if we don't group them.
4750
repo-config:
4851
patterns:
49-
- "frequenz-repo-config*"
52+
- "frequenz-repo-config"
53+
- "frequenz-repo-config[app]"
54+
- "frequenz-repo-config[extra-lint-examples]"
5055
mkdocstrings:
5156
patterns:
5257
- "mkdocstrings*"
58+
- "mkdocstrings[python]"
5359

5460
- package-ecosystem: "github-actions"
5561
directory: "/"

0 commit comments

Comments
 (0)