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
pytest8, and indirectly tosybil6, which includes types hints. If you do so, you should remove themypyexception forsybilin thepyproject.tomlfile.Search for the
tool.mypy.overridessection and remove the"sybil", "sybil.*"enties from themodulelist.
Cookiecutter template
To upgrade without regenerating the project, you can follow these steps:
-
Run the following command to add the new
pylintignore 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 branchesruleset 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
labeleraction 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.ymlwhen thefrequenz-api-commondependency 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-installationCI 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-archjob in the.github/workflows/ci.yamlworkflow and add the optionsubmodules: trueto thecheckoutaction, for example:steps: - name: Fetch sources uses: actions/checkout@v4 with: submodules: recursive
New Features
- Add support for
pytest8.
Cookiecutter template
- Some checks that are already performed by
flake8are now disabled inpylintto avoid double reporting. - The repository ruleset
Protect version brancheshas been updated to allow repository maintainers to skip protection rules in PRs. - The
labeleraction was upgraded to 5.0.0, which allows for more complex matching rules. - Instruction were added to update the
mkdocs.ymlwhen thefrequenz-api-commondependency is updated.
Bug Fixes
Cookiecutter template
- Fix the
test-installationCI job when dependencies inpyproject.tomlcontain 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
pylintignore 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-installationby @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