v0.9.0
Frequenz Repository Configuration Release Notes
Summary
This release brings support for pytest
8, a couple of bug fixes and many improvements to the cookiecutter template.
Upgrading
-
Once you upgraded, you'll be able to upgrade to
pytest
8, and indirectly tosybil
6, which includes types hints. If you do so, you should remove themypy
exception forsybil
in thepyproject.toml
file.Search for the
tool.mypy.overrides
section and remove the"sybil", "sybil.*"
enties from themodule
list.
Cookiecutter template
To upgrade without regenerating the project, you can follow these steps:
-
Run the following command to add the new
pylint
ignore rules:sed '/ # Checked by flake8/a\ "redefined-outer-name",\n "unused-import",' -i pyproject.toml
-
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.You can do this by re-importing the ruleset or manually:
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.
-
The
labeler
action was upgraded to 5.0.0. This needs a new configuration file.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:
import sys lines = [] state = "looking" with open(".github/labeler.yml", encoding="utf-8") as fin: for line in fin: if "changed-files:" in line: sys.stderr.write("Already fixed, aborting...\n") sys.exit(1) match state: case "looking": if not line.startswith(("#", " ", "\t")) and line.rstrip().endswith(":"): line = f"{line} - changed-files:\n - any-glob-to-any-file:\n" state = "in-label" case "in-label": if not line.lstrip().startswith("-"): state = "looking" else: line = f" {line}" lines.append(line) with open(".github/labeler.yml", "w", encoding="utf-8") as fout: fout.writelines(lines)
This will update the file in place, you can inspect the changes with
git diff
. -
For API projects, you can manually add instructions to update the
mkdocs.yml
when thefrequenz-api-common
dependency is updated.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
-
Run the following command to fix the
test-installation
CI job when using git URLs inpyproject.toml
:patch -p1 <<'EOF' diff --git a/.github/containers/test-installation/Dockerfile b/.github/containers/test-installation/Dockerfile index 772b2ae..2494545 100644 --- a/.github/containers/test-installation/Dockerfile +++ b/.github/containers/test-installation/Dockerfile @@ -6,7 +6,12 @@ FROM --platform=${TARGETPLATFORM} python:3.11-slim -RUN python -m pip install --upgrade --no-cache-dir pip +RUN apt-get update -y && \ + apt-get install --no-install-recommends -y \ + git && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* && \ + python -m pip install --upgrade --no-cache-dir pip COPY dist dist RUN pip install dist/*.whl && \ EOF
-
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 optionsubmodules: true
to thecheckout
action, for example:steps: - name: Fetch sources uses: actions/checkout@v4 with: submodules: recursive
New Features
- Add support for
pytest
8.
Cookiecutter template
- Some checks that are already performed by
flake8
are now disabled inpylint
to avoid double reporting. - The repository ruleset
Protect version branches
has been updated to allow repository maintainers to skip protection rules in PRs. - The
labeler
action was upgraded to 5.0.0, which allows for more complex matching rules. - Instruction were added to update the
mkdocs.yml
when thefrequenz-api-common
dependency is updated.
Bug Fixes
Cookiecutter template
- Fix the
test-installation
CI job when dependencies inpyproject.toml
contain git URLs. - Fix cross-arch testing for respositories with submodules.
What's Changed
- Clear release notes by @llucax in #206
- Make copyright year fakable in golden tests by @llucax in #212
- Make GitHub Pages configuration more accesible by @llucax in #214
- Add a few more checks to the
pylint
ignore list by @llucax in #208 - Allow repository maintainers to force-merge by @llucax in #213
- Upgrade to labeler 5.0.0 by @llucax in #211
- Add missing instruction to update dependencies by @llucax in #223
- ci: Support using git for dependencies in
test-installation
by @Marenz in #222 - Update pytest and sybil by @Marenz in #221
- Fetch submodules when doing cross-arch tests by @llucax in #225
- Prepare release notes for v0.9.0 by @llucax in #227
Full Changelog: v0.8.0...v0.9.0