Skip to content

Commit fea7837

Browse files
authored
Prepare for the v0.11.0 release (#333)
Update release notes and add come missing migration steps to the migration script.
2 parents ead1bd9 + 10676e3 commit fea7837

File tree

8 files changed

+63
-33
lines changed

8 files changed

+63
-33
lines changed

RELEASE_NOTES.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22

33
## Summary
44

5-
<!-- Here goes a general summary of what this release is about -->
5+
This version accumulates a few improvements, and bumps the dependency of setuptools to use v75, which is compatible with PEP625, which is necessary to be able to keep uploading to PyPI, so you should upgrade to this version as soon as possible.
6+
7+
The migration script was also rewritten in Python, so it should be more compatible with different OSes.
68

79
## Upgrading
810

911
- The `frequenz.repo.config.github.abort()` function now takes most arguments as keyword-only arguments.
1012
- The *Queue PRs for v0.x.x* GitHub ruleset was renamed to *Queue PRs for the default branch* and now targets the default branch. It also only have the merge queue restriction, all other restrictions were removed as they are already present in the *Protect version branches* ruleset. You might want to re-import this ruleset to your repositories.
1113

12-
### Cookiecutter template
13-
14-
<!-- Here upgrade steps for cookiecutter specifically -->
15-
1614
## New Features
1715

1816
* Added a new GitHub branch ruleset for Rust projects.
@@ -33,7 +31,3 @@
3331
## Bug Fixes
3432

3533
* Sybil now parses the `__init__.py` file as well. Previously it was disabled due to an upstream bug.
36-
37-
### Cookiecutter template
38-
39-
<!-- Here bug fixes for cookiecutter specifically -->

cookiecutter/migrate.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,32 @@ def add_pylint_checks() -> None:
128128
)
129129

130130

131+
def fix_default_fixture_scope() -> None:
132+
"""Fix the default scope of fixtures to 'function'."""
133+
pyproject_toml = Path("pyproject.toml")
134+
print(f"{pyproject_toml}: Fix the default scope of fixtures to 'function'.")
135+
marker = 'asyncio_mode = "auto"\n'
136+
pyproject_toml_content = pyproject_toml.read_text(encoding="utf-8")
137+
if pyproject_toml_content.find(marker) == -1:
138+
manual_step(
139+
f"""\
140+
{pyproject_toml}: We couldn't find the marker {marker!r} in the file.
141+
Please add the following line to the file manually in the
142+
`[tool.pytest.ini_options]` section if it is missing:
143+
asyncio_default_fixture_loop_scope = "function"
144+
"""
145+
)
146+
return
147+
148+
replacement = 'asyncio_default_fixture_loop_scope = "function"\n'
149+
if pyproject_toml_content.find(replacement) >= 0:
150+
print(f"{pyproject_toml}: seems to be already up-to-date.")
151+
return
152+
replace_file_contents_atomically(
153+
pyproject_toml, marker, marker + replacement, content=pyproject_toml_content
154+
)
155+
156+
131157
def main() -> None:
132158
"""Run the migration steps."""
133159
# Dependabot patch
@@ -177,6 +203,16 @@ def main() -> None:
177203
)
178204
else:
179205
print(f"{dockerfile}: Not found.")
206+
print("=" * 72)
207+
208+
# Make sure `edit_uri` points to the default branch
209+
manual_step(
210+
"Make sure that the `edit_uri` in the `mkdocs.yml` file points to the default branch."
211+
)
212+
print("=" * 72)
213+
214+
# Fix the default scope of fixtures to 'function'
215+
fix_default_fixture_scope()
180216

181217
# Add a separation line like this one after each migration step.
182218
print("=" * 72)

cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
requires = [
66
"setuptools == 75.5.0",
77
"setuptools_scm[toml] == 8.1.0",
8-
"frequenz-repo-config[{{cookiecutter.type}}] == 0.10.0",
8+
"frequenz-repo-config[{{cookiecutter.type}}] == 0.11.0",
99
{%- if cookiecutter.type == "api" %}
1010
# We need to pin the protobuf, grpcio and grpcio-tools dependencies to make
1111
# sure the code is generated using the minimum supported versions, as older
@@ -101,7 +101,7 @@ dev-mkdocs = [
101101
"mkdocs-material == 9.5.45",
102102
"mkdocstrings[python] == 0.27.0",
103103
"mkdocstrings-python == 1.12.2",
104-
"frequenz-repo-config[{{cookiecutter.type}}] == 0.10.0",
104+
"frequenz-repo-config[{{cookiecutter.type}}] == 0.11.0",
105105
]
106106
dev-mypy = [
107107
"mypy == 1.9.0",
@@ -114,7 +114,7 @@ dev-mypy = [
114114
]
115115
dev-noxfile = [
116116
"nox == 2024.10.9",
117-
"frequenz-repo-config[{{cookiecutter.type}}] == 0.10.0",
117+
"frequenz-repo-config[{{cookiecutter.type}}] == 0.11.0",
118118
]
119119
dev-pylint = [
120120
# dev-pytest already defines a dependency to pylint because of the examples
@@ -124,7 +124,7 @@ dev-pylint = [
124124
dev-pytest = [
125125
"pytest == 8.3.3",
126126
"pylint == 3.3.1", # We need this to check for the examples
127-
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
127+
"frequenz-repo-config[extra-lint-examples] == 0.11.0",
128128
{%- if cookiecutter.type != "api" %}
129129
"pytest-mock == 3.14.0",
130130
"pytest-asyncio == 0.24.0",

tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
requires = [
66
"setuptools == 75.5.0",
77
"setuptools_scm[toml] == 8.1.0",
8-
"frequenz-repo-config[actor] == 0.10.0",
8+
"frequenz-repo-config[actor] == 0.11.0",
99
]
1010
build-backend = "setuptools.build_meta"
1111

@@ -60,7 +60,7 @@ dev-mkdocs = [
6060
"mkdocs-material == 9.5.45",
6161
"mkdocstrings[python] == 0.27.0",
6262
"mkdocstrings-python == 1.12.2",
63-
"frequenz-repo-config[actor] == 0.10.0",
63+
"frequenz-repo-config[actor] == 0.11.0",
6464
]
6565
dev-mypy = [
6666
"mypy == 1.9.0",
@@ -70,7 +70,7 @@ dev-mypy = [
7070
]
7171
dev-noxfile = [
7272
"nox == 2024.10.9",
73-
"frequenz-repo-config[actor] == 0.10.0",
73+
"frequenz-repo-config[actor] == 0.11.0",
7474
]
7575
dev-pylint = [
7676
# dev-pytest already defines a dependency to pylint because of the examples
@@ -80,7 +80,7 @@ dev-pylint = [
8080
dev-pytest = [
8181
"pytest == 8.3.3",
8282
"pylint == 3.3.1", # We need this to check for the examples
83-
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
83+
"frequenz-repo-config[extra-lint-examples] == 0.11.0",
8484
"pytest-mock == 3.14.0",
8585
"pytest-asyncio == 0.24.0",
8686
"async-solipsism == 0.6",

tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
requires = [
66
"setuptools == 75.5.0",
77
"setuptools_scm[toml] == 8.1.0",
8-
"frequenz-repo-config[api] == 0.10.0",
8+
"frequenz-repo-config[api] == 0.11.0",
99
# We need to pin the protobuf, grpcio and grpcio-tools dependencies to make
1010
# sure the code is generated using the minimum supported versions, as older
1111
# versions can't work with code that was generated with newer versions.
@@ -71,7 +71,7 @@ dev-mkdocs = [
7171
"mkdocs-material == 9.5.45",
7272
"mkdocstrings[python] == 0.27.0",
7373
"mkdocstrings-python == 1.12.2",
74-
"frequenz-repo-config[api] == 0.10.0",
74+
"frequenz-repo-config[api] == 0.11.0",
7575
]
7676
dev-mypy = [
7777
"mypy == 1.9.0",
@@ -82,7 +82,7 @@ dev-mypy = [
8282
]
8383
dev-noxfile = [
8484
"nox == 2024.10.9",
85-
"frequenz-repo-config[api] == 0.10.0",
85+
"frequenz-repo-config[api] == 0.11.0",
8686
]
8787
dev-pylint = [
8888
# dev-pytest already defines a dependency to pylint because of the examples
@@ -92,7 +92,7 @@ dev-pylint = [
9292
dev-pytest = [
9393
"pytest == 8.3.3",
9494
"pylint == 3.3.1", # We need this to check for the examples
95-
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
95+
"frequenz-repo-config[extra-lint-examples] == 0.11.0",
9696
]
9797
dev = [
9898
"frequenz-api-test[dev-mkdocs,dev-flake8,dev-formatting,dev-mkdocs,dev-mypy,dev-noxfile,dev-pylint,dev-pytest]",

tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
requires = [
66
"setuptools == 75.5.0",
77
"setuptools_scm[toml] == 8.1.0",
8-
"frequenz-repo-config[app] == 0.10.0",
8+
"frequenz-repo-config[app] == 0.11.0",
99
]
1010
build-backend = "setuptools.build_meta"
1111

@@ -59,7 +59,7 @@ dev-mkdocs = [
5959
"mkdocs-material == 9.5.45",
6060
"mkdocstrings[python] == 0.27.0",
6161
"mkdocstrings-python == 1.12.2",
62-
"frequenz-repo-config[app] == 0.10.0",
62+
"frequenz-repo-config[app] == 0.11.0",
6363
]
6464
dev-mypy = [
6565
"mypy == 1.9.0",
@@ -69,7 +69,7 @@ dev-mypy = [
6969
]
7070
dev-noxfile = [
7171
"nox == 2024.10.9",
72-
"frequenz-repo-config[app] == 0.10.0",
72+
"frequenz-repo-config[app] == 0.11.0",
7373
]
7474
dev-pylint = [
7575
# dev-pytest already defines a dependency to pylint because of the examples
@@ -79,7 +79,7 @@ dev-pylint = [
7979
dev-pytest = [
8080
"pytest == 8.3.3",
8181
"pylint == 3.3.1", # We need this to check for the examples
82-
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
82+
"frequenz-repo-config[extra-lint-examples] == 0.11.0",
8383
"pytest-mock == 3.14.0",
8484
"pytest-asyncio == 0.24.0",
8585
"async-solipsism == 0.6",

tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
requires = [
66
"setuptools == 75.5.0",
77
"setuptools_scm[toml] == 8.1.0",
8-
"frequenz-repo-config[lib] == 0.10.0",
8+
"frequenz-repo-config[lib] == 0.11.0",
99
]
1010
build-backend = "setuptools.build_meta"
1111

@@ -56,7 +56,7 @@ dev-mkdocs = [
5656
"mkdocs-material == 9.5.45",
5757
"mkdocstrings[python] == 0.27.0",
5858
"mkdocstrings-python == 1.12.2",
59-
"frequenz-repo-config[lib] == 0.10.0",
59+
"frequenz-repo-config[lib] == 0.11.0",
6060
]
6161
dev-mypy = [
6262
"mypy == 1.9.0",
@@ -66,7 +66,7 @@ dev-mypy = [
6666
]
6767
dev-noxfile = [
6868
"nox == 2024.10.9",
69-
"frequenz-repo-config[lib] == 0.10.0",
69+
"frequenz-repo-config[lib] == 0.11.0",
7070
]
7171
dev-pylint = [
7272
# dev-pytest already defines a dependency to pylint because of the examples
@@ -76,7 +76,7 @@ dev-pylint = [
7676
dev-pytest = [
7777
"pytest == 8.3.3",
7878
"pylint == 3.3.1", # We need this to check for the examples
79-
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
79+
"frequenz-repo-config[extra-lint-examples] == 0.11.0",
8080
"pytest-mock == 3.14.0",
8181
"pytest-asyncio == 0.24.0",
8282
"async-solipsism == 0.6",

tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
requires = [
66
"setuptools == 75.5.0",
77
"setuptools_scm[toml] == 8.1.0",
8-
"frequenz-repo-config[model] == 0.10.0",
8+
"frequenz-repo-config[model] == 0.11.0",
99
]
1010
build-backend = "setuptools.build_meta"
1111

@@ -60,7 +60,7 @@ dev-mkdocs = [
6060
"mkdocs-material == 9.5.45",
6161
"mkdocstrings[python] == 0.27.0",
6262
"mkdocstrings-python == 1.12.2",
63-
"frequenz-repo-config[model] == 0.10.0",
63+
"frequenz-repo-config[model] == 0.11.0",
6464
]
6565
dev-mypy = [
6666
"mypy == 1.9.0",
@@ -70,7 +70,7 @@ dev-mypy = [
7070
]
7171
dev-noxfile = [
7272
"nox == 2024.10.9",
73-
"frequenz-repo-config[model] == 0.10.0",
73+
"frequenz-repo-config[model] == 0.11.0",
7474
]
7575
dev-pylint = [
7676
# dev-pytest already defines a dependency to pylint because of the examples
@@ -80,7 +80,7 @@ dev-pylint = [
8080
dev-pytest = [
8181
"pytest == 8.3.3",
8282
"pylint == 3.3.1", # We need this to check for the examples
83-
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
83+
"frequenz-repo-config[extra-lint-examples] == 0.11.0",
8484
"pytest-mock == 3.14.0",
8585
"pytest-asyncio == 0.24.0",
8686
"async-solipsism == 0.6",

0 commit comments

Comments
 (0)