Releases: frequenz-floss/frequenz-repo-config-python
v0.12.3
Frequenz Repository Configuration Release Notes
Enhancements
- Add tips for Mac users in the upgrading section of the documentation.
- Add a final note letting the user know the script run finished in the migration script.
Bug Fixes
Cookiecutter template
- Fixed an outdated link to instructions on how to continue when the cookiecutter template generation finishes.
What's Changed
- Clear release notes by @llucax in #356
- Update link in cookiecutter end instructions by @llucax in #360
- Add notes to the upgrading section and a comment that the script finished by @TalweSingh in #358
New Contributors
- @TalweSingh made their first contribution in #358
Full Changelog: v0.12.2...v0.12.3
v0.12.2
Frequenz Repository Configuration Release Notes
Bug Fixes
- Update dependencies for templates and docs to the latest patch version.
What's Changed
Full Changelog: v0.12.1...v0.12.2
v0.12.1
Frequenz Repository Configuration Release Notes
Upgrading
Even if this is a patch release, it will require a dependency bump for mkdocstrings-python
to v1.14.6 or newer, but since these are only dev dependencies and things will break if you update the dependencies anyway, it seems like a reasonable trade-off.
Bug Fixes
- The new mkdocstrings-macros pluglet didn't work with the latest
mkdocstrings-python
version.
What's Changed
Full Changelog: v0.12.0...v0.12.1
v0.12.0
Frequenz Repository Configuration Release Notes
Summary
This release introduces a new MkDocs macros pluglet system that simplifies documentation setup and provides enhanced functionality for version information and code annotations. It also includes changes to how pytest warnings are handled in templates.
Upgrading
-
The
nox
defaultpytest
session doesn't pass-W=all -vv
topytest
anymore. You can use thepyproject.toml
file to configure default options forpytest
, for example:[tool.pytest.ini_options] addopts = "-W=all -Werror -Wdefault::DeprecationWarning -Wdefault::PendingDeprecationWarning -vv"
Cookiecutter template
All upgrading should be done via the migration script or regenerating the templates.
curl -sSL https://raw.githubusercontent.com/frequenz-floss/frequenz-repo-config-python/v0.12.0/cookiecutter/migrate.py | python3
But you might still need to adapt your code:
-
pytest
now uses-Werror
by default (but still treat deprecations as normal warnings), so if your tests run with warnings, they will now be turned to errors, and you'll need to fix them. -
Projects using
docs/_scripts/macros.py
with customized scripts can use the new provided utility functions. See themkdocstrings_macros
documentation for the new features and setup.
New Features
- Two new modules were introduced to facilitate the configuration of
macros
for use within docstrings viamkdocstrings
:mkdocstrings_macros
andannotations
.
Cookiecutter template
pytest
now uses-Werror -Wdefault::DeprecationWarning -Wdefault::PendingDeprecationWarning
by default. Deprecations are still treated as warnings, as when testing with thepytest_min
session is normal to get deprecation warnings as we are using old versions of dependencies.
Bug Fixes
Cookiecutter template
- Fixed a compatibility issue in the macros doc script with
mkdocsstrings
0.28.
What's Changed
- Clear release notes by @llucax in #334
- Make
pytest
treat warnings as errors by @llucax in #335 - Bump the required group with 2 updates by @dependabot in #336
- Bump types-markdown from 3.7.0.20240822 to 3.7.0.20241204 by @dependabot in #339
- Bump the required group with 7 updates by @dependabot in #337
- Bump types-pyyaml from 6.0.12.20240917 to 6.0.12.20241230 by @dependabot in #338
- Fix
mypy
error with setuptools 7.6.8 type hints by @llucax in #347 - Bump the required group across 1 directory with 5 updates by @dependabot in #348
- Bump isort from 5.13.2 to 6.0.0 by @dependabot in #346
- Bump black from 24.10.0 to 25.1.0 by @dependabot in #345
- Move mkdocstrings-macros integration to a library by @llucax in #349
- Fix wrong argument in migration script by @llucax in #350
Full Changelog: v0.11.0...v0.12.0
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