Skip to content

Commit 37d223f

Browse files
authored
Clear release notes (#334)
2 parents fea7837 + 04845f4 commit 37d223f

File tree

2 files changed

+19
-143
lines changed

2 files changed

+19
-143
lines changed

RELEASE_NOTES.md

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,28 @@
22

33
## Summary
44

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.
5+
<!-- Here goes a general summary of what this release is about -->
86

97
## Upgrading
108

11-
- The `frequenz.repo.config.github.abort()` function now takes most arguments as keyword-only arguments.
12-
- 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.
9+
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
10+
11+
### Cookiecutter template
12+
13+
<!-- Here upgrade steps for cookiecutter specifically -->
1314

1415
## New Features
1516

16-
* Added a new GitHub branch ruleset for Rust projects.
17+
<!-- Here goes the main new features and examples or instructions on how to use them -->
1718

1819
### Cookiecutter template
1920

20-
* Group GitHub Actions dependabot updates.
21-
* API projects don't include the `google-common-protos` dependency by default.
22-
* API projects updated the `grpcio` dependency to `1.66.1`.
23-
* API projects updated the `frequenz-api-common` dependency to `0.6`.
24-
* Bump most of the dependencies.
25-
* Change `edit_uri` default branch to v0.x.x in mkdocs.yml.
26-
* Added a new default option `asyncio_default_fixture_loop_scope = "function"` for `pytest-asyncio` as not providing a value is deprecated.
27-
* The migration script is now written in Python, so it should be (hopefully) more compatible with different OSes.
28-
* Disable more `pylint` checks that are also checked by `mypy` to avoid false positives.
29-
* Remove the redundant `--platform` from the testing dockerfile.
21+
<!-- Here new features for cookiecutter specifically -->
3022

3123
## Bug Fixes
3224

33-
* Sybil now parses the `__init__.py` file as well. Previously it was disabled due to an upstream bug.
25+
<!-- Here goes notable bug fixes that are worth a special mention or explanation -->
26+
27+
### Cookiecutter template
28+
29+
<!-- Here bug fixes for cookiecutter specifically -->

cookiecutter/migrate.py

Lines changed: 6 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
from typing import SupportsIndex
2828

2929

30+
def main() -> None:
31+
"""Run the migration steps."""
32+
# Add a separation line like this one after each migration step.
33+
print("=" * 72)
34+
35+
3036
def apply_patch(patch_content: str) -> None:
3137
"""Apply a patch using the patch utility."""
3238
subprocess.run(["patch", "-p1"], input=patch_content.encode(), check=True)
@@ -92,132 +98,6 @@ def replace_file_contents_atomically( # noqa; DOC501
9298
raise
9399

94100

95-
def add_pylint_checks() -> None:
96-
"""Add new pylint checks to the project."""
97-
pyproject_toml = Path("pyproject.toml")
98-
print(
99-
f"{pyproject_toml}: Skip some flaky pylint checks that are checked better by mypy."
100-
)
101-
marker = ' "no-member",\n'
102-
pyproject_toml_content = pyproject_toml.read_text(encoding="utf-8")
103-
if pyproject_toml_content.find(marker) == -1:
104-
manual_step(
105-
f"""\
106-
{pyproject_toml}: We couldn't find the marker {marker!r} in the file.
107-
Please add the following lines to the file manually in the
108-
`[tool.pylint.messages_control]` section, under the `disable` key (ideally below other
109-
checks that are disabled because `mypy` already checks them) if they are missing:
110-
"no-name-in-module",
111-
"possibly-used-before-assignment",
112-
"""
113-
)
114-
return
115-
116-
replacement = ""
117-
if pyproject_toml_content.find("possibly-used-before-assignment") == -1:
118-
replacement += ' "possibly-used-before-assignment",\n'
119-
if pyproject_toml_content.find("no-name-in-module") == -1:
120-
replacement += ' "no-name-in-module",\n'
121-
122-
if not replacement:
123-
print(f"{pyproject_toml}: seems to be already up-to-date.")
124-
return
125-
126-
replace_file_contents_atomically(
127-
pyproject_toml, marker, marker + replacement, content=pyproject_toml_content
128-
)
129-
130-
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-
157-
def main() -> None:
158-
"""Run the migration steps."""
159-
# Dependabot patch
160-
dependabot_yaml = Path(".github/dependabot.yml")
161-
print(f"{dependabot_yaml}: Add new grouping for actions/*-artifact updates.")
162-
if dependabot_yaml.read_text(encoding="utf-8").find("actions/*-artifact") == -1:
163-
apply_patch(
164-
"""\
165-
--- a/.github/dependabot.yml
166-
+++ b/.github/dependabot.yml
167-
@@ -39,3 +39,11 @@ updates:
168-
labels:
169-
- "part:tooling"
170-
- "type:tech-debt"
171-
+ groups:
172-
+ compatible:
173-
+ update-types:
174-
+ - "minor"
175-
+ - "patch"
176-
+ artifacts:
177-
+ patterns:
178-
+ - "actions/*-artifact"
179-
"""
180-
)
181-
else:
182-
print(f"{dependabot_yaml}: seems to be already up-to-date.")
183-
print("=" * 72)
184-
185-
# Fix labeler configuration
186-
labeler_yml = ".github/labeler.yml"
187-
print(f"{labeler_yml}: Fix the labeler configuration example.")
188-
replace_file_contents_atomically(
189-
labeler_yml, "all-glob-to-all-file", "all-globs-to-all-files"
190-
)
191-
print("=" * 72)
192-
193-
# Add new pylint checks
194-
add_pylint_checks()
195-
print("=" * 72)
196-
197-
# Remove redundant --platform from the dockerfile
198-
dockerfile = Path(".github/containers/test-installation/Dockerfile")
199-
print(f"{dockerfile}: Removing redundant --platform.")
200-
if dockerfile.is_file():
201-
replace_file_contents_atomically(
202-
dockerfile, "--platform=${TARGETPLATFORM} ", ""
203-
)
204-
else:
205-
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()
216-
217-
# Add a separation line like this one after each migration step.
218-
print("=" * 72)
219-
220-
221101
def manual_step(message: str) -> None:
222102
"""Print a manual step message in yellow."""
223103
print(f"\033[0;33m>>> {message}\033[0m")

0 commit comments

Comments
 (0)