|
2 | 2 |
|
3 | 3 | ## Summary |
4 | 4 |
|
5 | | -This release brings support for `pytest` 8, a couple of bug fixes and many improvements to the cookiecutter template. |
| 5 | +<!-- Here goes a general summary of what this release is about --> |
6 | 6 |
|
7 | 7 | ## Upgrading |
8 | 8 |
|
9 | | -- Once you upgraded, you'll be able to upgrade to `pytest` 8, and indirectly to `sybil` 6, which includes types hints. If you do so, you should remove the `mypy` exception for `sybil` in the `pyproject.toml` file. |
10 | | - |
11 | | - Search for the `tool.mypy.overrides` section and remove the `"sybil", "sybil.*"` enties from the `module` list. |
| 9 | +<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with --> |
12 | 10 |
|
13 | 11 | ### Cookiecutter template |
14 | 12 |
|
15 | | -To upgrade without regenerating the project, you can follow these steps: |
16 | | - |
17 | | -- Run the following command to add the new `pylint` ignore rules: |
18 | | - |
19 | | - ```sh |
20 | | - sed '/ # Checked by flake8/a\ "redefined-outer-name",\n "unused-import",' -i pyproject.toml |
21 | | - ``` |
22 | | - |
23 | | -- It is recommended to update this rule in your repository to use the new bypass rule for the `Protect version branches` ruleset that allows maintainers to force-merge. |
24 | | - |
25 | | - You can do this by re-importing the ruleset or manually: |
26 | | - |
27 | | - Go to the repository settings -> **Rules** -> **Rulesets** -> **Protect version branches** -> **Bypass list** -> **Add bypass** -> Select **Maintain** role and change the dropdown bypass rule to use **Pull requests** instead of **Always**. |
28 | | - |
29 | | -- The `labeler` action was upgraded to 5.0.0. This needs a new configuration file. |
30 | | - |
31 | | - If you haven't diverged much from the default configuration (and you are not using exclusion rules), you can update the configuration file by running this script in the root of your repository: |
32 | | -
|
33 | | - ```python |
34 | | - import sys |
35 | | - lines = [] |
36 | | - state = "looking" |
37 | | - with open(".github/labeler.yml", encoding="utf-8") as fin: |
38 | | - for line in fin: |
39 | | - if "changed-files:" in line: |
40 | | - sys.stderr.write("Already fixed, aborting...\n") |
41 | | - sys.exit(1) |
42 | | - match state: |
43 | | - case "looking": |
44 | | - if not line.startswith(("#", " ", "\t")) and line.rstrip().endswith(":"): |
45 | | - line = f"{line} - changed-files:\n - any-glob-to-any-file:\n" |
46 | | - state = "in-label" |
47 | | - case "in-label": |
48 | | - if not line.lstrip().startswith("-"): |
49 | | - state = "looking" |
50 | | - else: |
51 | | - line = f" {line}" |
52 | | - lines.append(line) |
53 | | - with open(".github/labeler.yml", "w", encoding="utf-8") as fout: |
54 | | - fout.writelines(lines) |
55 | | - ``` |
56 | | -
|
57 | | - This will update the file in place, you can inspect the changes with `git diff`. |
58 | | -
|
59 | | -- For API projects, you can manually add instructions to update the `mkdocs.yml` when the `frequenz-api-common` dependency is updated. |
60 | | -
|
61 | | - ```sh |
62 | | - awk -i inplace '/^sed s..frequenz-api-common/ { print; print "sed '"'"'s|https://frequenz-floss.github.io/frequenz-api-common/v[0-9].[0-9]/objects.inv|https://frequenz-floss.github.io/frequenz-api-common/v'"'"'${ver_minor}'"'"'/objects.inv|'"'"' -i mkdocs.yml"; next }1' CONTRIBUTING.md |
63 | | -
|
64 | | -- Run the following command to fix the `test-installation` CI job when using git URLs in `pyproject.toml`: |
65 | | -
|
66 | | - ```sh |
67 | | - patch -p1 <<'EOF' |
68 | | - diff --git a/.github/containers/test-installation/Dockerfile b/.github/containers/test-installation/Dockerfile |
69 | | - index 772b2ae..2494545 100644 |
70 | | - --- a/.github/containers/test-installation/Dockerfile |
71 | | - +++ b/.github/containers/test-installation/Dockerfile |
72 | | - @@ -6,7 +6,12 @@ |
73 | | -
|
74 | | - FROM --platform=${TARGETPLATFORM} python:3.11-slim |
75 | | -
|
76 | | - -RUN python -m pip install --upgrade --no-cache-dir pip |
77 | | - +RUN apt-get update -y && \ |
78 | | - + apt-get install --no-install-recommends -y \ |
79 | | - + git && \ |
80 | | - + apt-get clean && \ |
81 | | - + rm -rf /var/lib/apt/lists/* && \ |
82 | | - + python -m pip install --upgrade --no-cache-dir pip |
83 | | -
|
84 | | - COPY dist dist |
85 | | - RUN pip install dist/*.whl && \ |
86 | | - EOF |
87 | | -
|
88 | | -- If your repository uses submodules and do cross-arch tests, you need to update the `nox-cross-arch` job in the `.github/workflows/ci.yaml` workflow and add the option `submodules: true` to the `checkout` action, for example: |
89 | | -
|
90 | | - ```yaml |
91 | | - steps: |
92 | | - - name: Fetch sources |
93 | | - uses: actions/checkout@v4 |
94 | | - with: |
95 | | - submodules: recursive |
96 | | - ``` |
| 13 | +<!-- Here upgrade steps for cookiecutter specifically --> |
97 | 14 |
|
98 | 15 | ## New Features |
99 | 16 |
|
100 | | -- Add support for `pytest` 8. |
| 17 | +<!-- Here goes the main new features and examples or instructions on how to use them --> |
101 | 18 |
|
102 | 19 | ### Cookiecutter template |
103 | 20 |
|
104 | | -- Some checks that are already performed by `flake8` are now disabled in `pylint` to avoid double reporting. |
105 | | -- The repository ruleset `Protect version branches` has been updated to allow repository maintainers to skip protection rules in PRs. |
106 | | -- The `labeler` action was upgraded to 5.0.0, which allows for more complex matching rules. |
107 | | -- Instruction were added to update the `mkdocs.yml` when the `frequenz-api-common` dependency is updated. |
| 21 | +<!-- Here new features for cookiecutter specifically --> |
108 | 22 |
|
109 | 23 | ## Bug Fixes |
110 | 24 |
|
| 25 | +<!-- Here goes notable bug fixes that are worth a special mention or explanation --> |
| 26 | + |
111 | 27 | ### Cookiecutter template |
112 | 28 |
|
113 | | -- Fix the `test-installation` CI job when dependencies in `pyproject.toml` contain git URLs. |
114 | | -- Fix cross-arch testing for respositories with submodules. |
| 29 | +<!-- Here bug fixes for cookiecutter specifically --> |
0 commit comments