Releases: frequenz-floss/frequenz-repo-config-python
v0.11.0
Frequenz Repository Configuration Release Notes
Summary
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.
The migration script was also rewritten in Python, so it should be more compatible with different OSes.
Upgrading
- The
frequenz.repo.config.github.abort()
function now takes most arguments as keyword-only arguments. - 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.
Cookiecutter template
-
Run the migration script to incorporate the changes to the cookiecutter templates for this release.
-
API projects don't include the
google-common-protos
dependency by default, if you need that dependency you need to update your configuration inpyproject.toml
:[tool.frequenz-repo-config.protobuf] include_paths = ["submodules/api-common-protos", "submodules/frequenz-api-common/proto"]
(you need to adapt the list of include path to all the submodules you are including in your API)
New Features
- Added a new GitHub branch ruleset for Rust projects.
Cookiecutter template
- Group GitHub Actions dependabot updates.
- API projects don't include the
google-common-protos
dependency by default. - API projects updated the
grpcio
dependency to1.66.1
. - API projects updated the
frequenz-api-common
dependency to0.6
. - Bump most of the dependencies.
- Change
edit_uri
default branch to v0.x.x in mkdocs.yml. - Added a new default option
asyncio_default_fixture_loop_scope = "function"
forpytest-asyncio
as not providing a value is deprecated. - The migration script is now written in Python, so it should be (hopefully) more compatible with different OSes.
- Disable more
pylint
checks that are also checked bymypy
to avoid false positives. - Remove the redundant
--platform
from the testing dockerfile.
Bug Fixes
- Sybil now parses the
__init__.py
file as well. Previously it was disabled due to an upstream bug.
What's Changed
- Fix TODO typos for workflows/release-notes-checks by @daniel-zullo-frequenz in #291
- Reset release notes and migration script for the next release by @llucax in #292
- Group dependabot updates for GitHub Actions by @llucax in #293
- Bump types-pyyaml from 6.0.12.20240311 to 6.0.12.20240724 by @dependabot in #297
- Update types-setuptools requirement from <71,>=67.6.0 to >=67.6.0,<72 by @dependabot in #296
- Update setuptools requirement from <71,>=67.6.0 to >=67.6.0,<72 by @dependabot in #295
- Bump the required group with 5 updates by @dependabot in #294
- Bump the required group with 4 updates by @dependabot in #300
- Update setuptools requirement from <72,>=67.6.0 to >=67.6.0,<73 by @dependabot in #301
- Pin protobuf related dependencies by @llucax in #309
- Bump the required group across 1 directory with 10 updates by @dependabot in #310
- Bump types-pyyaml from 6.0.12.20240724 to 6.0.12.20240808 by @dependabot in #307
- Update setuptools requirement from <73,>=67.6.0 to >=67.6.0,<75 by @dependabot in #306
- Fix the labeler configuration example by @llucax in #304
- Update types-setuptools requirement from <72,>=67.6.0 to >=67.6.0,<75 by @dependabot in #308
- Update setuptools requirement from <75,>=67.6.0 to >=67.6.0,<76 by @dependabot in #314
- Bump the required group with 4 updates by @dependabot in #312
- Update sybil requirement from <7,>=6.1.1 to >=6.1.1,<9 by @dependabot in #315
- Change edit_uri default branch to v0.x.x in mkdocs.yml by @cwasicki in #311
- Update types-setuptools requirement from <75,>=67.6.0 to >=67.6.0,<76 by @dependabot in #313
- Bump types-pyyaml from 6.0.12.20240808 to 6.0.12.20240917 by @dependabot in #316
- Bump SDK dependency to 1.0.0rc901 by @llucax in #317
- Add
asyncio_default_fixture_loop_scope = "function"
option by @llucax in #318 - Add GitHub branch ruleset for Rust by @llucax in #320
- Sybil: Parse init by @Marenz in #321
- Bump the required group with 7 updates by @dependabot in #322
- Bump the required group with 2 updates by @dependabot in #325
- Bump setuptools-scm[toml] from 7.1.0 to 8.1.0 by @dependabot in #326
- Update sybil requirement from <9,>=6.1.1 to >=6.1.1,<10 by @dependabot in #327
- Port the migration script to Python by @llucax in #329
- Disable more pylint checks that are also checked by mypy by @llucax in #330
- Bump dependencies in the template by @llucax in #331
- Remove the redundant
--platform
from theDockerfile
by @llucax in #332 - Prepare for the v0.11.0 release by @llucax in #333
New Contributors
- @daniel-zullo-frequenz made their first contribution in #291
Full Changelog: v0.10.0...v0.11.0
v0.11.0-rc1
Frequenz Repository Configuration Release Notes
Summary
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.
The migration script was also rewritten in Python, so it should be more compatible with different OSes.
Upgrading
- The
frequenz.repo.config.github.abort()
function now takes most arguments as keyword-only arguments. - 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.
New Features
- Added a new GitHub branch ruleset for Rust projects.
Cookiecutter template
- Group GitHub Actions dependabot updates.
- API projects don't include the
google-common-protos
dependency by default. - API projects updated the
grpcio
dependency to1.66.1
. - API projects updated the
frequenz-api-common
dependency to0.6
. - Bump most of the dependencies.
- Change
edit_uri
default branch to v0.x.x in mkdocs.yml. - Added a new default option
asyncio_default_fixture_loop_scope = "function"
forpytest-asyncio
as not providing a value is deprecated. - The migration script is now written in Python, so it should be (hopefully) more compatible with different OSes.
- Disable more
pylint
checks that are also checked bymypy
to avoid false positives. - Remove the redundant
--platform
from the testing dockerfile.
Bug Fixes
- Sybil now parses the
__init__.py
file as well. Previously it was disabled due to an upstream bug.
What's Changed
- Fix TODO typos for workflows/release-notes-checks by @daniel-zullo-frequenz in #291
- Reset release notes and migration script for the next release by @llucax in #292
- Group dependabot updates for GitHub Actions by @llucax in #293
- Bump types-pyyaml from 6.0.12.20240311 to 6.0.12.20240724 by @dependabot in #297
- Update types-setuptools requirement from <71,>=67.6.0 to >=67.6.0,<72 by @dependabot in #296
- Update setuptools requirement from <71,>=67.6.0 to >=67.6.0,<72 by @dependabot in #295
- Bump the required group with 5 updates by @dependabot in #294
- Bump the required group with 4 updates by @dependabot in #300
- Update setuptools requirement from <72,>=67.6.0 to >=67.6.0,<73 by @dependabot in #301
- Pin protobuf related dependencies by @llucax in #309
- Bump the required group across 1 directory with 10 updates by @dependabot in #310
- Bump types-pyyaml from 6.0.12.20240724 to 6.0.12.20240808 by @dependabot in #307
- Update setuptools requirement from <73,>=67.6.0 to >=67.6.0,<75 by @dependabot in #306
- Fix the labeler configuration example by @llucax in #304
- Update types-setuptools requirement from <72,>=67.6.0 to >=67.6.0,<75 by @dependabot in #308
- Update setuptools requirement from <75,>=67.6.0 to >=67.6.0,<76 by @dependabot in #314
- Bump the required group with 4 updates by @dependabot in #312
- Update sybil requirement from <7,>=6.1.1 to >=6.1.1,<9 by @dependabot in #315
- Change edit_uri default branch to v0.x.x in mkdocs.yml by @cwasicki in #311
- Update types-setuptools requirement from <75,>=67.6.0 to >=67.6.0,<76 by @dependabot in #313
- Bump types-pyyaml from 6.0.12.20240808 to 6.0.12.20240917 by @dependabot in #316
- Bump SDK dependency to 1.0.0rc901 by @llucax in #317
- Add
asyncio_default_fixture_loop_scope = "function"
option by @llucax in #318 - Add GitHub branch ruleset for Rust by @llucax in #320
- Sybil: Parse init by @Marenz in #321
- Bump the required group with 7 updates by @dependabot in #322
- Bump the required group with 2 updates by @dependabot in #325
- Bump setuptools-scm[toml] from 7.1.0 to 8.1.0 by @dependabot in #326
- Update sybil requirement from <9,>=6.1.1 to >=6.1.1,<10 by @dependabot in #327
- Port the migration script to Python by @llucax in #329
- Disable more pylint checks that are also checked by mypy by @llucax in #330
- Bump dependencies in the template by @llucax in #331
- Remove the redundant
--platform
from theDockerfile
by @llucax in #332 - Prepare for the v0.11.0 release by @llucax in #333
New Contributors
- @daniel-zullo-frequenz made their first contribution in #291
Full Changelog: v0.10.0...v0.11.0-rc1
v0.10.0
Frequenz Repository Configuration Release Notes
Summary
This release includes quite a few enhancements and bug fixes for the cookiecutter template, but most importantly a new script for migrating to new templates, generating the templates is no longer needed for upgrading.
Upgrading
Cookiecutter template
-
A new script for migrating to new templates (instead of regenerating all files) is provided. It can't handle the upgrade 100% automatically, but should make the migration process much easier and less error prone.
To run it, the simplest way is to fetch it from GitHub and run it directly:
curl -sSL https://raw.githubusercontent.com/frequenz-floss/frequenz-repo-config-python/v0.10.0/cookiecutter/migrate.sh | sh
Make sure the version you want to migrate to is correct in the URL.
For jumping multiple versions you should run the script multiple times, once for each version.
And remember to follow any manual instructions for each run.
New Features
- A new GitHub ruleset is provided to configure the merge queue, so branch protection rules are not needed anymore.
Enhancements
- The generated docs now show the symbol type in the table of contents.
Cookiecutter template
- The
Markdown
dependency was bumped so we don't need to add atype: ignore
due to incorrect type hints. - The generated docs now show the symbol type in the table of contents.
- The dependecies were updated to the latest versions.
- Disabled some
pylint
checks that are already checked by other tools. - The generated documentation now uses symlinks for aliases, which allows deep linking when using aliases too.
Bug Fixes
- The code example extractor relied on a bug in the upstream sybil project that was recently fixed, thus our code also needed to be fixed.
Cookiecutter template
- Fixed a bug where the pip cache post action fails in the CI workflow because of permissions issues.
- Make the
nox-cross-arch-all
job fail if anynox-cross-arch
matrix job fails. - Fix credentials not being passed to the
test-installation
job in the CI workflow. - Make sure credentials are configured for all jobs that check out the repository in the CI workflow.
- Disable the new
check-class-attributes
check in pydoclint 0.5.3, as we use a different way to document class attributes. - Fix permissions issues with the
release-notes-check
workflow when the repository Actions configuration is set up without full access.
What's Changed
- Clear release notes by @llucax in #233
- Add a migration script by @llucax in #240
- Fix Markdown type:ignore by @llucax in #241
- mkdocs: Show symbol type in the ToC by @llucax in #244
- Configure the merge queue via a ruleset by @llucax in #242
- Bump dependencies by @llucax in #245
- Bump the required group across 1 directory with 6 updates by @dependabot in #248
- Make dependabot check for updates monthly on Wednesday by @llucax in #250
- Bump actions/setup-python from 4 to 5 by @dependabot in #254
- Bump actions/cache from 3 to 4 by @dependabot in #252
- Don't recursively scan for pyproject.toml when calculating the cache key by @llucax in #260
- Bump the required group across 1 directory with 3 updates by @dependabot in #259
- Fix CI failing with setuptools dependency missing by @Marenz in #258
- Pin sybil to < 6.1 by @llucax in #262
- Downgrade sybil to 6.0.3 by @llucax in #264
- Fail the nox-cross-arch-all job if any matrix job fails by @llucax in #261
- Bump actions/{up,down}load-artifact from 3 to 4 by @dependabot in #251
- Fix the Queue PRs for v0.x.x.json ruleset by @llucax in #263
- Fix the condition to run the
nox-cross-arch-all
job by @llucax in #265 - Fix the migration script by @llucax in #268
- Fix code example extractor relying on bug in sybil by @Marenz in #256
- Update types-setuptools requirement from <70,>=67.6.0 to >=67.6.0,<71 by @dependabot in #273
- Update setuptools requirement from <70,>=67.6.0 to >=67.6.0,<71 by @dependabot in #272
- Bump the required group with 7 updates by @dependabot in #271
- Disable some pylint checks that are checked by other tools by @llucax in #280
- mkdocs: Use symlink alias types by @llucax in #281
- Bump docker/build-push-action from 5 to 6 by @dependabot in #284
- Bump brettcannon/check-for-changed-files from 1.2.0 to 1.2.1 by @dependabot in #285
- Bump the required group with 8 updates by @dependabot in #283
- Fix credentials not passed or configured the CI workflow by @llucax in #286
- Disable the new
check-class-attributes
check in pydoclint 0.5.3 by @llucax in #288 - Prepare for the v0.10.0 release by @llucax in #290
- Add pull-requests read permission to the release-notes-check workflow by @llucax in #289
New Contributors
- @dependabot made their first contribution in #248
Full Changelog: v0.9.1...v0.10.0
v0.9.2
Frequenz Repository Configuration Release Notes
Bug Fixes
-
Pin
sybil
to < 6.1Sybil 6.1.0 fixes a bug which we thought it was proper behavior, so
upgrading to it would break our tests.
Full Changelog: v0.9.1...v0.9.2
v0.9.1
Frequenz Repository Configuration Release Notes
Bug Fixes
- Fix that new repositories were initialized with the previous version 0.8.0.
What's Changed
- Clear release notes by @llucax in #228
- Initialize repos to version 0.9.1 by @Marenz in #231
- Clean up release notes for 0.9.1 by @llucax in #232
Full Changelog: v0.9.0...v0.9.1
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
v0.8.0
Frequenz Repository Configuration Release Notes
Summary
This is a minor release with some documentation improvements, new GitHub ruleset and a few bug fixes.
Upgrading
Cookiecutter template
You can follow these steps to upgrade without regenerating the whole project, if you kept the default project structure and configuration:
-
Update the
frequenz-repo-config
dependencies inpyproject.toml
to 0.8.0. -
Run in the root directory of your project:
sed -i '/custom_templates: templates/d' mkdocs.yml sed -i '/ "too-few-public-methods",/a \ "too-many-return-statements",' pyproject.toml find -type f -exec sed -i 's/Freqenz/Frequenz/g' {} + cat <<EOF >> .gitignore # Auto-generated python files from the protocol buffer compiler py/**/*_pb2.py py/**/*_pb2.pyi py/**/*_pb2_grpc.py py/**/*_pb2_grpc.pyi EOF
-
Optionally go to the GitHub project's settings and replace branch protection rules with the new rulesets. See the new GitHub configuration guide for more details.
New Features
- New GitHub rulesets are provided with the recommended configuration to protect branches and tags.
- The documentation is restructured into a more organized, easier-to-navigate user guide.
- Documentation on how to configure the GitHub project and PyPI package is now provided.
Cookiecutter template
- The
pylint
checktoo-many-return-statements
is now disabled by default. - Generated protobuf files are now ignored by Git.
Bug Fixes
Cookiecutter template
- Fix typo:
Freqenz
->Frequenz
- Fix
mkdocs.yml
to avoid specifyingcustom_templates
formkdocstrings
as it is unused and is checked for existence in newer versions. - Fix paths that are not translated properly from the python package name (#198)
- Fix outdated
frequenz-repo-config
dependency
What's Changed
- Clear release notes by @llucax in #175
- Fix typos Freqenz -> Frequenz by @llucax in #183
- Add repository rulesets and a docs section to configure the GitHub repository by @llucax in #192
- Restructure the home page into a user guide by @llucax in #193
- Fix outdated configuration section name by @llucax in #195
- Remove
custom_templates
frommkdocs.yml
by @llucax in #201 - Disable the pylint check
too-many-return-statements
by @llucax in #200 - docs: Improve mention of
cmd:skip-release-notes
label by @llucax in #197 - Properly translate paths from the python package name by @llucax in #199
- Ignore files generated from
proto
files by @llucax in #202 - docs: Improve
gh-pages
initialization by @llucax in #203 - Prepare for v0.8.0 release by @llucax in #204
- Add section on configuring PyPI to the user guide by @llucax in #205
Full Changelog: v0.7.5...v0.8.0
v0.7.5
Frequenz Repository Configuration Release Notes
Summary
This release upgrades mike
to 2.0.0.
Upgrading
Cookiecutter template
There is no need to re-generate the cookiecutter template for this release. Instead you can upgrade the mike
package in your pyproject.toml
file and add the new alias_type: redirect
option to the plugins.mike
key in the mkdocs.yml
file.
You should be able to do this by running the following commands:
sed -i '/canonical_version: latest/ i\ alias_type: redirect' mkdocs.yml
sed -i 's/ "mike == .*",/ "mike == 2.0.0",/' pyproject.toml
Please make sure to check the diff and test if everything works as expected. After doing a git diff
you should get something like:
diff --git a/mkdocs.yml b/mkdocs.yml
index 3d0f82e..6adfbe8 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -93,6 +93,7 @@ plugins:
- literate-nav:
nav_file: SUMMARY.md
- mike:
+ alias_type: redirect
canonical_version: latest
- mkdocstrings:
custom_templates: templates
diff --git a/pyproject.toml b/pyproject.toml
index 9a1604b..b183524 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -47,7 +47,7 @@ dev-formatting = ["black == 23.10.1", "isort == 5.12.0"]
dev-mkdocs = [
"black == 23.10.1",
"Markdown==3.5.1",
- "mike == 1.1.2",
+ "mike == 2.0.0",
"mkdocs-gen-files == 0.5.0",
"mkdocs-literate-nav == 0.6.1",
"mkdocs-material == 9.4.7",
If that's not the case, your pyproject.toml
and/or mkdocs.yml
files might have been diverged from the generated files and updated in a way that is not compatible with the upgrade. In that case you'll have to fix it manually or re-generate the templates.
Bug Fixes
cli.version.mike.info
: Don't fail if the version can't be determined, just emit a warning and exit succesfully.
Cookiecutter template
- CI: The documentation publishing job will not fail if the version for
mike
can't be determined, it will just emit a warning and skip the publishing of the documentation website.
What's Changed
Full Changelog: v0.7.4...v0.7.5
v0.7.4
Frequenz Repository Configuration Release Notes
Summary
This release fixes a bug in mike
version sorting.
Upgrading
frequenz.repo.config.mkdocs.mike.
: Thesort_versions()
function now takes plainstr
s as arguments instead ofMikeVersionInfo
objects.
Cookiecutter template
There is no need to regenerate any templates with this release.
Bug Fixes
- CI /
mkdocs
:mike
version sorting now properly sort pre-releases as older than stable releases for the same major and minor version.
What's Changed
Full Changelog: v0.7.3...v0.7.4
v0.7.3
Frequenz Repository Configuration Release Notes
Summary
This release adds support for pylint
3, so downstream projects can upgrade their pylint
version.
Upgrading
If upgrading pylint
you might get a few new check errors.
Cookiecutter template
There is no need to regenerate any templates with this release.
Bug Fixes
mkdocs
: Theconftest
module is now properly hidden from the documentation again.
What's Changed
Full Changelog: v0.7.2...v0.7.3