From 5e532f62305abdb2b6f396da08e9c90d87930a3a Mon Sep 17 00:00:00 2001 From: Daniel Zullo Date: Wed, 10 Jul 2024 13:15:49 +0200 Subject: [PATCH 01/50] Fix TODO typos for workflows/release-notes-checks Signed-off-by: Daniel Zullo --- .../.github/workflows/release-notes-check.yml | 2 +- .../test_cookiecutter_generation/actor/cookiecutter-stdout.txt | 2 +- .../.github/workflows/release-notes-check.yml | 2 +- .../test_cookiecutter_generation/api/cookiecutter-stdout.txt | 2 +- .../frequenz-api-test/.github/workflows/release-notes-check.yml | 2 +- .../test_cookiecutter_generation/app/cookiecutter-stdout.txt | 2 +- .../frequenz-app-test/.github/workflows/release-notes-check.yml | 2 +- .../test_cookiecutter_generation/lib/cookiecutter-stdout.txt | 2 +- .../.github/workflows/release-notes-check.yml | 2 +- .../test_cookiecutter_generation/model/cookiecutter-stdout.txt | 2 +- .../.github/workflows/release-notes-check.yml | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/.github/workflows/release-notes-check.yml b/cookiecutter/{{cookiecutter.github_repo_name}}/.github/workflows/release-notes-check.yml index 4331da9a..3481d619 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/.github/workflows/release-notes-check.yml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/.github/workflows/release-notes-check.yml @@ -22,7 +22,7 @@ jobs: if: github.event_name == 'pull_request' uses: brettcannon/check-for-changed-files@871d7b8b5917a4f6f06662e2262e8ffc51dff6d1 # v1.2.1 with: - # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it and remove it + # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it # token: {{'${{ secrets.github_token }}'}} file-pattern: "RELEASE_NOTES.md" {%- if cookiecutter.type == "api" %} diff --git a/tests_golden/integration/test_cookiecutter_generation/actor/cookiecutter-stdout.txt b/tests_golden/integration/test_cookiecutter_generation/actor/cookiecutter-stdout.txt index 905ba377..b2d6c502 100644 --- a/tests_golden/integration/test_cookiecutter_generation/actor/cookiecutter-stdout.txt +++ b/tests_golden/integration/test_cookiecutter_generation/actor/cookiecutter-stdout.txt @@ -8,7 +8,7 @@ ./.github/workflows/ci.yaml: # TODO(cookiecutter): Uncomment this for projects with private dependencies ./.github/workflows/ci.yaml: # TODO(cookiecutter): Uncomment this for projects with private dependencies ./.github/workflows/ci.yaml: # TODO(cookiecutter): Uncomment this for projects with private dependencies -./.github/workflows/release-notes-check.yml: # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it and remove it +./.github/workflows/release-notes-check.yml: # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it ./CODEOWNERS:# TODO(cookiecutter): Add more specific code-owners, check if the default is correct ./CODEOWNERS:* TODO(cookiecutter): Add codeowners (like @{github_org}/some-team)# Temporary, should probably change ./README.md:TODO(cookiecutter): Improve the README file diff --git a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/workflows/release-notes-check.yml b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/workflows/release-notes-check.yml index 41212e8e..9cc830c0 100644 --- a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/workflows/release-notes-check.yml +++ b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/workflows/release-notes-check.yml @@ -22,7 +22,7 @@ jobs: if: github.event_name == 'pull_request' uses: brettcannon/check-for-changed-files@871d7b8b5917a4f6f06662e2262e8ffc51dff6d1 # v1.2.1 with: - # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it and remove it + # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it # token: ${{ secrets.github_token }} file-pattern: "RELEASE_NOTES.md" prereq-pattern: "src/**" diff --git a/tests_golden/integration/test_cookiecutter_generation/api/cookiecutter-stdout.txt b/tests_golden/integration/test_cookiecutter_generation/api/cookiecutter-stdout.txt index 66f6e724..9f3e52f1 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/cookiecutter-stdout.txt +++ b/tests_golden/integration/test_cookiecutter_generation/api/cookiecutter-stdout.txt @@ -9,7 +9,7 @@ ./.github/workflows/ci.yaml: # TODO(cookiecutter): Uncomment this for projects with private dependencies ./.github/workflows/ci.yaml: # TODO(cookiecutter): Uncomment this for projects with private dependencies ./.github/workflows/ci.yaml: # TODO(cookiecutter): Uncomment this for projects with private dependencies -./.github/workflows/release-notes-check.yml: # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it and remove it +./.github/workflows/release-notes-check.yml: # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it ./CODEOWNERS:# TODO(cookiecutter): Add more specific code-owners, check if the default is correct ./README.md:TODO(cookiecutter): Improve the README file ./docs/_scripts/macros.py: # TODO(cookiecutter): Add any other macros, variables and filters here. diff --git a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/workflows/release-notes-check.yml b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/workflows/release-notes-check.yml index 60af426b..ae6c5b95 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/workflows/release-notes-check.yml +++ b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/workflows/release-notes-check.yml @@ -22,7 +22,7 @@ jobs: if: github.event_name == 'pull_request' uses: brettcannon/check-for-changed-files@871d7b8b5917a4f6f06662e2262e8ffc51dff6d1 # v1.2.1 with: - # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it and remove it + # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it # token: ${{ secrets.github_token }} file-pattern: "RELEASE_NOTES.md" prereq-pattern: "{proto,py}/**" diff --git a/tests_golden/integration/test_cookiecutter_generation/app/cookiecutter-stdout.txt b/tests_golden/integration/test_cookiecutter_generation/app/cookiecutter-stdout.txt index 02261522..36447a86 100644 --- a/tests_golden/integration/test_cookiecutter_generation/app/cookiecutter-stdout.txt +++ b/tests_golden/integration/test_cookiecutter_generation/app/cookiecutter-stdout.txt @@ -8,7 +8,7 @@ ./.github/workflows/ci.yaml: # TODO(cookiecutter): Uncomment this for projects with private dependencies ./.github/workflows/ci.yaml: # TODO(cookiecutter): Uncomment this for projects with private dependencies ./.github/workflows/ci.yaml: # TODO(cookiecutter): Uncomment this for projects with private dependencies -./.github/workflows/release-notes-check.yml: # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it and remove it +./.github/workflows/release-notes-check.yml: # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it ./CODEOWNERS:# TODO(cookiecutter): Add more specific code-owners, check if the default is correct ./README.md:TODO(cookiecutter): Improve the README file ./docs/_scripts/macros.py: # TODO(cookiecutter): Add any other macros, variables and filters here. diff --git a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/workflows/release-notes-check.yml b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/workflows/release-notes-check.yml index 41212e8e..9cc830c0 100644 --- a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/workflows/release-notes-check.yml +++ b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/workflows/release-notes-check.yml @@ -22,7 +22,7 @@ jobs: if: github.event_name == 'pull_request' uses: brettcannon/check-for-changed-files@871d7b8b5917a4f6f06662e2262e8ffc51dff6d1 # v1.2.1 with: - # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it and remove it + # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it # token: ${{ secrets.github_token }} file-pattern: "RELEASE_NOTES.md" prereq-pattern: "src/**" diff --git a/tests_golden/integration/test_cookiecutter_generation/lib/cookiecutter-stdout.txt b/tests_golden/integration/test_cookiecutter_generation/lib/cookiecutter-stdout.txt index 36196456..db944150 100644 --- a/tests_golden/integration/test_cookiecutter_generation/lib/cookiecutter-stdout.txt +++ b/tests_golden/integration/test_cookiecutter_generation/lib/cookiecutter-stdout.txt @@ -8,7 +8,7 @@ ./.github/workflows/ci.yaml: # TODO(cookiecutter): Uncomment this for projects with private dependencies ./.github/workflows/ci.yaml: # TODO(cookiecutter): Uncomment this for projects with private dependencies ./.github/workflows/ci.yaml: # TODO(cookiecutter): Uncomment this for projects with private dependencies -./.github/workflows/release-notes-check.yml: # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it and remove it +./.github/workflows/release-notes-check.yml: # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it ./CODEOWNERS:# TODO(cookiecutter): Add more specific code-owners, check if the default is correct ./README.md:TODO(cookiecutter): Improve the README file ./docs/_scripts/macros.py: # TODO(cookiecutter): Add any other macros, variables and filters here. diff --git a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/workflows/release-notes-check.yml b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/workflows/release-notes-check.yml index 41212e8e..9cc830c0 100644 --- a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/workflows/release-notes-check.yml +++ b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/workflows/release-notes-check.yml @@ -22,7 +22,7 @@ jobs: if: github.event_name == 'pull_request' uses: brettcannon/check-for-changed-files@871d7b8b5917a4f6f06662e2262e8ffc51dff6d1 # v1.2.1 with: - # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it and remove it + # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it # token: ${{ secrets.github_token }} file-pattern: "RELEASE_NOTES.md" prereq-pattern: "src/**" diff --git a/tests_golden/integration/test_cookiecutter_generation/model/cookiecutter-stdout.txt b/tests_golden/integration/test_cookiecutter_generation/model/cookiecutter-stdout.txt index 0669ae6d..81a2d8d3 100644 --- a/tests_golden/integration/test_cookiecutter_generation/model/cookiecutter-stdout.txt +++ b/tests_golden/integration/test_cookiecutter_generation/model/cookiecutter-stdout.txt @@ -8,7 +8,7 @@ ./.github/workflows/ci.yaml: # TODO(cookiecutter): Uncomment this for projects with private dependencies ./.github/workflows/ci.yaml: # TODO(cookiecutter): Uncomment this for projects with private dependencies ./.github/workflows/ci.yaml: # TODO(cookiecutter): Uncomment this for projects with private dependencies -./.github/workflows/release-notes-check.yml: # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it and remove it +./.github/workflows/release-notes-check.yml: # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it ./CODEOWNERS:# TODO(cookiecutter): Add more specific code-owners, check if the default is correct ./README.md:TODO(cookiecutter): Improve the README file ./docs/_scripts/macros.py: # TODO(cookiecutter): Add any other macros, variables and filters here. diff --git a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/workflows/release-notes-check.yml b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/workflows/release-notes-check.yml index 41212e8e..9cc830c0 100644 --- a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/workflows/release-notes-check.yml +++ b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/workflows/release-notes-check.yml @@ -22,7 +22,7 @@ jobs: if: github.event_name == 'pull_request' uses: brettcannon/check-for-changed-files@871d7b8b5917a4f6f06662e2262e8ffc51dff6d1 # v1.2.1 with: - # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it and remove it + # TODO(cookiecutter): Uncomment the following line for private repositories, otherwise remove it # token: ${{ secrets.github_token }} file-pattern: "RELEASE_NOTES.md" prereq-pattern: "src/**" From ae9f1cfc28814e4a358280f3d74698295422429f Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 10 Jul 2024 13:26:55 +0200 Subject: [PATCH 02/50] Reset release notes and migration script for the next release Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 39 ++----- cookiecutter/migrate.sh | 249 +--------------------------------------- 2 files changed, 13 insertions(+), 275 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 87fd8333..4a01ccc2 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -2,51 +2,28 @@ ## 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: - - ```console - 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. +### Cookiecutter template - 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 a `type: 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 any `nox-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. + diff --git a/cookiecutter/migrate.sh b/cookiecutter/migrate.sh index 3cf384cc..81f1ed0c 100644 --- a/cookiecutter/migrate.sh +++ b/cookiecutter/migrate.sh @@ -7,9 +7,9 @@ # scratch. # # 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 @@ -22,248 +22,9 @@ manual_step() { echo "\033[0;33m>>> $@\033[0m" } -echo "Removing the 'Markdown' type:ignore from docs/_scripts/macros.py" -sed -i \ - -e 's|return toc.slugify_unicode(text, "-") # type: ignore\[attr-defined,no-any-return\]|return toc.slugify_unicode(text, "-")|' \ - -e '/# The type of the return value is not defined for the markdown library./d' \ - -e '/# Also for some reason `mypy` thinks the `toc` module doesn'\''t have a/d' \ - -e '/# `slugify_unicode` function, but it definitely does./d' \ - docs/_scripts/macros.py -echo -manual_step "Please make sure that the 'Markdown' and 'types-Markdown' dependencies are at version 3.5.2 or higher in 'pyproject.toml':" -grep 'Markdown' pyproject.toml - -echo "========================================================================" - -echo "Adding the new 'show_symbol_type_toc' option for MkDocs" -sed -i '/^ show_source: true$/a \ show_symbol_type_toc: true' mkdocs.yml -sed -i '/^ "mkdocstrings\[python\] == .*",$/a \ "mkdocstrings-python == 1.9.2",' pyproject.toml - -echo "========================================================================" - -manual_step "To configure merge queues via repository rulesets you need to:" -manual_step " 1. Go to your repository settings and click on 'Rules' -> 'Rulesets' in the sidebar." -manual_step " 2. Click on 'New ruleset' on the top right and select 'Import a ruleset'." -manual_step " 3. Select the file 'github-rulesets/Queue PRs for v0.x.x.json'." -manual_step " 4. Make sure the branch name is correct (matches the branch you want to configure the merge queue for) and click 'Create'." -manual_step " 5. Go to the 'Branches' section in the sidebar." -manual_step " 6. Remove any branch protection rules that are not needed anymore (you should probably have only one configuring the merge queue if you were using other rulesets before)." - -echo "========================================================================" - -echo "Fixing pip cache in '.github/workflows/ci.yaml'" -sed -i "s|hashFiles('\*\*/pyproject.toml')|hashFiles('pyproject.toml')|" .github/workflows/ci.yaml - -echo "========================================================================" - -echo "Fixing nox-(cross-arch-)all jobs to fail on child jobs failure in '.github/workflows/ci.yaml'" -sed -i \ - -e '/^ needs: \["nox-cross-arch"\]$/,/^ run: "true"$/c\ - needs: \["nox-cross-arch"\]\ - # We skip this job only if nox-cross-arch was also skipped\ - if: always() && needs.nox-cross-arch.result != '"'"'skipped'"'"'\ - runs-on: ubuntu-20.04\ - env:\ - DEPS_RESULT: ${{ needs.nox-cross-arch.result }}\ - steps:\ - - name: Check matrix job result\ - run: test "$DEPS_RESULT" = "success"' \ - -e '/^ needs: \["nox"\]$/,/^ run: "true"$/c\ - needs: ["nox"]\ - # We skip this job only if nox was also skipped\ - if: always() && needs.nox.result != '"'"'skipped'"'"'\ - runs-on: ubuntu-20.04\ - env:\ - DEPS_RESULT: ${{ needs.nox.result }}\ - steps:\ - - name: Check matrix job result\ - run: test "$DEPS_RESULT" = "success"' \ - .github/workflows/ci.yaml - -echo "========================================================================" - -echo "Disabling some pylint checks also checked by other tools" -sed -i -e '/ "unsubscriptable-object",/a \ # Checked by mypy\ - "no-member",' \ - -e '/ # Checked by flake8/a \ "f-string-without-interpolation",' \ - -e '/ "line-too-long",/a \ "missing-function-docstring",' \ - pyproject.toml - -echo "========================================================================" - -echo "Using symlink aliases in 'mkdocs.yml'" -sed -i "s|alias_type: redirect|alias_type: symlink|" mkdocs.yml - -echo "========================================================================" - -echo "Fixing credentials not being properly passed in '.github/workflows/ci.yaml'" -patch --merge -p1 <<'EOF' -diff --git a/.github/containers/test-installation/Dockerfile b/.github/containers/test-installation/Dockerfile -index 2494545..ac3de24 100644 ---- a/.github/containers/test-installation/Dockerfile -+++ b/.github/containers/test-installation/Dockerfile -@@ -14,5 +14,8 @@ RUN apt-get update -y && \ - python -m pip install --upgrade --no-cache-dir pip - - COPY dist dist --RUN pip install dist/*.whl && \ -- rm -rf dist -+# This git-credentials file is made available by the GitHub ci.yaml workflow -+COPY git-credentials /root/.git-credentials -+RUN git config --global credential.helper store && \ -+ pip install dist/*.whl && \ -+ rm -rf dist /root/.git-credentials -diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml -index 8062a61..67000f1 100644 ---- a/.github/workflows/ci.yaml -+++ b/.github/workflows/ci.yaml -@@ -41,6 +41,13 @@ jobs: - runs-on: ${{ matrix.os }} - - steps: -+ - name: Setup Git -+ uses: frequenz-floss/gh-action-setup-git@v0.x.x -+ # TODO(cookiecutter): Uncomment this for projects with private dependencies -+ # with: -+ # username: ${{ secrets.GIT_USER }} -+ # password: ${{ secrets.GIT_PASS }} -+ - - name: Print environment (debug) - run: env - -@@ -119,6 +126,13 @@ jobs: - runs-on: ${{ matrix.os }} - - steps: -+ - name: Setup Git -+ uses: frequenz-floss/gh-action-setup-git@v0.x.x -+ # TODO(cookiecutter): Uncomment this for projects with private dependencies -+ # with: -+ # username: ${{ secrets.GIT_USER }} -+ # password: ${{ secrets.GIT_PASS }} -+ - - name: Fetch sources - uses: actions/checkout@v4 - -@@ -220,6 +234,13 @@ jobs: - name: Build distribution packages - runs-on: ubuntu-20.04 - steps: -+ - name: Setup Git -+ uses: frequenz-floss/gh-action-setup-git@v0.x.x -+ # TODO(cookiecutter): Uncomment this for projects with private dependencies -+ # with: -+ # username: ${{ secrets.GIT_USER }} -+ # password: ${{ secrets.GIT_PASS }} -+ - - name: Fetch sources - uses: actions/checkout@v4 - with: -@@ -252,17 +273,31 @@ jobs: - needs: ["build"] - runs-on: ubuntu-20.04 - steps: -+ - name: Setup Git -+ uses: frequenz-floss/gh-action-setup-git@v0.x.x -+ # TODO(cookiecutter): Uncomment this for projects with private dependencies -+ # with: -+ # username: ${{ secrets.GIT_USER }} -+ # password: ${{ secrets.GIT_PASS }} -+ - - name: Fetch sources - uses: actions/checkout@v4 -+ - - name: Download package - uses: actions/download-artifact@v4 - with: - name: dist-packages - path: dist -+ -+ - name: Make Git credentials available to docker - run: | - touch ~/.git-credentials # Ensure the file exists -+ cp ~/.git-credentials git-credentials || true -+ - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 -+ - - name: Set up docker-buildx - uses: docker/setup-buildx-action@v3 -+ - - name: Test Installation - uses: docker/build-push-action@v6 - with: -@@ -277,14 +312,18 @@ jobs: - if: github.event_name != 'push' - runs-on: ubuntu-20.04 - steps: -+ - name: Setup Git -+ uses: frequenz-floss/gh-action-setup-git@v0.x.x -+ # TODO(cookiecutter): Uncomment this for projects with private dependencies -+ # with: -+ # username: ${{ secrets.GIT_USER }} -+ # password: ${{ secrets.GIT_PASS }} -+ - - name: Fetch sources - uses: actions/checkout@v4 - with: - submodules: true - -- - name: Setup Git user and e-mail -- uses: frequenz-floss/setup-git-user@v2 -- - - name: Set up Python - uses: actions/setup-python@v5 - with: -@@ -319,14 +358,18 @@ jobs: - permissions: - contents: write - steps: -+ - name: Setup Git -+ uses: frequenz-floss/gh-action-setup-git@v0.x.x -+ # TODO(cookiecutter): Uncomment this for projects with private dependencies -+ # with: -+ # username: ${{ secrets.GIT_USER }} -+ # password: ${{ secrets.GIT_PASS }} -+ - - name: Fetch sources - uses: actions/checkout@v4 - with: - submodules: true - -- - name: Setup Git user and e-mail -- uses: frequenz-floss/setup-git-user@v2 -- - - name: Set up Python - uses: actions/setup-python@v5 - with: -EOF -manual_step "Please make sure to remove or uncomment the options to the 'gh-action-setup-git' action in the '.github/workflows/ci.yaml'" -grep -n "TODO(cookiecutter)" -- .github/workflows/ci.yaml .github/containers/test-installation/Dockerfile - -echo "========================================================================" - -echo "Disabling new pydoclint's check-class-attributes check in " -sed -i "/^allow-init-docstring/a check-class-attributes = false" pyproject.toml - -echo "========================================================================" - -echo "Adding pull-requests read permission to the release-notes-check workflow" -patch --merge -p1 <<'EOF' -diff --git a/.github/workflows/release-notes-check.yml b/.github/workflows/release-notes-check.yml -index 1e35c1a..e97886b 100644 ---- a/.github/workflows/release-notes-check.yml -+++ b/.github/workflows/release-notes-check.yml -@@ -17,6 +17,8 @@ jobs: - check-release-notes: - name: Check release notes are updated - runs-on: ubuntu-latest -+ permissions: -+ pull-requests: read - steps: - - name: Check for a release notes update - if: github.event_name == 'pull_request' -EOF +echo "TODO: Describe your migration step here." +# Add your migration steps here. +manual_step "Add any manual instructions for this step here." # Add a separation line like this one after each migration step. echo "========================================================================" From 6a8457f42c70f724b64e6896772966c30ed59a03 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 24 Jul 2024 09:27:04 +0200 Subject: [PATCH 03/50] Group dependabot updates for GitHub Actions Group patch and minor updates, as well as any release for the upload/download artifact actions, that need to be upgraded always together. Signed-off-by: Leandro Lucarella --- .github/dependabot.yml | 8 +++++++ RELEASE_NOTES.md | 2 +- cookiecutter/migrate.sh | 22 +++++++++++++++++-- .../.github/dependabot.yml | 8 +++++++ .../.github/dependabot.yml | 8 +++++++ .../frequenz-api-test/.github/dependabot.yml | 8 +++++++ .../frequenz-app-test/.github/dependabot.yml | 8 +++++++ .../.github/dependabot.yml | 8 +++++++ .../.github/dependabot.yml | 8 +++++++ 9 files changed, 77 insertions(+), 3 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index d9456c45..53bdd6c3 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -39,3 +39,11 @@ updates: labels: - "part:tooling" - "type:tech-debt" + groups: + compatible: + update-types: + - "minor" + - "patch" + artifacts: + patterns: + - "actions/*-artifact" diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 4a01ccc2..b697a370 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -18,7 +18,7 @@ ### Cookiecutter template - +* Group GitHub Actions dependabot updates. ## Bug Fixes diff --git a/cookiecutter/migrate.sh b/cookiecutter/migrate.sh index 81f1ed0c..2916d8de 100644 --- a/cookiecutter/migrate.sh +++ b/cookiecutter/migrate.sh @@ -22,9 +22,27 @@ manual_step() { echo "\033[0;33m>>> $@\033[0m" } -echo "TODO: Describe your migration step here." +#echo "TODO: Describe your migration step here." # Add your migration steps here. -manual_step "Add any manual instructions for this step here." +#manual_step "Add any manual instructions for this step here." + +echo "dependabot: Group GitHub Actions updates." +cat <<'EOT' | patch -p1 +--- a/.github/dependabot.yml ++++ b/.github/dependabot.yml +@@ -39,3 +39,11 @@ updates: + labels: + - "part:tooling" + - "type:tech-debt" ++ groups: ++ compatible: ++ update-types: ++ - "minor" ++ - "patch" ++ artifacts: ++ patterns: ++ - "actions/*-artifact" +EOT # Add a separation line like this one after each migration step. echo "========================================================================" diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/.github/dependabot.yml b/cookiecutter/{{cookiecutter.github_repo_name}}/.github/dependabot.yml index 9f90cb7b..cfeaac00 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/.github/dependabot.yml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/.github/dependabot.yml @@ -39,6 +39,14 @@ updates: labels: - "part:tooling" - "type:tech-debt" + groups: + compatible: + update-types: + - "minor" + - "patch" + artifacts: + patterns: + - "actions/*-artifact" {%- if cookiecutter.type == "api" %} - package-ecosystem: "gitsubmodule" diff --git a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/dependabot.yml b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/dependabot.yml index 8978cb3c..23cd21b1 100644 --- a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/dependabot.yml +++ b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/dependabot.yml @@ -39,3 +39,11 @@ updates: labels: - "part:tooling" - "type:tech-debt" + groups: + compatible: + update-types: + - "minor" + - "patch" + artifacts: + patterns: + - "actions/*-artifact" diff --git a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/dependabot.yml b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/dependabot.yml index 24b56348..d98b4f33 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/dependabot.yml +++ b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/dependabot.yml @@ -39,6 +39,14 @@ updates: labels: - "part:tooling" - "type:tech-debt" + groups: + compatible: + update-types: + - "minor" + - "patch" + artifacts: + patterns: + - "actions/*-artifact" - package-ecosystem: "gitsubmodule" directory: "/" diff --git a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/dependabot.yml b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/dependabot.yml index 8978cb3c..23cd21b1 100644 --- a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/dependabot.yml +++ b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/dependabot.yml @@ -39,3 +39,11 @@ updates: labels: - "part:tooling" - "type:tech-debt" + groups: + compatible: + update-types: + - "minor" + - "patch" + artifacts: + patterns: + - "actions/*-artifact" diff --git a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/dependabot.yml b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/dependabot.yml index 8978cb3c..23cd21b1 100644 --- a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/dependabot.yml +++ b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/dependabot.yml @@ -39,3 +39,11 @@ updates: labels: - "part:tooling" - "type:tech-debt" + groups: + compatible: + update-types: + - "minor" + - "patch" + artifacts: + patterns: + - "actions/*-artifact" diff --git a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/dependabot.yml b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/dependabot.yml index 8978cb3c..23cd21b1 100644 --- a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/dependabot.yml +++ b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/dependabot.yml @@ -39,3 +39,11 @@ updates: labels: - "part:tooling" - "type:tech-debt" + groups: + compatible: + update-types: + - "minor" + - "patch" + artifacts: + patterns: + - "actions/*-artifact" From db863899dcab05f72f81d286d4d533211f58a178 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 09:17:13 +0000 Subject: [PATCH 04/50] Update setuptools requirement from <71,>=67.6.0 to >=67.6.0,<72 Updates the requirements on [setuptools](https://github.com/pypa/setuptools) to permit the latest version. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst) - [Commits](https://github.com/pypa/setuptools/compare/v67.6.0...v71.1.0) --- updated-dependencies: - dependency-name: setuptools dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f64e2b03..64882b0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,7 @@ actor = [] api = [ "grpcio-tools >= 1.47.0, < 2", "mypy-protobuf >= 3.0.0, < 4", - "setuptools >= 67.6.0, < 71", + "setuptools >= 67.6.0, < 72", ] app = [] lib = [] @@ -100,7 +100,7 @@ dev-pylint = [ # dev-pytest already defines a dependency to pylint because of the examples # For checking the noxfile, docs/ script, and tests "frequenz-repo-config[dev-mkdocs,dev-noxfile,dev-pytest]", - "setuptools >= 67.6.0, < 71", # Should match the build dependency + "setuptools >= 67.6.0, < 72", # Should match the build dependency ] dev-pytest = [ "pytest == 8.2.2", From a9659400597744fe9935dbe67a8414264b7d3b20 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 09:17:25 +0000 Subject: [PATCH 05/50] Update types-setuptools requirement from <71,>=67.6.0 to >=67.6.0,<72 --- updated-dependencies: - dependency-name: types-setuptools dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f64e2b03..7fe422dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,7 +87,7 @@ dev-mkdocs = [ ] dev-mypy = [ "mypy == 1.10.1", - "types-setuptools >= 67.6.0, < 71", # Should match the build dependency + "types-setuptools >= 67.6.0, < 72", # Should match the build dependency "types-Markdown == 3.6.0.20240316", "types-PyYAML == 6.0.12.20240311", "types-babel == 2.11.0.15", From 5806fe611f9bfe3b6ce5527babf54e9e4a9060c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 09:17:29 +0000 Subject: [PATCH 06/50] Bump types-pyyaml from 6.0.12.20240311 to 6.0.12.20240724 Bumps [types-pyyaml](https://github.com/python/typeshed) from 6.0.12.20240311 to 6.0.12.20240724. - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-pyyaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f64e2b03..dbe36145 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,7 +89,7 @@ dev-mypy = [ "mypy == 1.10.1", "types-setuptools >= 67.6.0, < 71", # Should match the build dependency "types-Markdown == 3.6.0.20240316", - "types-PyYAML == 6.0.12.20240311", + "types-PyYAML == 6.0.12.20240724", "types-babel == 2.11.0.15", "types-colorama == 0.4.15.20240311", # For checking the noxfile, docs/ script, and tests From 4e260cd3a3cb8e89589f3c8fef90bca1b2d2df44 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Jul 2024 11:18:11 +0000 Subject: [PATCH 07/50] Bump the required group with 5 updates Bumps the required group with 5 updates: | Package | From | To | | --- | --- | --- | | [pylint](https://github.com/pylint-dev/pylint) | `3.2.5` | `3.2.6` | | [pytest](https://github.com/pytest-dev/pytest) | `8.2.2` | `8.3.1` | | [pydoclint](https://github.com/jsh9/pydoclint) | `0.5.3` | `0.5.6` | | [mkdocs-material](https://github.com/squidfunk/mkdocs-material) | `9.5.27` | `9.5.30` | | [mypy](https://github.com/python/mypy) | `1.10.1` | `1.11.0` | Updates `pylint` from 3.2.5 to 3.2.6 - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.5...v3.2.6) Updates `pytest` from 8.2.2 to 8.3.1 - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.2.2...8.3.1) Updates `pydoclint` from 0.5.3 to 0.5.6 - [Release notes](https://github.com/jsh9/pydoclint/releases) - [Changelog](https://github.com/jsh9/pydoclint/blob/main/CHANGELOG.md) - [Commits](https://github.com/jsh9/pydoclint/compare/0.5.3...0.5.6) Updates `mkdocs-material` from 9.5.27 to 9.5.30 - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG) - [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.5.27...9.5.30) Updates `mypy` from 1.10.1 to 1.11.0 - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.10.1...v1.11) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required - dependency-name: pytest dependency-type: direct:production update-type: version-update:semver-minor dependency-group: required - dependency-name: pydoclint dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required - dependency-name: mkdocs-material dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-minor dependency-group: required ... Signed-off-by: dependabot[bot] --- pyproject.toml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 61d26bf5..ed3ac830 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,7 +70,7 @@ dev-flake8 = [ "flake8 == 7.1.0", "flake8-docstrings == 1.7.0", "flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml - "pydoclint == 0.5.3", + "pydoclint == 0.5.6", "pydocstyle == 6.3.0", ] dev-formatting = ["black == 24.4.2", "isort == 5.13.2"] @@ -81,12 +81,12 @@ dev-mkdocs = [ "mkdocs-gen-files == 0.5.0", "mkdocs-literate-nav == 0.6.1", "mkdocs-macros-plugin == 1.0.5", - "mkdocs-material == 9.5.27", + "mkdocs-material == 9.5.30", "mkdocstrings[python] == 0.25.1", "mkdocstrings-python == 1.10.5", ] dev-mypy = [ - "mypy == 1.10.1", + "mypy == 1.11.0", "types-setuptools >= 67.6.0, < 72", # Should match the build dependency "types-Markdown == 3.6.0.20240316", "types-PyYAML == 6.0.12.20240724", @@ -103,8 +103,8 @@ dev-pylint = [ "setuptools >= 67.6.0, < 72", # Should match the build dependency ] dev-pytest = [ - "pytest == 8.2.2", - "pylint == 3.2.5", # We need this to check for the examples + "pytest == 8.3.1", + "pylint == 3.2.6", # We need this to check for the examples "cookiecutter == 2.6.0", # For checking the cookiecutter scripts "jinja2 == 3.1.4", # For checking the cookiecutter scripts "sybil >= 6.1.1, < 7", # Should be consistent with the extra-lint-examples dependency From b3cb5f32fb9db69bec42ec9fd01201484d17da99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 03:18:10 +0000 Subject: [PATCH 08/50] Bump the required group with 4 updates Bumps the required group with 4 updates: [pytest](https://github.com/pytest-dev/pytest), [mkdocstrings[python]](https://github.com/mkdocstrings/mkdocstrings), [mkdocstrings-python](https://github.com/mkdocstrings/python) and [mypy](https://github.com/python/mypy). Updates `pytest` from 8.3.1 to 8.3.2 - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.3.1...8.3.2) Updates `mkdocstrings[python]` from 0.25.1 to 0.25.2 - [Release notes](https://github.com/mkdocstrings/mkdocstrings/releases) - [Changelog](https://github.com/mkdocstrings/mkdocstrings/blob/main/CHANGELOG.md) - [Commits](https://github.com/mkdocstrings/mkdocstrings/compare/0.25.1...0.25.2) Updates `mkdocstrings-python` from 1.10.5 to 1.10.7 - [Release notes](https://github.com/mkdocstrings/python/releases) - [Changelog](https://github.com/mkdocstrings/python/blob/main/CHANGELOG.md) - [Commits](https://github.com/mkdocstrings/python/compare/1.10.5...1.10.7) Updates `mypy` from 1.11.0 to 1.11.1 - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.11...v1.11.1) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required - dependency-name: mkdocstrings[python] dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required - dependency-name: mkdocstrings-python dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required ... Signed-off-by: dependabot[bot] --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ed3ac830..75a5d2a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,11 +82,11 @@ dev-mkdocs = [ "mkdocs-literate-nav == 0.6.1", "mkdocs-macros-plugin == 1.0.5", "mkdocs-material == 9.5.30", - "mkdocstrings[python] == 0.25.1", - "mkdocstrings-python == 1.10.5", + "mkdocstrings[python] == 0.25.2", + "mkdocstrings-python == 1.10.7", ] dev-mypy = [ - "mypy == 1.11.0", + "mypy == 1.11.1", "types-setuptools >= 67.6.0, < 72", # Should match the build dependency "types-Markdown == 3.6.0.20240316", "types-PyYAML == 6.0.12.20240724", @@ -103,7 +103,7 @@ dev-pylint = [ "setuptools >= 67.6.0, < 72", # Should match the build dependency ] dev-pytest = [ - "pytest == 8.3.1", + "pytest == 8.3.2", "pylint == 3.2.6", # We need this to check for the examples "cookiecutter == 2.6.0", # For checking the cookiecutter scripts "jinja2 == 3.1.4", # For checking the cookiecutter scripts From 8732a5b700341ec1d3e994d8fc0197b3aca1d17a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2024 08:34:35 +0000 Subject: [PATCH 09/50] Update setuptools requirement from <72,>=67.6.0 to >=67.6.0,<73 Updates the requirements on [setuptools](https://github.com/pypa/setuptools) to permit the latest version. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst) - [Commits](https://github.com/pypa/setuptools/compare/v67.6.0...v72.1.0) --- updated-dependencies: - dependency-name: setuptools dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 75a5d2a0..5096cd82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,7 @@ actor = [] api = [ "grpcio-tools >= 1.47.0, < 2", "mypy-protobuf >= 3.0.0, < 4", - "setuptools >= 67.6.0, < 72", + "setuptools >= 67.6.0, < 73", ] app = [] lib = [] @@ -100,7 +100,7 @@ dev-pylint = [ # dev-pytest already defines a dependency to pylint because of the examples # For checking the noxfile, docs/ script, and tests "frequenz-repo-config[dev-mkdocs,dev-noxfile,dev-pytest]", - "setuptools >= 67.6.0, < 72", # Should match the build dependency + "setuptools >= 67.6.0, < 73", # Should match the build dependency ] dev-pytest = [ "pytest == 8.3.2", From 2fc97d5d2bb08f76d7a94a6f72c8264e3d60b63d Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 11 Sep 2024 11:52:16 +0200 Subject: [PATCH 10/50] Don't include `google-common-protos` in API projects by default We generally don't use it, so there is no point in including it by default. If it is needed, it can be added manually. Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 1 + .../{{cookiecutter.github_repo_name}}/.gitmodules | 3 --- .../pyproject.toml | 1 - src/frequenz/repo/config/__init__.py | 15 ++++----------- src/frequenz/repo/config/protobuf.py | 5 +---- .../api/frequenz-api-test/.gitmodules | 3 --- .../api/frequenz-api-test/pyproject.toml | 1 - 7 files changed, 6 insertions(+), 23 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index b697a370..89814021 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -19,6 +19,7 @@ ### Cookiecutter template * Group GitHub Actions dependabot updates. +* API projects don't include the `google-common-protos` dependency by default. ## Bug Fixes diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/.gitmodules b/cookiecutter/{{cookiecutter.github_repo_name}}/.gitmodules index 1a4f870a..45ccf677 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/.gitmodules +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/.gitmodules @@ -1,7 +1,4 @@ {% if cookiecutter.type == "api" -%} -[submodule "submodules/api-common-protos"] - path = submodules/api-common-protos - url = https://github.com/googleapis/api-common-protos.git [submodule "submodules/frequenz-api-common"] path = submodules/frequenz-api-common url = https://github.com/frequenz-floss/frequenz-api-common.git diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml index 97087f6f..5af2efb9 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml @@ -44,7 +44,6 @@ dependencies = [ {%- elif cookiecutter.type == "api" %} dependencies = [ "frequenz-api-common >= 0.5.0, < 0.6.0", - "googleapis-common-protos >= 1.56.2, < 2", "grpcio >= 1.51.1, < 2", ] {%- else %} diff --git a/src/frequenz/repo/config/__init__.py b/src/frequenz/repo/config/__init__.py index 6fef01ee..fbbfeec8 100644 --- a/src/frequenz/repo/config/__init__.py +++ b/src/frequenz/repo/config/__init__.py @@ -340,8 +340,8 @@ # Glob pattern to use to find the proto files in the proto_path (default: "*.proto") proto_glob = "*.prt" # Default: "*.proto" # List of paths to pass to the protoc compiler as include paths (default: -# ["submodules/api-common-protos", "submodules/frequenz-api-common/proto"]) -include_paths = ["submodules/api-common-protos"] +# ["submodules/frequenz-api-common/proto"]) +include_paths = ["submodules/frequenz-api-common/proto"] # Path where to generate the Python files (default: "py") py_path = "generated" # Path where to generate the documentation files (default: "protobuf-reference") @@ -376,23 +376,18 @@ section plus the following: - `pytests/`: Directory containing the tests for the Python code. -- `submodules/api-common-protos`: Directory containing the Git submodule with the - `google/api-common-protos` repository. - `submodules/frequenz-api-common`: Directory containing the Git submodule with the `frequenz-floss/frequenz-api-common` repository. Normally Frequenz APIs use basic types from -[`google/api-common-protos`](https://github.com/googleapis/api-common-protos) and [`frequenz-floss/frequenz-api-common`](https://github.com/frequenz-floss/frequenz-api-common), so you need to make sure the proper submodules are added to your project: ```sh mkdir submodules -git submodule add https://github.com/googleapis/api-common-protos.git \ - submodules/api-common-protos git submodule add https://github.com/frequenz-floss/frequenz-api-common.git \ submodules/frequenz-api-common -git commit -m "Add api-common-protos and frequenz-api-common submodules" submodules +git commit -m "Add frequenz-api-common submodule" submodules ``` Then you need to add this package as a build dependency and a few extra @@ -435,13 +430,11 @@ ``` Finally you need to make sure to include the generated `*.pyi` files in the -source distribution, as well as the Google api-common-protos files, as it -is not handled automatically yet +source distribution, as it is not handled automatically yet ([#13](https://github.com/frequenz-floss/frequenz-repo-config-python/issues/13)). Make sure to include these lines in the `MANIFEST.in` file: ``` -recursive-include submodules/api-common-protos/google *.proto recursive-include submodules/frequenz-api-common/proto *.proto ``` diff --git a/src/frequenz/repo/config/protobuf.py b/src/frequenz/repo/config/protobuf.py index 9eaa20ba..83d31c63 100644 --- a/src/frequenz/repo/config/protobuf.py +++ b/src/frequenz/repo/config/protobuf.py @@ -27,10 +27,7 @@ class ProtobufConfig: proto_glob: str = "*.proto" """The glob pattern to use to find the protobuf files.""" - include_paths: Sequence[str] = ( - "submodules/api-common-protos", - "submodules/frequenz-api-common/proto", - ) + include_paths: Sequence[str] = ("submodules/frequenz-api-common/proto",) """The paths to add to the include path when compiling the protobuf files.""" py_path: str = "py" diff --git a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.gitmodules b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.gitmodules index a9766dec..b193b535 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.gitmodules +++ b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.gitmodules @@ -1,6 +1,3 @@ -[submodule "submodules/api-common-protos"] - path = submodules/api-common-protos - url = https://github.com/googleapis/api-common-protos.git [submodule "submodules/frequenz-api-common"] path = submodules/frequenz-api-common url = https://github.com/frequenz-floss/frequenz-api-common.git diff --git a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml index 1752cb1e..5a488709 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml @@ -29,7 +29,6 @@ requires-python = ">= 3.11, < 4" # TODO(cookiecutter): Remove and add more dependencies if appropriate dependencies = [ "frequenz-api-common >= 0.5.0, < 0.6.0", - "googleapis-common-protos >= 1.56.2, < 2", "grpcio >= 1.51.1, < 2", ] dynamic = ["version"] From f2312e6dd928ff8fe5d46ece8eab1332152c6b93 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 11 Sep 2024 11:55:06 +0200 Subject: [PATCH 11/50] Bump `grpcio` dependency to `1.66.1` Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 1 + cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml | 2 +- .../api/frequenz-api-test/pyproject.toml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 89814021..99271b9d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -20,6 +20,7 @@ * Group GitHub Actions dependabot updates. * API projects don't include the `google-common-protos` dependency by default. +* API projects updated the `grpcio` dependency to `1.66.1`. ## Bug Fixes diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml index 5af2efb9..d6032409 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml @@ -44,7 +44,7 @@ dependencies = [ {%- elif cookiecutter.type == "api" %} dependencies = [ "frequenz-api-common >= 0.5.0, < 0.6.0", - "grpcio >= 1.51.1, < 2", + "grpcio >= 1.66.1, < 2", ] {%- else %} dependencies = [ diff --git a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml index 5a488709..82311d57 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml @@ -29,7 +29,7 @@ requires-python = ">= 3.11, < 4" # TODO(cookiecutter): Remove and add more dependencies if appropriate dependencies = [ "frequenz-api-common >= 0.5.0, < 0.6.0", - "grpcio >= 1.51.1, < 2", + "grpcio >= 1.66.1, < 2", ] dynamic = ["version"] From 80d69c6a6d83703f0417fc9e5712e2b69bb0330e Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 11 Sep 2024 12:03:26 +0200 Subject: [PATCH 12/50] Bump the `frequenz-api-common` dependency to `0.6.0` Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 1 + .../mkdocs.yml | 2 +- .../pyproject.toml | 20 +++++++++++++++++-- .../api/frequenz-api-test/mkdocs.yml | 2 +- .../api/frequenz-api-test/pyproject.toml | 18 +++++++++++++++-- 5 files changed, 37 insertions(+), 6 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 99271b9d..4b34be7d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -21,6 +21,7 @@ * Group GitHub Actions dependabot updates. * API projects don't include the `google-common-protos` dependency by default. * API projects updated the `grpcio` dependency to `1.66.1`. +* API projects updated the `frequenz-api-common` dependency to `0.6`. ## Bug Fixes diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml b/cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml index 6120ff7d..21eb3b26 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml @@ -124,7 +124,7 @@ plugins: - https://frequenz-floss.github.io/frequenz-channels-python/v0.16/objects.inv - https://frequenz-floss.github.io/frequenz-sdk-python/v0.25/objects.inv {%- elif cookiecutter.type == "api" %} - - https://frequenz-floss.github.io/frequenz-api-common/v0.3/objects.inv + - https://frequenz-floss.github.io/frequenz-api-common/v0.6/objects.inv - https://grpc.github.io/grpc/python/objects.inv {%- endif %} - https://typing-extensions.readthedocs.io/en/stable/objects.inv diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml index d6032409..d422d7bd 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml @@ -6,6 +6,15 @@ requires = [ "setuptools == 70.1.1", "setuptools_scm[toml] == 8.1.0", "frequenz-repo-config[{{cookiecutter.type}}] == 0.10.0", +{%- if cookiecutter.type == "api" %} + # We need to pin the protobuf, grpcio and grpcio-tools dependencies to make + # sure the code is generated using the minimum supported versions, as older + # versions can't work with code that was generated with newer versions. + # https://protobuf.dev/support/cross-version-runtime-guarantee/#backwards + "protobuf == 5.28.0", + "grpcio-tools == 1.66.1", + "grpcio == 1.66.1", +{%- endif %} ] build-backend = "setuptools.build_meta" @@ -43,8 +52,15 @@ dependencies = [ ] {%- elif cookiecutter.type == "api" %} dependencies = [ - "frequenz-api-common >= 0.5.0, < 0.6.0", - "grpcio >= 1.66.1, < 2", + "frequenz-api-common >= 0.6.2, < 0.7.0", + # We can't widen beyond the current value unless we bump the minimum + # requirements too because of protobuf cross-version runtime guarantees: + # https://protobuf.dev/support/cross-version-runtime-guarantee/#major + "protobuf >= 5.28.0, < 7", # Do not widen beyond 7! + # We couldn't find any document with a spec about the cross-version runtime + # guarantee for grpcio, so unless we find one in the future, we'll assume + # major version jumps are not compatible + "grpcio >= 1.66.1, < 2", # Do not widen beyond 2! ] {%- else %} dependencies = [ diff --git a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/mkdocs.yml b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/mkdocs.yml index bf29caff..fea1965e 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/mkdocs.yml +++ b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/mkdocs.yml @@ -120,7 +120,7 @@ plugins: # TODO(cookiecutter): You might want to add other external references here # See https://mkdocstrings.github.io/python/usage/#import for details - https://docs.python.org/3/objects.inv - - https://frequenz-floss.github.io/frequenz-api-common/v0.3/objects.inv + - https://frequenz-floss.github.io/frequenz-api-common/v0.6/objects.inv - https://grpc.github.io/grpc/python/objects.inv - https://typing-extensions.readthedocs.io/en/stable/objects.inv # Note this plugin must be loaded after mkdocstrings to be able to use macros diff --git a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml index 82311d57..a0f7b83d 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml @@ -6,6 +6,13 @@ requires = [ "setuptools == 70.1.1", "setuptools_scm[toml] == 8.1.0", "frequenz-repo-config[api] == 0.10.0", + # We need to pin the protobuf, grpcio and grpcio-tools dependencies to make + # sure the code is generated using the minimum supported versions, as older + # versions can't work with code that was generated with newer versions. + # https://protobuf.dev/support/cross-version-runtime-guarantee/#backwards + "protobuf == 5.28.0", + "grpcio-tools == 1.66.1", + "grpcio == 1.66.1", ] build-backend = "setuptools.build_meta" @@ -28,8 +35,15 @@ classifiers = [ requires-python = ">= 3.11, < 4" # TODO(cookiecutter): Remove and add more dependencies if appropriate dependencies = [ - "frequenz-api-common >= 0.5.0, < 0.6.0", - "grpcio >= 1.66.1, < 2", + "frequenz-api-common >= 0.6.2, < 0.7.0", + # We can't widen beyond the current value unless we bump the minimum + # requirements too because of protobuf cross-version runtime guarantees: + # https://protobuf.dev/support/cross-version-runtime-guarantee/#major + "protobuf >= 5.28.0, < 7", # Do not widen beyond 7! + # We couldn't find any document with a spec about the cross-version runtime + # guarantee for grpcio, so unless we find one in the future, we'll assume + # major version jumps are not compatible + "grpcio >= 1.66.1, < 2", # Do not widen beyond 2! ] dynamic = ["version"] From fe51015aa21cf4cbb4e171c7992656a134fd7a96 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 11 Sep 2024 14:22:21 +0200 Subject: [PATCH 13/50] Bump mkdocstrings related dependencies This is to fix an issue while importing `griffe` symbols from a new version. Signed-off-by: Leandro Lucarella --- cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml | 4 ++-- pyproject.toml | 4 ++-- .../actor/frequenz-actor-test/pyproject.toml | 4 ++-- .../api/frequenz-api-test/pyproject.toml | 4 ++-- .../app/frequenz-app-test/pyproject.toml | 4 ++-- .../lib/frequenz-test-python/pyproject.toml | 4 ++-- .../model/frequenz-model-test/pyproject.toml | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml index d422d7bd..e1e323e7 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml @@ -91,8 +91,8 @@ dev-mkdocs = [ "mkdocs-literate-nav == 0.6.1", "mkdocs-macros-plugin == 1.0.5", "mkdocs-material == 9.5.27", - "mkdocstrings[python] == 0.25.1", - "mkdocstrings-python == 1.10.5", + "mkdocstrings[python] == 0.26.1", + "mkdocstrings-python == 1.11.1", "frequenz-repo-config[{{cookiecutter.type}}] == 0.10.0", ] dev-mypy = [ diff --git a/pyproject.toml b/pyproject.toml index 5096cd82..dae9302f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,8 +82,8 @@ dev-mkdocs = [ "mkdocs-literate-nav == 0.6.1", "mkdocs-macros-plugin == 1.0.5", "mkdocs-material == 9.5.30", - "mkdocstrings[python] == 0.25.2", - "mkdocstrings-python == 1.10.7", + "mkdocstrings[python] == 0.26.1", + "mkdocstrings-python == 1.11.1", ] dev-mypy = [ "mypy == 1.11.1", diff --git a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml index c4e517a1..9ab6808c 100644 --- a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml @@ -58,8 +58,8 @@ dev-mkdocs = [ "mkdocs-literate-nav == 0.6.1", "mkdocs-macros-plugin == 1.0.5", "mkdocs-material == 9.5.27", - "mkdocstrings[python] == 0.25.1", - "mkdocstrings-python == 1.10.5", + "mkdocstrings[python] == 0.26.1", + "mkdocstrings-python == 1.11.1", "frequenz-repo-config[actor] == 0.10.0", ] dev-mypy = [ diff --git a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml index a0f7b83d..be149273 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml @@ -69,8 +69,8 @@ dev-mkdocs = [ "mkdocs-literate-nav == 0.6.1", "mkdocs-macros-plugin == 1.0.5", "mkdocs-material == 9.5.27", - "mkdocstrings[python] == 0.25.1", - "mkdocstrings-python == 1.10.5", + "mkdocstrings[python] == 0.26.1", + "mkdocstrings-python == 1.11.1", "frequenz-repo-config[api] == 0.10.0", ] dev-mypy = [ diff --git a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml index 454088dc..a24de52d 100644 --- a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml @@ -57,8 +57,8 @@ dev-mkdocs = [ "mkdocs-literate-nav == 0.6.1", "mkdocs-macros-plugin == 1.0.5", "mkdocs-material == 9.5.27", - "mkdocstrings[python] == 0.25.1", - "mkdocstrings-python == 1.10.5", + "mkdocstrings[python] == 0.26.1", + "mkdocstrings-python == 1.11.1", "frequenz-repo-config[app] == 0.10.0", ] dev-mypy = [ diff --git a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml index 85bfa251..44e8ac01 100644 --- a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml @@ -54,8 +54,8 @@ dev-mkdocs = [ "mkdocs-literate-nav == 0.6.1", "mkdocs-macros-plugin == 1.0.5", "mkdocs-material == 9.5.27", - "mkdocstrings[python] == 0.25.1", - "mkdocstrings-python == 1.10.5", + "mkdocstrings[python] == 0.26.1", + "mkdocstrings-python == 1.11.1", "frequenz-repo-config[lib] == 0.10.0", ] dev-mypy = [ diff --git a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml index b481d163..439989d3 100644 --- a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml @@ -58,8 +58,8 @@ dev-mkdocs = [ "mkdocs-literate-nav == 0.6.1", "mkdocs-macros-plugin == 1.0.5", "mkdocs-material == 9.5.27", - "mkdocstrings[python] == 0.25.1", - "mkdocstrings-python == 1.10.5", + "mkdocstrings[python] == 0.26.1", + "mkdocstrings-python == 1.11.1", "frequenz-repo-config[model] == 0.10.0", ] dev-mypy = [ From b287900c1a46485c550879a128e4fd4eb1c3ed77 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:53:37 +0000 Subject: [PATCH 14/50] Bump the required group across 1 directory with 10 updates Bumps the required group with 10 updates in the / directory: | Package | From | To | | --- | --- | --- | | [pylint](https://github.com/pylint-dev/pylint) | `3.2.6` | `3.2.7` | | [pytest](https://github.com/pytest-dev/pytest) | `8.3.2` | `8.3.3` | | [flake8](https://github.com/pycqa/flake8) | `7.1.0` | `7.1.1` | | [pydoclint](https://github.com/jsh9/pydoclint) | `0.5.6` | `0.5.7` | | [black](https://github.com/psf/black) | `24.4.2` | `24.8.0` | | [markdown](https://github.com/Python-Markdown/markdown) | `3.6.0` | `3.7` | | [mike](https://github.com/jimporter/mike) | `2.1.2` | `2.1.3` | | [mkdocs-material](https://github.com/squidfunk/mkdocs-material) | `9.5.30` | `9.5.34` | | [mypy](https://github.com/python/mypy) | `1.11.1` | `1.11.2` | | [types-markdown](https://github.com/python/typeshed) | `3.6.0.20240316` | `3.7.0.20240822` | Updates `pylint` from 3.2.6 to 3.2.7 - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.6...v3.2.7) Updates `pytest` from 8.3.2 to 8.3.3 - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/8.3.2...8.3.3) Updates `flake8` from 7.1.0 to 7.1.1 - [Commits](https://github.com/pycqa/flake8/compare/7.1.0...7.1.1) Updates `pydoclint` from 0.5.6 to 0.5.7 - [Release notes](https://github.com/jsh9/pydoclint/releases) - [Changelog](https://github.com/jsh9/pydoclint/blob/main/CHANGELOG.md) - [Commits](https://github.com/jsh9/pydoclint/compare/0.5.6...0.5.7) Updates `black` from 24.4.2 to 24.8.0 - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/24.4.2...24.8.0) Updates `markdown` from 3.6.0 to 3.7 - [Release notes](https://github.com/Python-Markdown/markdown/releases) - [Changelog](https://github.com/Python-Markdown/markdown/blob/master/docs/changelog.md) - [Commits](https://github.com/Python-Markdown/markdown/compare/3.6...3.7) Updates `mike` from 2.1.2 to 2.1.3 - [Release notes](https://github.com/jimporter/mike/releases) - [Changelog](https://github.com/jimporter/mike/blob/master/CHANGES.md) - [Commits](https://github.com/jimporter/mike/compare/v2.1.2...v2.1.3) Updates `mkdocs-material` from 9.5.30 to 9.5.34 - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG) - [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.5.30...9.5.34) Updates `mypy` from 1.11.1 to 1.11.2 - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.11.1...v1.11.2) Updates `types-markdown` from 3.6.0.20240316 to 3.7.0.20240822 - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required - dependency-name: pytest dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required - dependency-name: flake8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required - dependency-name: pydoclint dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required - dependency-name: black dependency-type: direct:production update-type: version-update:semver-minor dependency-group: required - dependency-name: markdown dependency-type: direct:production update-type: version-update:semver-minor dependency-group: required - dependency-name: mike dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required - dependency-name: mkdocs-material dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required - dependency-name: types-markdown dependency-type: direct:production update-type: version-update:semver-minor dependency-group: required ... Signed-off-by: dependabot[bot] --- pyproject.toml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dae9302f..cd03a938 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,28 +67,28 @@ extra-lint-examples = [ "sybil >= 6.1.1, < 7", ] dev-flake8 = [ - "flake8 == 7.1.0", + "flake8 == 7.1.1", "flake8-docstrings == 1.7.0", "flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml - "pydoclint == 0.5.6", + "pydoclint == 0.5.7", "pydocstyle == 6.3.0", ] -dev-formatting = ["black == 24.4.2", "isort == 5.13.2"] +dev-formatting = ["black == 24.8.0", "isort == 5.13.2"] dev-mkdocs = [ - "black == 24.4.2", - "Markdown == 3.6.0", - "mike == 2.1.2", + "black == 24.8.0", + "Markdown == 3.7", + "mike == 2.1.3", "mkdocs-gen-files == 0.5.0", "mkdocs-literate-nav == 0.6.1", "mkdocs-macros-plugin == 1.0.5", - "mkdocs-material == 9.5.30", + "mkdocs-material == 9.5.34", "mkdocstrings[python] == 0.26.1", "mkdocstrings-python == 1.11.1", ] dev-mypy = [ - "mypy == 1.11.1", + "mypy == 1.11.2", "types-setuptools >= 67.6.0, < 72", # Should match the build dependency - "types-Markdown == 3.6.0.20240316", + "types-Markdown == 3.7.0.20240822", "types-PyYAML == 6.0.12.20240724", "types-babel == 2.11.0.15", "types-colorama == 0.4.15.20240311", @@ -103,8 +103,8 @@ dev-pylint = [ "setuptools >= 67.6.0, < 73", # Should match the build dependency ] dev-pytest = [ - "pytest == 8.3.2", - "pylint == 3.2.6", # We need this to check for the examples + "pytest == 8.3.3", + "pylint == 3.2.7", # We need this to check for the examples "cookiecutter == 2.6.0", # For checking the cookiecutter scripts "jinja2 == 3.1.4", # For checking the cookiecutter scripts "sybil >= 6.1.1, < 7", # Should be consistent with the extra-lint-examples dependency From 5197d5702620ea14e65bb1923e787dbda97c7ec2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 07:29:37 +0000 Subject: [PATCH 15/50] Bump types-pyyaml from 6.0.12.20240724 to 6.0.12.20240808 Bumps [types-pyyaml](https://github.com/python/typeshed) from 6.0.12.20240724 to 6.0.12.20240808. - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-pyyaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cd03a938..a539fe15 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,7 +89,7 @@ dev-mypy = [ "mypy == 1.11.2", "types-setuptools >= 67.6.0, < 72", # Should match the build dependency "types-Markdown == 3.7.0.20240822", - "types-PyYAML == 6.0.12.20240724", + "types-PyYAML == 6.0.12.20240808", "types-babel == 2.11.0.15", "types-colorama == 0.4.15.20240311", # For checking the noxfile, docs/ script, and tests From 47dc782f54276a6dc566bb50832585e9a7751f18 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Sep 2024 03:27:24 +0000 Subject: [PATCH 16/50] Update setuptools requirement from <73,>=67.6.0 to >=67.6.0,<75 Updates the requirements on [setuptools](https://github.com/pypa/setuptools) to permit the latest version. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst) - [Commits](https://github.com/pypa/setuptools/compare/v67.6.0...v74.0.0) --- updated-dependencies: - dependency-name: setuptools dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cd03a938..544ddc8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,7 @@ actor = [] api = [ "grpcio-tools >= 1.47.0, < 2", "mypy-protobuf >= 3.0.0, < 4", - "setuptools >= 67.6.0, < 73", + "setuptools >= 67.6.0, < 75", ] app = [] lib = [] @@ -100,7 +100,7 @@ dev-pylint = [ # dev-pytest already defines a dependency to pylint because of the examples # For checking the noxfile, docs/ script, and tests "frequenz-repo-config[dev-mkdocs,dev-noxfile,dev-pytest]", - "setuptools >= 67.6.0, < 73", # Should match the build dependency + "setuptools >= 67.6.0, < 75", # Should match the build dependency ] dev-pytest = [ "pytest == 8.3.3", From e963e40e3b5e9e768d434e13f5ce902decb6064a Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Thu, 29 Aug 2024 16:12:03 +0200 Subject: [PATCH 17/50] Fix the labeler configuration example The labeler configuration example was using a wrong key, it should be `all-globs-to-all-files` instead of `all-glob-to-all-file`. Note we use `perl` instead of `sed` in the migration script because it is more portable and we don't need to worry about the differences between the different `sed` implementations (refs #302). Signed-off-by: Leandro Lucarella --- cookiecutter/migrate.sh | 5 +++++ .../{{cookiecutter.github_repo_name}}/.github/labeler.yml | 2 +- .../actor/frequenz-actor-test/.github/labeler.yml | 2 +- .../api/frequenz-api-test/.github/labeler.yml | 2 +- .../app/frequenz-app-test/.github/labeler.yml | 2 +- .../lib/frequenz-test-python/.github/labeler.yml | 2 +- .../model/frequenz-model-test/.github/labeler.yml | 2 +- 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cookiecutter/migrate.sh b/cookiecutter/migrate.sh index 2916d8de..1896b218 100644 --- a/cookiecutter/migrate.sh +++ b/cookiecutter/migrate.sh @@ -44,5 +44,10 @@ cat <<'EOT' | patch -p1 + - "actions/*-artifact" EOT +echo "========================================================================" + +echo "Fix the labeler configuration example." +perl -i -pe 's/all-glob-to-all-file/all-globs-to-all-files/g' .github/labeler.yml + # Add a separation line like this one after each migration step. echo "========================================================================" diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/.github/labeler.yml b/cookiecutter/{{cookiecutter.github_repo_name}}/.github/labeler.yml index 525665e3..fc6510e7 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/.github/labeler.yml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/.github/labeler.yml @@ -26,7 +26,7 @@ # - changed-files: # - any-glob-to-any-file: # - "src/**/*.py" -# - all-glob-to-all-file: +# - all-globs-to-all-files: # - "!src/__init__.py" # # Please have in mind that that the part:xxx labels need to diff --git a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/labeler.yml b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/labeler.yml index 289715e0..b8fea2f2 100644 --- a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/labeler.yml +++ b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/labeler.yml @@ -26,7 +26,7 @@ # - changed-files: # - any-glob-to-any-file: # - "src/**/*.py" -# - all-glob-to-all-file: +# - all-globs-to-all-files: # - "!src/__init__.py" # # Please have in mind that that the part:xxx labels need to diff --git a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/labeler.yml b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/labeler.yml index d3fc066d..5e3bde5f 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/labeler.yml +++ b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/labeler.yml @@ -26,7 +26,7 @@ # - changed-files: # - any-glob-to-any-file: # - "src/**/*.py" -# - all-glob-to-all-file: +# - all-globs-to-all-files: # - "!src/__init__.py" # # Please have in mind that that the part:xxx labels need to diff --git a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/labeler.yml b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/labeler.yml index d8efb7a2..099fc309 100644 --- a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/labeler.yml +++ b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/labeler.yml @@ -26,7 +26,7 @@ # - changed-files: # - any-glob-to-any-file: # - "src/**/*.py" -# - all-glob-to-all-file: +# - all-globs-to-all-files: # - "!src/__init__.py" # # Please have in mind that that the part:xxx labels need to diff --git a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/labeler.yml b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/labeler.yml index 05748ddb..1812ab8e 100644 --- a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/labeler.yml +++ b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/labeler.yml @@ -26,7 +26,7 @@ # - changed-files: # - any-glob-to-any-file: # - "src/**/*.py" -# - all-glob-to-all-file: +# - all-globs-to-all-files: # - "!src/__init__.py" # # Please have in mind that that the part:xxx labels need to diff --git a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/labeler.yml b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/labeler.yml index b2041fa3..57166837 100644 --- a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/labeler.yml +++ b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/labeler.yml @@ -26,7 +26,7 @@ # - changed-files: # - any-glob-to-any-file: # - "src/**/*.py" -# - all-glob-to-all-file: +# - all-globs-to-all-files: # - "!src/__init__.py" # # Please have in mind that that the part:xxx labels need to From b701c159e6f3b94ce32e5c8d000d3740467e9e76 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Sep 2024 03:27:31 +0000 Subject: [PATCH 18/50] Update types-setuptools requirement from <72,>=67.6.0 to >=67.6.0,<75 --- updated-dependencies: - dependency-name: types-setuptools dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fae26a4e..694e17e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,7 +87,7 @@ dev-mkdocs = [ ] dev-mypy = [ "mypy == 1.11.2", - "types-setuptools >= 67.6.0, < 72", # Should match the build dependency + "types-setuptools >= 67.6.0, < 75", # Should match the build dependency "types-Markdown == 3.7.0.20240822", "types-PyYAML == 6.0.12.20240808", "types-babel == 2.11.0.15", From a60a2bc71c6697c132ec44c0ed57e83d26890244 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 03:33:25 +0000 Subject: [PATCH 19/50] Update types-setuptools requirement from <75,>=67.6.0 to >=67.6.0,<76 --- updated-dependencies: - dependency-name: types-setuptools dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 694e17e7..d2c3b309 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,7 +87,7 @@ dev-mkdocs = [ ] dev-mypy = [ "mypy == 1.11.2", - "types-setuptools >= 67.6.0, < 75", # Should match the build dependency + "types-setuptools >= 67.6.0, < 76", # Should match the build dependency "types-Markdown == 3.7.0.20240822", "types-PyYAML == 6.0.12.20240808", "types-babel == 2.11.0.15", From 53839b5de1c90f84d6587d7b609872e441310cac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 03:33:34 +0000 Subject: [PATCH 20/50] Update setuptools requirement from <75,>=67.6.0 to >=67.6.0,<76 Updates the requirements on [setuptools](https://github.com/pypa/setuptools) to permit the latest version. - [Release notes](https://github.com/pypa/setuptools/releases) - [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst) - [Commits](https://github.com/pypa/setuptools/compare/v67.6.0...v75.1.0) --- updated-dependencies: - dependency-name: setuptools dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 694e17e7..ae473a38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,7 @@ actor = [] api = [ "grpcio-tools >= 1.47.0, < 2", "mypy-protobuf >= 3.0.0, < 4", - "setuptools >= 67.6.0, < 75", + "setuptools >= 67.6.0, < 76", ] app = [] lib = [] @@ -100,7 +100,7 @@ dev-pylint = [ # dev-pytest already defines a dependency to pylint because of the examples # For checking the noxfile, docs/ script, and tests "frequenz-repo-config[dev-mkdocs,dev-noxfile,dev-pytest]", - "setuptools >= 67.6.0, < 75", # Should match the build dependency + "setuptools >= 67.6.0, < 76", # Should match the build dependency ] dev-pytest = [ "pytest == 8.3.3", From 728bc558100bd172d533f2445c4335e3c199dfc0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 03:33:43 +0000 Subject: [PATCH 21/50] Bump types-pyyaml from 6.0.12.20240808 to 6.0.12.20240917 Bumps [types-pyyaml](https://github.com/python/typeshed) from 6.0.12.20240808 to 6.0.12.20240917. - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-pyyaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 694e17e7..71209be2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,7 +89,7 @@ dev-mypy = [ "mypy == 1.11.2", "types-setuptools >= 67.6.0, < 75", # Should match the build dependency "types-Markdown == 3.7.0.20240822", - "types-PyYAML == 6.0.12.20240808", + "types-PyYAML == 6.0.12.20240917", "types-babel == 2.11.0.15", "types-colorama == 0.4.15.20240311", # For checking the noxfile, docs/ script, and tests From c6757b99fd40c47c9f14b57a2eec4f7dcd899bae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 14:16:07 +0000 Subject: [PATCH 22/50] Bump the required group with 4 updates Bumps the required group with 4 updates: [pylint](https://github.com/pylint-dev/pylint), [pydoclint](https://github.com/jsh9/pydoclint), [mkdocs-macros-plugin](https://github.com/fralau/mkdocs_macros_plugin) and [mkdocs-material](https://github.com/squidfunk/mkdocs-material). Updates `pylint` from 3.2.7 to 3.3.1 - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](https://github.com/pylint-dev/pylint/compare/v3.2.7...v3.3.1) Updates `pydoclint` from 0.5.7 to 0.5.9 - [Release notes](https://github.com/jsh9/pydoclint/releases) - [Changelog](https://github.com/jsh9/pydoclint/blob/main/CHANGELOG.md) - [Commits](https://github.com/jsh9/pydoclint/compare/0.5.7...0.5.9) Updates `mkdocs-macros-plugin` from 1.0.5 to 1.2.0 - [Release notes](https://github.com/fralau/mkdocs_macros_plugin/releases) - [Changelog](https://github.com/fralau/mkdocs-macros-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/fralau/mkdocs_macros_plugin/compare/v1.0.5...v1.2.0) Updates `mkdocs-material` from 9.5.34 to 9.5.39 - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG) - [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.5.34...9.5.39) --- updated-dependencies: - dependency-name: pylint dependency-type: direct:production update-type: version-update:semver-minor dependency-group: required - dependency-name: pydoclint dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required - dependency-name: mkdocs-macros-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: required - dependency-name: mkdocs-material dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required ... Signed-off-by: dependabot[bot] --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ae473a38..a8d2a29c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,7 +70,7 @@ dev-flake8 = [ "flake8 == 7.1.1", "flake8-docstrings == 1.7.0", "flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml - "pydoclint == 0.5.7", + "pydoclint == 0.5.9", "pydocstyle == 6.3.0", ] dev-formatting = ["black == 24.8.0", "isort == 5.13.2"] @@ -80,8 +80,8 @@ dev-mkdocs = [ "mike == 2.1.3", "mkdocs-gen-files == 0.5.0", "mkdocs-literate-nav == 0.6.1", - "mkdocs-macros-plugin == 1.0.5", - "mkdocs-material == 9.5.34", + "mkdocs-macros-plugin == 1.2.0", + "mkdocs-material == 9.5.39", "mkdocstrings[python] == 0.26.1", "mkdocstrings-python == 1.11.1", ] @@ -104,7 +104,7 @@ dev-pylint = [ ] dev-pytest = [ "pytest == 8.3.3", - "pylint == 3.2.7", # We need this to check for the examples + "pylint == 3.3.1", # We need this to check for the examples "cookiecutter == 2.6.0", # For checking the cookiecutter scripts "jinja2 == 3.1.4", # For checking the cookiecutter scripts "sybil >= 6.1.1, < 7", # Should be consistent with the extra-lint-examples dependency From fd89fb5d6161398812fc189d8a010262217026c3 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Thu, 3 Oct 2024 11:35:52 +0200 Subject: [PATCH 23/50] Use keyword-only arguments in `abort` function This function takes too many arguments and it is not clear which is which at the call site otherwise. Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 2 +- src/frequenz/repo/config/github.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 4b34be7d..becf28c6 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -6,7 +6,7 @@ ## Upgrading - +- The `frequenz.repo.config.github.abort()` function now takes most arguments as keyword-only arguments. ### Cookiecutter template diff --git a/src/frequenz/repo/config/github.py b/src/frequenz/repo/config/github.py index bf1dd6dc..1e7754cb 100644 --- a/src/frequenz/repo/config/github.py +++ b/src/frequenz/repo/config/github.py @@ -56,6 +56,7 @@ def format(self, record: logging.LogRecord) -> str: def abort( # pylint: disable=too-many-arguments message: str, + *, title: str | None = None, file: str | None = None, col: int | None = None, From 2218b2e384eff9187b3cde4ad5dc921c3bd567e7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Oct 2024 09:50:47 +0000 Subject: [PATCH 24/50] Update sybil requirement from <7,>=6.1.1 to >=6.1.1,<9 Updates the requirements on [sybil](https://github.com/simplistix/sybil) to permit the latest version. - [Changelog](https://github.com/simplistix/sybil/blob/master/CHANGELOG.rst) - [Commits](https://github.com/simplistix/sybil/compare/6.1.1...8.0.0) --- updated-dependencies: - dependency-name: sybil dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a8d2a29c..ff057402 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,7 +64,7 @@ model = [] extra-lint-examples = [ "pylint >= 2.17.3, < 4", "pytest >= 7.3.0, < 9", - "sybil >= 6.1.1, < 7", + "sybil >= 6.1.1, < 9", ] dev-flake8 = [ "flake8 == 7.1.1", @@ -107,7 +107,7 @@ dev-pytest = [ "pylint == 3.3.1", # We need this to check for the examples "cookiecutter == 2.6.0", # For checking the cookiecutter scripts "jinja2 == 3.1.4", # For checking the cookiecutter scripts - "sybil >= 6.1.1, < 7", # Should be consistent with the extra-lint-examples dependency + "sybil >= 6.1.1, < 9", # Should be consistent with the extra-lint-examples dependency ] dev = [ "frequenz-repo-config[dev-mkdocs,dev-flake8,dev-formatting,dev-mkdocs,dev-mypy,dev-noxfile,dev-pylint,dev-pytest]", From c94107e2cd558f31991b3b0cf5bfb2e934a5ecb0 Mon Sep 17 00:00:00 2001 From: cwasicki <126617870+cwasicki@users.noreply.github.com> Date: Fri, 27 Sep 2024 11:07:34 +0200 Subject: [PATCH 25/50] Change edit_uri default branch to v0.x.x in mkdocs.yml Signed-off-by: cwasicki <126617870+cwasicki@users.noreply.github.com> Co-authored-by: Leandro Lucarella --- RELEASE_NOTES.md | 1 + cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml | 4 ++-- .../actor/cookiecutter-stdout.txt | 2 +- .../actor/frequenz-actor-test/mkdocs.yml | 4 ++-- .../test_cookiecutter_generation/api/cookiecutter-stdout.txt | 2 +- .../api/frequenz-api-test/mkdocs.yml | 4 ++-- .../test_cookiecutter_generation/app/cookiecutter-stdout.txt | 2 +- .../app/frequenz-app-test/mkdocs.yml | 4 ++-- .../test_cookiecutter_generation/lib/cookiecutter-stdout.txt | 2 +- .../lib/frequenz-test-python/mkdocs.yml | 4 ++-- .../model/cookiecutter-stdout.txt | 2 +- .../model/frequenz-model-test/mkdocs.yml | 4 ++-- 12 files changed, 18 insertions(+), 17 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index becf28c6..bb433336 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -22,6 +22,7 @@ * API projects don't include the `google-common-protos` dependency by default. * API projects updated the `grpcio` dependency to `1.66.1`. * API projects updated the `frequenz-api-common` dependency to `0.6`. +* Change `edit_uri` default branch to v0.x.x in mkdocs.yml. ## Bug Fixes diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml b/cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml index 21eb3b26..176b1f49 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml @@ -8,9 +8,9 @@ site_author: "{{cookiecutter.author_name}}" copyright: "Copyright © {{copyright_year}} {{cookiecutter.author_name}}" repo_name: "{{cookiecutter.github_repo_name}}" repo_url: "https://github.com/{{cookiecutter.github_org}}/{{cookiecutter.github_repo_name}}" -# TODO(cookiecutter): "main" is the GitHub repo default branch, you might want to update it +# TODO(cookiecutter): "v0.x.x" is the GitHub repo default branch, you might want to update it # if the project uses a different default branch. -edit_uri: "edit/main/docs/" +edit_uri: "edit/v0.x.x/docs/" strict: true # Treat warnings as errors # Build directories diff --git a/tests_golden/integration/test_cookiecutter_generation/actor/cookiecutter-stdout.txt b/tests_golden/integration/test_cookiecutter_generation/actor/cookiecutter-stdout.txt index b2d6c502..f4aaaaa2 100644 --- a/tests_golden/integration/test_cookiecutter_generation/actor/cookiecutter-stdout.txt +++ b/tests_golden/integration/test_cookiecutter_generation/actor/cookiecutter-stdout.txt @@ -16,7 +16,7 @@ ./mkdocs.yml: # TODO(cookiecutter): You might want to add other external references here ./mkdocs.yml: # TODO(cookiecutter): You might want to change the logo, the file is located in "docs/" ./mkdocs.yml: # TODO(cookiecutter): You probably want to update the social links -./mkdocs.yml:# TODO(cookiecutter): "main" is the GitHub repo default branch, you might want to update it +./mkdocs.yml:# TODO(cookiecutter): "v0.x.x" is the GitHub repo default branch, you might want to update it ./pyproject.toml:# TODO(cookiecutter): Remove and add more classifiers if appropriate ./pyproject.toml:# TODO(cookiecutter): Remove and add more dependencies if appropriate ./pyproject.toml:# TODO(cookiecutter): Remove and add more optional dependencies if appropriate diff --git a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/mkdocs.yml b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/mkdocs.yml index ae4f9231..cf4afa48 100644 --- a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/mkdocs.yml +++ b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/mkdocs.yml @@ -8,9 +8,9 @@ site_author: "Frequenz Energy-as-a-Service GmbH" copyright: "Copyright © 2023 Frequenz Energy-as-a-Service GmbH" repo_name: "frequenz-actor-test" repo_url: "https://github.com/frequenz-floss/frequenz-actor-test" -# TODO(cookiecutter): "main" is the GitHub repo default branch, you might want to update it +# TODO(cookiecutter): "v0.x.x" is the GitHub repo default branch, you might want to update it # if the project uses a different default branch. -edit_uri: "edit/main/docs/" +edit_uri: "edit/v0.x.x/docs/" strict: true # Treat warnings as errors # Build directories diff --git a/tests_golden/integration/test_cookiecutter_generation/api/cookiecutter-stdout.txt b/tests_golden/integration/test_cookiecutter_generation/api/cookiecutter-stdout.txt index 9f3e52f1..2ec694d7 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/cookiecutter-stdout.txt +++ b/tests_golden/integration/test_cookiecutter_generation/api/cookiecutter-stdout.txt @@ -16,7 +16,7 @@ ./mkdocs.yml: # TODO(cookiecutter): You might want to add other external references here ./mkdocs.yml: # TODO(cookiecutter): You might want to change the logo, the file is located in "docs/" ./mkdocs.yml: # TODO(cookiecutter): You probably want to update the social links -./mkdocs.yml:# TODO(cookiecutter): "main" is the GitHub repo default branch, you might want to update it +./mkdocs.yml:# TODO(cookiecutter): "v0.x.x" is the GitHub repo default branch, you might want to update it ./proto/frequenz/api/test/test.proto:// TODO(cookiecutter): Add a more descriptive package description. ./proto/frequenz/api/test/test.proto:// TODO(cookiecutter): Remove this message. ./py/frequenz/api/test/__init__.py:TODO(cookiecutter): Add a more descriptive module description. diff --git a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/mkdocs.yml b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/mkdocs.yml index fea1965e..f02aa9d9 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/mkdocs.yml +++ b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/mkdocs.yml @@ -8,9 +8,9 @@ site_author: "Frequenz Energy-as-a-Service GmbH" copyright: "Copyright © 2023 Frequenz Energy-as-a-Service GmbH" repo_name: "frequenz-api-test" repo_url: "https://github.com/frequenz-floss/frequenz-api-test" -# TODO(cookiecutter): "main" is the GitHub repo default branch, you might want to update it +# TODO(cookiecutter): "v0.x.x" is the GitHub repo default branch, you might want to update it # if the project uses a different default branch. -edit_uri: "edit/main/docs/" +edit_uri: "edit/v0.x.x/docs/" strict: true # Treat warnings as errors # Build directories diff --git a/tests_golden/integration/test_cookiecutter_generation/app/cookiecutter-stdout.txt b/tests_golden/integration/test_cookiecutter_generation/app/cookiecutter-stdout.txt index 36447a86..8a5abb01 100644 --- a/tests_golden/integration/test_cookiecutter_generation/app/cookiecutter-stdout.txt +++ b/tests_golden/integration/test_cookiecutter_generation/app/cookiecutter-stdout.txt @@ -15,7 +15,7 @@ ./mkdocs.yml: # TODO(cookiecutter): You might want to add other external references here ./mkdocs.yml: # TODO(cookiecutter): You might want to change the logo, the file is located in "docs/" ./mkdocs.yml: # TODO(cookiecutter): You probably want to update the social links -./mkdocs.yml:# TODO(cookiecutter): "main" is the GitHub repo default branch, you might want to update it +./mkdocs.yml:# TODO(cookiecutter): "v0.x.x" is the GitHub repo default branch, you might want to update it ./pyproject.toml:# TODO(cookiecutter): Remove and add more classifiers if appropriate ./pyproject.toml:# TODO(cookiecutter): Remove and add more dependencies if appropriate ./pyproject.toml:# TODO(cookiecutter): Remove and add more optional dependencies if appropriate diff --git a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/mkdocs.yml b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/mkdocs.yml index 8ce71a0c..7e2a698e 100644 --- a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/mkdocs.yml +++ b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/mkdocs.yml @@ -8,9 +8,9 @@ site_author: "Frequenz Energy-as-a-Service GmbH" copyright: "Copyright © 2023 Frequenz Energy-as-a-Service GmbH" repo_name: "frequenz-app-test" repo_url: "https://github.com/frequenz-floss/frequenz-app-test" -# TODO(cookiecutter): "main" is the GitHub repo default branch, you might want to update it +# TODO(cookiecutter): "v0.x.x" is the GitHub repo default branch, you might want to update it # if the project uses a different default branch. -edit_uri: "edit/main/docs/" +edit_uri: "edit/v0.x.x/docs/" strict: true # Treat warnings as errors # Build directories diff --git a/tests_golden/integration/test_cookiecutter_generation/lib/cookiecutter-stdout.txt b/tests_golden/integration/test_cookiecutter_generation/lib/cookiecutter-stdout.txt index db944150..77bc53b5 100644 --- a/tests_golden/integration/test_cookiecutter_generation/lib/cookiecutter-stdout.txt +++ b/tests_golden/integration/test_cookiecutter_generation/lib/cookiecutter-stdout.txt @@ -15,7 +15,7 @@ ./mkdocs.yml: # TODO(cookiecutter): You might want to add other external references here ./mkdocs.yml: # TODO(cookiecutter): You might want to change the logo, the file is located in "docs/" ./mkdocs.yml: # TODO(cookiecutter): You probably want to update the social links -./mkdocs.yml:# TODO(cookiecutter): "main" is the GitHub repo default branch, you might want to update it +./mkdocs.yml:# TODO(cookiecutter): "v0.x.x" is the GitHub repo default branch, you might want to update it ./pyproject.toml:# TODO(cookiecutter): Remove and add more classifiers if appropriate ./pyproject.toml:# TODO(cookiecutter): Remove and add more dependencies if appropriate ./pyproject.toml:# TODO(cookiecutter): Remove and add more optional dependencies if appropriate diff --git a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/mkdocs.yml b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/mkdocs.yml index fc4666b5..7e268f79 100644 --- a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/mkdocs.yml +++ b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/mkdocs.yml @@ -8,9 +8,9 @@ site_author: "Frequenz Energy-as-a-Service GmbH" copyright: "Copyright © 2023 Frequenz Energy-as-a-Service GmbH" repo_name: "frequenz-test-python" repo_url: "https://github.com/frequenz-floss/frequenz-test-python" -# TODO(cookiecutter): "main" is the GitHub repo default branch, you might want to update it +# TODO(cookiecutter): "v0.x.x" is the GitHub repo default branch, you might want to update it # if the project uses a different default branch. -edit_uri: "edit/main/docs/" +edit_uri: "edit/v0.x.x/docs/" strict: true # Treat warnings as errors # Build directories diff --git a/tests_golden/integration/test_cookiecutter_generation/model/cookiecutter-stdout.txt b/tests_golden/integration/test_cookiecutter_generation/model/cookiecutter-stdout.txt index 81a2d8d3..0ba3358d 100644 --- a/tests_golden/integration/test_cookiecutter_generation/model/cookiecutter-stdout.txt +++ b/tests_golden/integration/test_cookiecutter_generation/model/cookiecutter-stdout.txt @@ -15,7 +15,7 @@ ./mkdocs.yml: # TODO(cookiecutter): You might want to add other external references here ./mkdocs.yml: # TODO(cookiecutter): You might want to change the logo, the file is located in "docs/" ./mkdocs.yml: # TODO(cookiecutter): You probably want to update the social links -./mkdocs.yml:# TODO(cookiecutter): "main" is the GitHub repo default branch, you might want to update it +./mkdocs.yml:# TODO(cookiecutter): "v0.x.x" is the GitHub repo default branch, you might want to update it ./pyproject.toml:# TODO(cookiecutter): Remove and add more classifiers if appropriate ./pyproject.toml:# TODO(cookiecutter): Remove and add more dependencies if appropriate ./pyproject.toml:# TODO(cookiecutter): Remove and add more optional dependencies if appropriate diff --git a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/mkdocs.yml b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/mkdocs.yml index 82aabe9b..9849e3b6 100644 --- a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/mkdocs.yml +++ b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/mkdocs.yml @@ -8,9 +8,9 @@ site_author: "Frequenz Energy-as-a-Service GmbH" copyright: "Copyright © 2023 Frequenz Energy-as-a-Service GmbH" repo_name: "frequenz-model-test" repo_url: "https://github.com/frequenz-floss/frequenz-model-test" -# TODO(cookiecutter): "main" is the GitHub repo default branch, you might want to update it +# TODO(cookiecutter): "v0.x.x" is the GitHub repo default branch, you might want to update it # if the project uses a different default branch. -edit_uri: "edit/main/docs/" +edit_uri: "edit/v0.x.x/docs/" strict: true # Treat warnings as errors # Build directories From adee29d6a4fdeb462299db1f168d31560771bc92 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 11 Sep 2024 14:20:29 +0200 Subject: [PATCH 26/50] Bump SDK dependency to 1.0.0rc901 We also need to bump the documentation references to the SDK to the new version and the channels too, as the SDK now depends on 1.1.x, and the `typing-extensions` dependency to 4.6.1, as it is the minimum version required by the SDK. Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 1 + cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml | 4 ++-- cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml | 4 ++-- .../actor/frequenz-actor-test/mkdocs.yml | 4 ++-- .../actor/frequenz-actor-test/pyproject.toml | 4 ++-- .../app/frequenz-app-test/mkdocs.yml | 4 ++-- .../app/frequenz-app-test/pyproject.toml | 4 ++-- .../model/frequenz-model-test/mkdocs.yml | 4 ++-- .../model/frequenz-model-test/pyproject.toml | 4 ++-- 9 files changed, 17 insertions(+), 16 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index bb433336..571e8e7f 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -22,6 +22,7 @@ * API projects don't include the `google-common-protos` dependency by default. * API projects updated the `grpcio` dependency to `1.66.1`. * API projects updated the `frequenz-api-common` dependency to `0.6`. +* Update the SDK dependency to `1.0.0rc901`. * Change `edit_uri` default branch to v0.x.x in mkdocs.yml. ## Bug Fixes diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml b/cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml index 176b1f49..4110b297 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/mkdocs.yml @@ -121,8 +121,8 @@ plugins: # See https://mkdocstrings.github.io/python/usage/#import for details - https://docs.python.org/3/objects.inv {%- if cookiecutter.type in ("actor", "app", "model") %} - - https://frequenz-floss.github.io/frequenz-channels-python/v0.16/objects.inv - - https://frequenz-floss.github.io/frequenz-sdk-python/v0.25/objects.inv + - https://frequenz-floss.github.io/frequenz-channels-python/v1/objects.inv + - https://frequenz-floss.github.io/frequenz-sdk-python/v1.0-pre/objects.inv {%- elif cookiecutter.type == "api" %} - https://frequenz-floss.github.io/frequenz-api-common/v0.6/objects.inv - https://grpc.github.io/grpc/python/objects.inv diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml index e1e323e7..ae5d4c31 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml @@ -44,11 +44,11 @@ requires-python = ">= 3.11, < 4" # TODO(cookiecutter): Remove and add more dependencies if appropriate {%- if cookiecutter.type in ("app", "actor", "model") %} dependencies = [ - "typing-extensions == 4.5.0", + "typing-extensions == 4.6.1", # Make sure to update the version for cross-referencing also in the # mkdocs.yml file when changing the version here (look for the config key # plugins.mkdocstrings.handlers.python.import) - "frequenz-sdk == 0.25.0", + "frequenz-sdk >= 1.0.0rc901, < 1.0.0rc1000", ] {%- elif cookiecutter.type == "api" %} dependencies = [ diff --git a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/mkdocs.yml b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/mkdocs.yml index cf4afa48..b15eefcd 100644 --- a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/mkdocs.yml +++ b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/mkdocs.yml @@ -120,8 +120,8 @@ plugins: # TODO(cookiecutter): You might want to add other external references here # See https://mkdocstrings.github.io/python/usage/#import for details - https://docs.python.org/3/objects.inv - - https://frequenz-floss.github.io/frequenz-channels-python/v0.16/objects.inv - - https://frequenz-floss.github.io/frequenz-sdk-python/v0.25/objects.inv + - https://frequenz-floss.github.io/frequenz-channels-python/v1/objects.inv + - https://frequenz-floss.github.io/frequenz-sdk-python/v1.0-pre/objects.inv - https://typing-extensions.readthedocs.io/en/stable/objects.inv # Note this plugin must be loaded after mkdocstrings to be able to use macros # inside docstrings. See the comment in `docs/_scripts/macros.py` for more diff --git a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml index 9ab6808c..32efde54 100644 --- a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml @@ -28,11 +28,11 @@ classifiers = [ requires-python = ">= 3.11, < 4" # TODO(cookiecutter): Remove and add more dependencies if appropriate dependencies = [ - "typing-extensions == 4.5.0", + "typing-extensions == 4.6.1", # Make sure to update the version for cross-referencing also in the # mkdocs.yml file when changing the version here (look for the config key # plugins.mkdocstrings.handlers.python.import) - "frequenz-sdk == 0.25.0", + "frequenz-sdk >= 1.0.0rc901, < 1.0.0rc1000", ] dynamic = ["version"] diff --git a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/mkdocs.yml b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/mkdocs.yml index 7e2a698e..c5bebc0b 100644 --- a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/mkdocs.yml +++ b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/mkdocs.yml @@ -120,8 +120,8 @@ plugins: # TODO(cookiecutter): You might want to add other external references here # See https://mkdocstrings.github.io/python/usage/#import for details - https://docs.python.org/3/objects.inv - - https://frequenz-floss.github.io/frequenz-channels-python/v0.16/objects.inv - - https://frequenz-floss.github.io/frequenz-sdk-python/v0.25/objects.inv + - https://frequenz-floss.github.io/frequenz-channels-python/v1/objects.inv + - https://frequenz-floss.github.io/frequenz-sdk-python/v1.0-pre/objects.inv - https://typing-extensions.readthedocs.io/en/stable/objects.inv # Note this plugin must be loaded after mkdocstrings to be able to use macros # inside docstrings. See the comment in `docs/_scripts/macros.py` for more diff --git a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml index a24de52d..47706fda 100644 --- a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml @@ -27,11 +27,11 @@ classifiers = [ requires-python = ">= 3.11, < 4" # TODO(cookiecutter): Remove and add more dependencies if appropriate dependencies = [ - "typing-extensions == 4.5.0", + "typing-extensions == 4.6.1", # Make sure to update the version for cross-referencing also in the # mkdocs.yml file when changing the version here (look for the config key # plugins.mkdocstrings.handlers.python.import) - "frequenz-sdk == 0.25.0", + "frequenz-sdk >= 1.0.0rc901, < 1.0.0rc1000", ] dynamic = ["version"] diff --git a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/mkdocs.yml b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/mkdocs.yml index 9849e3b6..d7d1a203 100644 --- a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/mkdocs.yml +++ b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/mkdocs.yml @@ -120,8 +120,8 @@ plugins: # TODO(cookiecutter): You might want to add other external references here # See https://mkdocstrings.github.io/python/usage/#import for details - https://docs.python.org/3/objects.inv - - https://frequenz-floss.github.io/frequenz-channels-python/v0.16/objects.inv - - https://frequenz-floss.github.io/frequenz-sdk-python/v0.25/objects.inv + - https://frequenz-floss.github.io/frequenz-channels-python/v1/objects.inv + - https://frequenz-floss.github.io/frequenz-sdk-python/v1.0-pre/objects.inv - https://typing-extensions.readthedocs.io/en/stable/objects.inv # Note this plugin must be loaded after mkdocstrings to be able to use macros # inside docstrings. See the comment in `docs/_scripts/macros.py` for more diff --git a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml index 439989d3..8712d120 100644 --- a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml @@ -28,11 +28,11 @@ classifiers = [ requires-python = ">= 3.11, < 4" # TODO(cookiecutter): Remove and add more dependencies if appropriate dependencies = [ - "typing-extensions == 4.5.0", + "typing-extensions == 4.6.1", # Make sure to update the version for cross-referencing also in the # mkdocs.yml file when changing the version here (look for the config key # plugins.mkdocstrings.handlers.python.import) - "frequenz-sdk == 0.25.0", + "frequenz-sdk >= 1.0.0rc901, < 1.0.0rc1000", ] dynamic = ["version"] From 9523da124a18e22c76e5223f5eba5acbb77596f3 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Tue, 1 Oct 2024 10:03:45 +0200 Subject: [PATCH 27/50] template: Add `asyncio_default_fixture_loop_scope = "function"` option `pytest-asyncio` has deprecated not providing a value for the `asyncio_default_fixture_loop_scope` option. This commit adds a default value of `"function"` for this option, as it was the previous default, in the `pyproject.toml` files of this and all the generated projects. Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 1 + cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml | 1 + .../actor/frequenz-actor-test/pyproject.toml | 1 + .../app/frequenz-app-test/pyproject.toml | 1 + .../lib/frequenz-test-python/pyproject.toml | 1 + .../model/frequenz-model-test/pyproject.toml | 1 + 6 files changed, 6 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 571e8e7f..1b81fd7b 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -24,6 +24,7 @@ * API projects updated the `frequenz-api-common` dependency to `0.6`. * Update the SDK dependency to `1.0.0rc901`. * Change `edit_uri` default branch to v0.x.x in mkdocs.yml. +* Added a new default option `asyncio_default_fixture_loop_scope = "function"` for `pytest-asyncio` as not providing a value is deprecated. ## Bug Fixes diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml index ae5d4c31..deff513b 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml @@ -197,6 +197,7 @@ disable = [ {%- if cookiecutter.type != "api" %} testpaths = ["tests", "src"] asyncio_mode = "auto" +asyncio_default_fixture_loop_scope = "function" required_plugins = ["pytest-asyncio", "pytest-mock"] {%- else %} testpaths = ["pytests"] diff --git a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml index 32efde54..ce572583 100644 --- a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml @@ -155,6 +155,7 @@ disable = [ [tool.pytest.ini_options] testpaths = ["tests", "src"] asyncio_mode = "auto" +asyncio_default_fixture_loop_scope = "function" required_plugins = ["pytest-asyncio", "pytest-mock"] [tool.mypy] diff --git a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml index 47706fda..5cfce27e 100644 --- a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml @@ -154,6 +154,7 @@ disable = [ [tool.pytest.ini_options] testpaths = ["tests", "src"] asyncio_mode = "auto" +asyncio_default_fixture_loop_scope = "function" required_plugins = ["pytest-asyncio", "pytest-mock"] [tool.mypy] diff --git a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml index 44e8ac01..5007e812 100644 --- a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml @@ -151,6 +151,7 @@ disable = [ [tool.pytest.ini_options] testpaths = ["tests", "src"] asyncio_mode = "auto" +asyncio_default_fixture_loop_scope = "function" required_plugins = ["pytest-asyncio", "pytest-mock"] [tool.mypy] diff --git a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml index 8712d120..f171a1d7 100644 --- a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml @@ -155,6 +155,7 @@ disable = [ [tool.pytest.ini_options] testpaths = ["tests", "src"] asyncio_mode = "auto" +asyncio_default_fixture_loop_scope = "function" required_plugins = ["pytest-asyncio", "pytest-mock"] [tool.mypy] From b2436957701ef48b440af0448e806cd2c51fb706 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Fri, 25 Oct 2024 12:38:47 +0200 Subject: [PATCH 28/50] template: Bump the `pytest-asyncio` version to `0.24.0` Signed-off-by: Leandro Lucarella --- cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml | 2 +- .../actor/frequenz-actor-test/pyproject.toml | 2 +- .../app/frequenz-app-test/pyproject.toml | 2 +- .../lib/frequenz-test-python/pyproject.toml | 2 +- .../model/frequenz-model-test/pyproject.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml index deff513b..b185b57d 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml @@ -119,7 +119,7 @@ dev-pytest = [ "frequenz-repo-config[extra-lint-examples] == 0.10.0", {%- if cookiecutter.type != "api" %} "pytest-mock == 3.14.0", - "pytest-asyncio == 0.23.7", + "pytest-asyncio == 0.24.0", "async-solipsism == 0.6", {%- endif %} ] diff --git a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml index ce572583..6d93d7ee 100644 --- a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml @@ -82,7 +82,7 @@ dev-pytest = [ "pylint == 3.2.5", # We need this to check for the examples "frequenz-repo-config[extra-lint-examples] == 0.10.0", "pytest-mock == 3.14.0", - "pytest-asyncio == 0.23.7", + "pytest-asyncio == 0.24.0", "async-solipsism == 0.6", ] dev = [ diff --git a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml index 5cfce27e..f0218f09 100644 --- a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml @@ -81,7 +81,7 @@ dev-pytest = [ "pylint == 3.2.5", # We need this to check for the examples "frequenz-repo-config[extra-lint-examples] == 0.10.0", "pytest-mock == 3.14.0", - "pytest-asyncio == 0.23.7", + "pytest-asyncio == 0.24.0", "async-solipsism == 0.6", ] dev = [ diff --git a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml index 5007e812..25719541 100644 --- a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml @@ -78,7 +78,7 @@ dev-pytest = [ "pylint == 3.2.5", # We need this to check for the examples "frequenz-repo-config[extra-lint-examples] == 0.10.0", "pytest-mock == 3.14.0", - "pytest-asyncio == 0.23.7", + "pytest-asyncio == 0.24.0", "async-solipsism == 0.6", ] dev = [ diff --git a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml index f171a1d7..a87851ba 100644 --- a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml @@ -82,7 +82,7 @@ dev-pytest = [ "pylint == 3.2.5", # We need this to check for the examples "frequenz-repo-config[extra-lint-examples] == 0.10.0", "pytest-mock == 3.14.0", - "pytest-asyncio == 0.23.7", + "pytest-asyncio == 0.24.0", "async-solipsism == 0.6", ] dev = [ From 5d4c33e497f24464d0b73c4d676f71a7b8bfd346 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 28 Oct 2024 09:10:06 +0100 Subject: [PATCH 29/50] Replace the queue to protect the default branch Also, remove all the rules that are not the queue itself, the rule protecting version branches will be used for the other branch restrcitions. Signed-off-by: Leandro Lucarella --- .../start-a-new-project/configure-github.md | 4 +- .../Queue PRs for the default branch.json | 46 +++++++++ github-rulesets/Queue PRs for v0.x.x.json | 96 ------------------- 3 files changed, 48 insertions(+), 98 deletions(-) create mode 100644 github-rulesets/Queue PRs for the default branch.json delete mode 100644 github-rulesets/Queue PRs for v0.x.x.json diff --git a/docs/user-guide/start-a-new-project/configure-github.md b/docs/user-guide/start-a-new-project/configure-github.md index fa948cd2..dfdf400f 100644 --- a/docs/user-guide/start-a-new-project/configure-github.md +++ b/docs/user-guide/start-a-new-project/configure-github.md @@ -100,8 +100,8 @@ Import the following tags]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Protect released tags.json) * [Protect version branches]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Protect version branches.json) -* [Queue PRs for - v0.x.x]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Queue PRs for v0.x.x.json) +* [Queue PRs for the default + branch]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Queue PRs for the default branch.json) ### Code security and analysis diff --git a/github-rulesets/Queue PRs for the default branch.json b/github-rulesets/Queue PRs for the default branch.json new file mode 100644 index 00000000..cfa5efa9 --- /dev/null +++ b/github-rulesets/Queue PRs for the default branch.json @@ -0,0 +1,46 @@ +{ + "name": "Queue PRs for the default branch", + "target": "branch", + "source_type": "Repository", + "source": "frequenz-floss/frequenz-repo-config-python", + "enforcement": "active", + "conditions": { + "ref_name": { + "exclude": [], + "include": [ + "~DEFAULT_BRANCH" + ] + } + }, + "rules": [ + { + "type": "merge_queue", + "parameters": { + "merge_method": "MERGE", + "max_entries_to_build": 5, + "min_entries_to_merge": 1, + "max_entries_to_merge": 5, + "min_entries_to_merge_wait_minutes": 5, + "grouping_strategy": "ALLGREEN", + "check_response_timeout_minutes": 60 + } + } + ], + "bypass_actors": [ + { + "actor_id": 2, + "actor_type": "RepositoryRole", + "bypass_mode": "pull_request" + }, + { + "actor_id": 5, + "actor_type": "RepositoryRole", + "bypass_mode": "always" + }, + { + "actor_id": 1, + "actor_type": "OrganizationAdmin", + "bypass_mode": "always" + } + ] +} diff --git a/github-rulesets/Queue PRs for v0.x.x.json b/github-rulesets/Queue PRs for v0.x.x.json deleted file mode 100644 index 64f46661..00000000 --- a/github-rulesets/Queue PRs for v0.x.x.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "name": "Queue PRs for v0.x.x", - "target": "branch", - "source_type": "Repository", - "source": "frequenz-floss/frequenz-repo-config-python", - "enforcement": "active", - "conditions": { - "ref_name": { - "exclude": [], - "include": [ - "refs/heads/v0.x.x" - ] - } - }, - "rules": [ - { - "type": "non_fast_forward" - }, - { - "type": "required_signatures" - }, - { - "type": "pull_request", - "parameters": { - "required_approving_review_count": 1, - "dismiss_stale_reviews_on_push": true, - "require_code_owner_review": true, - "require_last_push_approval": true, - "required_review_thread_resolution": false - } - }, - { - "type": "required_status_checks", - "parameters": { - "strict_required_status_checks_policy": false, - "required_status_checks": [ - { - "context": "Test with nox", - "integration_id": 15368 - }, - { - "context": "Test documentation website generation", - "integration_id": 15368 - }, - { - "context": "Test package installation in different architectures", - "integration_id": 15368 - }, - { - "context": "Cross-arch tests with nox", - "integration_id": 15368 - }, - { - "context": "Check release notes are updated", - "integration_id": 15368 - }, - { - "context": "DCO" - } - ] - } - }, - { - "type": "deletion" - }, - { - "type": "merge_queue", - "parameters": { - "merge_method": "Merge commit", - "max_entries_to_build": 5, - "min_entries_to_merge": 1, - "max_entries_to_merge": 5, - "min_entries_to_merge_wait_minutes": 5, - "grouping_strategy_all_green": true, - "check_response_timeout_minutes": 60 - } - } - ], - "bypass_actors": [ - { - "actor_id": 2, - "actor_type": "RepositoryRole", - "bypass_mode": "pull_request" - }, - { - "actor_id": 5, - "actor_type": "RepositoryRole", - "bypass_mode": "always" - }, - { - "actor_id": 1, - "actor_type": "OrganizationAdmin", - "bypass_mode": "always" - } - ] -} From d1452dfaaead8b160725645a42515f2a6160791a Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 28 Oct 2024 09:12:29 +0100 Subject: [PATCH 30/50] Move Python-specific rulesets to a dedicated directory This allows to more easily add more rulesets for other languages in the future. Signed-off-by: Leandro Lucarella --- docs/user-guide/start-a-new-project/configure-github.md | 7 +++++-- github-rulesets/{ => python}/Protect version branches.json | 0 2 files changed, 5 insertions(+), 2 deletions(-) rename github-rulesets/{ => python}/Protect version branches.json (100%) diff --git a/docs/user-guide/start-a-new-project/configure-github.md b/docs/user-guide/start-a-new-project/configure-github.md index dfdf400f..d7fc3345 100644 --- a/docs/user-guide/start-a-new-project/configure-github.md +++ b/docs/user-guide/start-a-new-project/configure-github.md @@ -98,11 +98,14 @@ Import the following gh-pages]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Disallow removal and force-pushes of gh-pages.json) * [Protect released tags]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Protect released tags.json) -* [Protect version - branches]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Protect version branches.json) * [Queue PRs for the default branch]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/Queue PRs for the default branch.json) +##### Python specific rulesets + +* [Protect version + branches]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/python/Protect version branches.json) + ### Code security and analysis * Enable *Dependabot version updates* if relevant diff --git a/github-rulesets/Protect version branches.json b/github-rulesets/python/Protect version branches.json similarity index 100% rename from github-rulesets/Protect version branches.json rename to github-rulesets/python/Protect version branches.json From c0aa8972d05b4402a2fefe02f38142365b695e9c Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 28 Oct 2024 09:23:11 +0100 Subject: [PATCH 31/50] Add a rust-specific ruleset for version branches This is the same as the Python rule, but with different CI checks that are required, to match the Rust CI. Signed-off-by: Leandro Lucarella --- .../start-a-new-project/configure-github.md | 5 ++ .../rust/Protect version branches.json | 74 +++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 github-rulesets/rust/Protect version branches.json diff --git a/docs/user-guide/start-a-new-project/configure-github.md b/docs/user-guide/start-a-new-project/configure-github.md index d7fc3345..b0d2c84c 100644 --- a/docs/user-guide/start-a-new-project/configure-github.md +++ b/docs/user-guide/start-a-new-project/configure-github.md @@ -106,6 +106,11 @@ Import the following * [Protect version branches]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/python/Protect version branches.json) +##### Rust specific rulesets + +* [Protect version + branches]({{config.repo_url}}/blob/{{ref_name}}/github-rulesets/rust/Protect version branches.json) + ### Code security and analysis * Enable *Dependabot version updates* if relevant diff --git a/github-rulesets/rust/Protect version branches.json b/github-rulesets/rust/Protect version branches.json new file mode 100644 index 00000000..75d6dc04 --- /dev/null +++ b/github-rulesets/rust/Protect version branches.json @@ -0,0 +1,74 @@ +{ + "name": "Protect version branches", + "target": "branch", + "source_type": "Repository", + "source": "frequenz-floss/frequenz-repo-config-python", + "enforcement": "active", + "conditions": { + "ref_name": { + "exclude": [], + "include": [ + "~DEFAULT_BRANCH", + "refs/heads/v[0-9]*.[0-9x]*.x" + ] + } + }, + "rules": [ + { + "type": "non_fast_forward" + }, + { + "type": "required_signatures" + }, + { + "type": "pull_request", + "parameters": { + "require_code_owner_review": true, + "require_last_push_approval": true, + "dismiss_stale_reviews_on_push": true, + "required_approving_review_count": 1, + "required_review_thread_resolution": false + } + }, + { + "type": "required_status_checks", + "parameters": { + "strict_required_status_checks_policy": false, + "do_not_enforce_on_create": false, + "required_status_checks": [ + { + "context": "DCO" + }, + { + "context": "Check release notes are updated", + "integration_id": 15368 + }, + { + "context": "test", + "integration_id": 15368 + } + ] + } + }, + { + "type": "deletion" + } + ], + "bypass_actors": [ + { + "actor_id": 2, + "actor_type": "RepositoryRole", + "bypass_mode": "pull_request" + }, + { + "actor_id": 5, + "actor_type": "RepositoryRole", + "bypass_mode": "always" + }, + { + "actor_id": 1, + "actor_type": "OrganizationAdmin", + "bypass_mode": "always" + } + ] +} From bcd8412dbddad943a753baedcc401f40453296d0 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Mon, 28 Oct 2024 09:54:31 +0100 Subject: [PATCH 32/50] Add release notes Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 1b81fd7b..0d5a2e91 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -7,6 +7,7 @@ ## 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 @@ -14,7 +15,7 @@ ## New Features - +* Added a new GitHub branch ruleset for Rust projects. ### Cookiecutter template From f721297b1f85a217b70da34cfde29753b556db6d Mon Sep 17 00:00:00 2001 From: "Mathias L. Baumann" Date: Wed, 2 Oct 2024 12:00:26 +0200 Subject: [PATCH 33/50] Also parse init files in Sybil It seems newer versions have no issue anymore with this. Signed-off-by: Mathias L. Baumann --- RELEASE_NOTES.md | 2 +- src/frequenz/repo/config/pytest/examples.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 0d5a2e91..488d11f4 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -29,7 +29,7 @@ ## Bug Fixes - +* Sybil now parses the `__init__.py` file as well. Previously it was disabled due to an upstream bug. ### Cookiecutter template diff --git a/src/frequenz/repo/config/pytest/examples.py b/src/frequenz/repo/config/pytest/examples.py index b79fbfe6..7038a7e2 100644 --- a/src/frequenz/repo/config/pytest/examples.py +++ b/src/frequenz/repo/config/pytest/examples.py @@ -228,8 +228,4 @@ def get_sybil_arguments() -> dict[str, Any]: return { "parsers": [MyPythonCodeBlockParser()], "patterns": ["*.py"], - # This is a hack because Sybil seems to have issues with `__init__.py` files. - # See https://github.com/frequenz-floss/frequenz-repo-config-python/issues/113 - # for details - "excludes": ["__init__.py"], } From c21c8cbfd13f95ea62358cc5060e68b08b41b57d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 03:58:33 +0000 Subject: [PATCH 34/50] Bump the required group with 7 updates Bumps the required group with 7 updates: | Package | From | To | | --- | --- | --- | | [nox](https://github.com/wntrblm/nox) | `2024.4.15` | `2024.10.9` | | [black](https://github.com/psf/black) | `24.8.0` | `24.10.0` | | [mkdocs-macros-plugin](https://github.com/fralau/mkdocs_macros_plugin) | `1.2.0` | `1.3.7` | | [mkdocs-material](https://github.com/squidfunk/mkdocs-material) | `9.5.39` | `9.5.43` | | [mkdocstrings[python]](https://github.com/mkdocstrings/mkdocstrings) | `0.26.1` | `0.26.2` | | [mkdocstrings-python](https://github.com/mkdocstrings/python) | `1.11.1` | `1.12.2` | | [mypy](https://github.com/python/mypy) | `1.11.2` | `1.13.0` | Updates `nox` from 2024.4.15 to 2024.10.9 - [Release notes](https://github.com/wntrblm/nox/releases) - [Changelog](https://github.com/wntrblm/nox/blob/main/CHANGELOG.md) - [Commits](https://github.com/wntrblm/nox/compare/2024.04.15...2024.10.09) Updates `black` from 24.8.0 to 24.10.0 - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/24.8.0...24.10.0) Updates `mkdocs-macros-plugin` from 1.2.0 to 1.3.7 - [Release notes](https://github.com/fralau/mkdocs_macros_plugin/releases) - [Changelog](https://github.com/fralau/mkdocs-macros-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/fralau/mkdocs_macros_plugin/compare/v1.2.0...v1.3.7) Updates `mkdocs-material` from 9.5.39 to 9.5.43 - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG) - [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.5.39...9.5.43) Updates `mkdocstrings[python]` from 0.26.1 to 0.26.2 - [Release notes](https://github.com/mkdocstrings/mkdocstrings/releases) - [Changelog](https://github.com/mkdocstrings/mkdocstrings/blob/main/CHANGELOG.md) - [Commits](https://github.com/mkdocstrings/mkdocstrings/compare/0.26.1...0.26.2) Updates `mkdocstrings-python` from 1.11.1 to 1.12.2 - [Release notes](https://github.com/mkdocstrings/python/releases) - [Changelog](https://github.com/mkdocstrings/python/blob/main/CHANGELOG.md) - [Commits](https://github.com/mkdocstrings/python/compare/1.11.1...1.12.2) Updates `mypy` from 1.11.2 to 1.13.0 - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](https://github.com/python/mypy/compare/v1.11.2...v1.13.0) --- updated-dependencies: - dependency-name: nox dependency-type: direct:production update-type: version-update:semver-minor dependency-group: required - dependency-name: black dependency-type: direct:production update-type: version-update:semver-minor dependency-group: required - dependency-name: mkdocs-macros-plugin dependency-type: direct:production update-type: version-update:semver-minor dependency-group: required - dependency-name: mkdocs-material dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required - dependency-name: mkdocstrings[python] dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required - dependency-name: mkdocstrings-python dependency-type: direct:production update-type: version-update:semver-minor dependency-group: required - dependency-name: mypy dependency-type: direct:production update-type: version-update:semver-minor dependency-group: required ... Signed-off-by: dependabot[bot] --- pyproject.toml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 78d4c711..90c67081 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,20 +73,20 @@ dev-flake8 = [ "pydoclint == 0.5.9", "pydocstyle == 6.3.0", ] -dev-formatting = ["black == 24.8.0", "isort == 5.13.2"] +dev-formatting = ["black == 24.10.0", "isort == 5.13.2"] dev-mkdocs = [ - "black == 24.8.0", + "black == 24.10.0", "Markdown == 3.7", "mike == 2.1.3", "mkdocs-gen-files == 0.5.0", "mkdocs-literate-nav == 0.6.1", - "mkdocs-macros-plugin == 1.2.0", - "mkdocs-material == 9.5.39", - "mkdocstrings[python] == 0.26.1", - "mkdocstrings-python == 1.11.1", + "mkdocs-macros-plugin == 1.3.7", + "mkdocs-material == 9.5.43", + "mkdocstrings[python] == 0.26.2", + "mkdocstrings-python == 1.12.2", ] dev-mypy = [ - "mypy == 1.11.2", + "mypy == 1.13.0", "types-setuptools >= 67.6.0, < 76", # Should match the build dependency "types-Markdown == 3.7.0.20240822", "types-PyYAML == 6.0.12.20240917", @@ -95,7 +95,7 @@ dev-mypy = [ # For checking the noxfile, docs/ script, and tests "frequenz-repo-config[dev-mkdocs,dev-noxfile,dev-pytest]", ] -dev-noxfile = ["nox == 2024.4.15"] +dev-noxfile = ["nox == 2024.10.9"] dev-pylint = [ # dev-pytest already defines a dependency to pylint because of the examples # For checking the noxfile, docs/ script, and tests From 1a78fec81a24305acfe04285cad3d1302f2c27b8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:07:15 +0000 Subject: [PATCH 35/50] Bump the required group with 2 updates Bumps the required group with 2 updates: [mkdocs-material](https://github.com/squidfunk/mkdocs-material) and [mkdocstrings[python]](https://github.com/mkdocstrings/mkdocstrings). Updates `mkdocs-material` from 9.5.43 to 9.5.45 - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG) - [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.5.43...9.5.45) Updates `mkdocstrings[python]` from 0.26.2 to 0.27.0 - [Release notes](https://github.com/mkdocstrings/mkdocstrings/releases) - [Changelog](https://github.com/mkdocstrings/mkdocstrings/blob/main/CHANGELOG.md) - [Commits](https://github.com/mkdocstrings/mkdocstrings/compare/0.26.2...0.27.0) --- updated-dependencies: - dependency-name: mkdocs-material dependency-type: direct:production update-type: version-update:semver-patch dependency-group: required - dependency-name: mkdocstrings[python] dependency-type: direct:production update-type: version-update:semver-minor dependency-group: required ... Signed-off-by: dependabot[bot] --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 90c67081..f95a82c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -81,8 +81,8 @@ dev-mkdocs = [ "mkdocs-gen-files == 0.5.0", "mkdocs-literate-nav == 0.6.1", "mkdocs-macros-plugin == 1.3.7", - "mkdocs-material == 9.5.43", - "mkdocstrings[python] == 0.26.2", + "mkdocs-material == 9.5.45", + "mkdocstrings[python] == 0.27.0", "mkdocstrings-python == 1.12.2", ] dev-mypy = [ From 72fd096d0a668aa50e9e8729b78a904eaaea0bc5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:07:36 +0000 Subject: [PATCH 36/50] Bump setuptools-scm[toml] from 7.1.0 to 8.1.0 Bumps [setuptools-scm[toml]](https://github.com/pypa/setuptools_scm) from 7.1.0 to 8.1.0. - [Release notes](https://github.com/pypa/setuptools_scm/releases) - [Changelog](https://github.com/pypa/setuptools-scm/blob/main/CHANGELOG.md) - [Commits](https://github.com/pypa/setuptools_scm/compare/v7.1.0...v8.1.0) --- updated-dependencies: - dependency-name: setuptools-scm[toml] dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 90c67081..c9ddfcc8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ # Copyright © 2023 Frequenz Energy-as-a-Service GmbH [build-system] -requires = ["setuptools == 68.1.0", "setuptools_scm[toml] == 7.1.0"] +requires = ["setuptools == 68.1.0", "setuptools_scm[toml] == 8.1.0"] build-backend = "setuptools.build_meta" [project] From 735ef9bce528c22991d8d80cc6e8b8c43c229739 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:07:43 +0000 Subject: [PATCH 37/50] Update sybil requirement from <9,>=6.1.1 to >=6.1.1,<10 Updates the requirements on [sybil](https://github.com/simplistix/sybil) to permit the latest version. - [Changelog](https://github.com/simplistix/sybil/blob/master/CHANGELOG.rst) - [Commits](https://github.com/simplistix/sybil/compare/6.1.1...9.0.0) --- updated-dependencies: - dependency-name: sybil dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 90c67081..60e8aa9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,7 +64,7 @@ model = [] extra-lint-examples = [ "pylint >= 2.17.3, < 4", "pytest >= 7.3.0, < 9", - "sybil >= 6.1.1, < 9", + "sybil >= 6.1.1, < 10", ] dev-flake8 = [ "flake8 == 7.1.1", @@ -107,7 +107,7 @@ dev-pytest = [ "pylint == 3.3.1", # We need this to check for the examples "cookiecutter == 2.6.0", # For checking the cookiecutter scripts "jinja2 == 3.1.4", # For checking the cookiecutter scripts - "sybil >= 6.1.1, < 9", # Should be consistent with the extra-lint-examples dependency + "sybil >= 6.1.1, < 10", # Should be consistent with the extra-lint-examples dependency ] dev = [ "frequenz-repo-config[dev-mkdocs,dev-flake8,dev-formatting,dev-mkdocs,dev-mypy,dev-noxfile,dev-pylint,dev-pytest]", From b9b6bd530c46586d868758af615246523e214ded Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 20 Nov 2024 11:40:14 +0100 Subject: [PATCH 38/50] Port the migration script to Python Since this is used to update Python projects, it is safe to assume Python will be available. Using Python is more portable, so hopefully the migration script will work more consistently across different OSs. Signed-off-by: Leandro Lucarella --- .github/cookiecutter-migrate.template.py | 107 +++++++++++++ .github/cookiecutter-migrate.template.sh | 30 ---- CONTRIBUTING.md | 2 +- RELEASE_NOTES.md | 1 + cookiecutter/migrate.py | 141 ++++++++++++++++++ cookiecutter/migrate.sh | 53 ------- docs/user-guide/update-an-existing-project.md | 4 +- noxfile.py | 1 + pyproject.toml | 8 +- 9 files changed, 260 insertions(+), 87 deletions(-) create mode 100644 .github/cookiecutter-migrate.template.py delete mode 100644 .github/cookiecutter-migrate.template.sh create mode 100644 cookiecutter/migrate.py delete mode 100644 cookiecutter/migrate.sh diff --git a/.github/cookiecutter-migrate.template.py b/.github/cookiecutter-migrate.template.py new file mode 100644 index 00000000..c7311177 --- /dev/null +++ b/.github/cookiecutter-migrate.template.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python3 +# License: MIT +# Copyright © 2024 Frequenz Energy-as-a-Service GmbH + +"""Script to migrate existing projects to new versions of the cookiecutter template. + +This script migrates existing projects to new versions of the cookiecutter +template, removing the need to completely regenerate the project from +scratch. + +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//cookiecutter/migrate.py | python3 + +Make sure to replace the `` to the version you want to migrate to 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. +""" # noqa: E501 + +import os +import subprocess +import tempfile +from pathlib import Path +from typing import SupportsIndex + + +def main() -> None: + """Run the migration steps.""" + # Add a separation line like this one after each migration step. + print("=" * 72) + + +def apply_patch(patch_content: str) -> None: + """Apply a patch using the patch utility.""" + subprocess.run(["patch", "-p1"], input=patch_content.encode(), check=True) + + +def replace_file_contents_atomically( # noqa; DOC501 + filepath: str | Path, + old: str, + new: str, + count: SupportsIndex = -1, + *, + content: str | None = None, +) -> None: + """Replace a file atomically with new content. + + Args: + filepath: The path to the file to replace. + old: The string to replace. + new: The string to replace it with. + count: The maximum number of occurrences to replace. If negative, all occurrences are + replaced. + content: The content to replace. If not provided, the file is read from disk. + + The replacement is done atomically by writing to a temporary file and + then moving it to the target location. + """ + if isinstance(filepath, str): + filepath = Path(filepath) + + if content is None: + content = filepath.read_text(encoding="utf-8") + + content = content.replace(old, new, count) + + # Create temporary file in the same directory to ensure atomic move + tmp_dir = filepath.parent + + # pylint: disable-next=consider-using-with + tmp = tempfile.NamedTemporaryFile(mode="w", dir=tmp_dir, delete=False) + + try: + # Copy original file permissions + st = os.stat(filepath) + + # Write the new content + tmp.write(content) + + # Ensure all data is written to disk + tmp.flush() + os.fsync(tmp.fileno()) + tmp.close() + + # Copy original file permissions to the new file + os.chmod(tmp.name, st.st_mode) + + # Perform atomic replace + os.rename(tmp.name, filepath) + + except BaseException: + # Clean up the temporary file in case of errors + tmp.close() + os.unlink(tmp.name) + raise + + +def manual_step(message: str) -> None: + """Print a manual step message in yellow.""" + print(f"\033[0;33m>>> {message}\033[0m") + + +if __name__ == "__main__": + main() diff --git a/.github/cookiecutter-migrate.template.sh b/.github/cookiecutter-migrate.template.sh deleted file mode 100644 index 81f1ed0c..00000000 --- a/.github/cookiecutter-migrate.template.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# License: MIT -# Copyright © 2024 Frequenz Energy-as-a-Service GmbH -# -# This script migrates existing projects to new versions of the cookiecutter -# template, removing the need to completely regenerate the project from -# scratch. -# -# 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. -set -eu - -manual_step() { - echo "\033[0;33m>>> $@\033[0m" -} - -echo "TODO: Describe your migration step here." -# Add your migration steps here. -manual_step "Add any manual instructions for this step here." - -# Add a separation line like this one after each migration step. -echo "========================================================================" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 523f97cf..5a3616cd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -187,7 +187,7 @@ These are the steps to create a new release: ```sh cp .github/RELEASE_NOTES.template.md RELEASE_NOTES.md - cp .github/cookiecutter-migrate.template.sh cookiecutter/migrate.sh + cp .github/cookiecutter-migrate.template.py cookiecutter/migrate.py ``` Commit the new release notes and migration script, and create a PR (this step diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 488d11f4..4ba81ec9 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -26,6 +26,7 @@ * Update the SDK dependency to `1.0.0rc901`. * Change `edit_uri` default branch to v0.x.x in mkdocs.yml. * Added a new default option `asyncio_default_fixture_loop_scope = "function"` for `pytest-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. ## Bug Fixes diff --git a/cookiecutter/migrate.py b/cookiecutter/migrate.py new file mode 100644 index 00000000..b0f06558 --- /dev/null +++ b/cookiecutter/migrate.py @@ -0,0 +1,141 @@ +#!/usr/bin/env python3 +# License: MIT +# Copyright © 2024 Frequenz Energy-as-a-Service GmbH + +"""Script to migrate existing projects to new versions of the cookiecutter template. + +This script migrates existing projects to new versions of the cookiecutter +template, removing the need to completely regenerate the project from +scratch. + +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.py | python3 + +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. +""" # noqa: E501 + +import os +import subprocess +import tempfile +from pathlib import Path +from typing import SupportsIndex + + +def apply_patch(patch_content: str) -> None: + """Apply a patch using the patch utility.""" + subprocess.run(["patch", "-p1"], input=patch_content.encode(), check=True) + + +def replace_file_contents_atomically( # noqa; DOC501 + filepath: str | Path, + old: str, + new: str, + count: SupportsIndex = -1, + *, + content: str | None = None, +) -> None: + """Replace a file atomically with new content. + + Args: + filepath: The path to the file to replace. + old: The string to replace. + new: The string to replace it with. + count: The maximum number of occurrences to replace. If negative, all occurrences are + replaced. + content: The content to replace. If not provided, the file is read from disk. + + The replacement is done atomically by writing to a temporary file and + then moving it to the target location. + """ + if isinstance(filepath, str): + filepath = Path(filepath) + + if content is None: + content = filepath.read_text(encoding="utf-8") + + content = content.replace(old, new, count) + + # Create temporary file in the same directory to ensure atomic move + tmp_dir = filepath.parent + + # pylint: disable-next=consider-using-with + tmp = tempfile.NamedTemporaryFile(mode="w", dir=tmp_dir, delete=False) + + try: + # Copy original file permissions + st = os.stat(filepath) + + # Write the new content + tmp.write(content) + + # Ensure all data is written to disk + tmp.flush() + os.fsync(tmp.fileno()) + tmp.close() + + # Copy original file permissions to the new file + os.chmod(tmp.name, st.st_mode) + + # Perform atomic replace + os.rename(tmp.name, filepath) + + except BaseException: + # Clean up the temporary file in case of errors + tmp.close() + os.unlink(tmp.name) + raise + + +def main() -> None: + """Run the migration steps.""" + # Dependabot patch + dependabot_yaml = Path(".github/dependabot.yml") + print(f"{dependabot_yaml}: Add new grouping for actions/*-artifact updates.") + if dependabot_yaml.read_text(encoding="utf-8").find("actions/*-artifact") == -1: + apply_patch( + """\ +--- a/.github/dependabot.yml ++++ b/.github/dependabot.yml +@@ -39,3 +39,11 @@ updates: + labels: + - "part:tooling" + - "type:tech-debt" ++ groups: ++ compatible: ++ update-types: ++ - "minor" ++ - "patch" ++ artifacts: ++ patterns: ++ - "actions/*-artifact" +""" + ) + else: + print(f"{dependabot_yaml}: seems to be already up-to-date.") + print("=" * 72) + + # Fix labeler configuration + labeler_yml = ".github/labeler.yml" + print(f"{labeler_yml}: Fix the labeler configuration example.") + replace_file_contents_atomically( + labeler_yml, "all-glob-to-all-file", "all-globs-to-all-files" + ) + print("=" * 72) + + # Add a separation line like this one after each migration step. + print("=" * 72) + + +def manual_step(message: str) -> None: + """Print a manual step message in yellow.""" + print(f"\033[0;33m>>> {message}\033[0m") + + +if __name__ == "__main__": + main() diff --git a/cookiecutter/migrate.sh b/cookiecutter/migrate.sh deleted file mode 100644 index 1896b218..00000000 --- a/cookiecutter/migrate.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# License: MIT -# Copyright © 2024 Frequenz Energy-as-a-Service GmbH -# -# This script migrates existing projects to new versions of the cookiecutter -# template, removing the need to completely regenerate the project from -# scratch. -# -# 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. -set -eu - -manual_step() { - echo "\033[0;33m>>> $@\033[0m" -} - -#echo "TODO: Describe your migration step here." -# Add your migration steps here. -#manual_step "Add any manual instructions for this step here." - -echo "dependabot: Group GitHub Actions updates." -cat <<'EOT' | patch -p1 ---- a/.github/dependabot.yml -+++ b/.github/dependabot.yml -@@ -39,3 +39,11 @@ updates: - labels: - - "part:tooling" - - "type:tech-debt" -+ groups: -+ compatible: -+ update-types: -+ - "minor" -+ - "patch" -+ artifacts: -+ patterns: -+ - "actions/*-artifact" -EOT - -echo "========================================================================" - -echo "Fix the labeler configuration example." -perl -i -pe 's/all-glob-to-all-file/all-globs-to-all-files/g' .github/labeler.yml - -# Add a separation line like this one after each migration step. -echo "========================================================================" diff --git a/docs/user-guide/update-an-existing-project.md b/docs/user-guide/update-an-existing-project.md index 6b1ce55a..43448ffa 100644 --- a/docs/user-guide/update-an-existing-project.md +++ b/docs/user-guide/update-an-existing-project.md @@ -22,8 +22,8 @@ The easiest way to run the migration script is to fetch it from GitHub and run it directly. ```sh -curl -sSL https://raw.githubusercontent.com/frequenz-floss/frequenz-repo-config-python/{{ ref_name }}/cookiecutter/migrate.sh \ - | sh +curl -sSL https://raw.githubusercontent.com/frequenz-floss/frequenz-repo-config-python/{{ ref_name }}/cookiecutter/migrate.py \ + | python3 ``` Make sure that the version (`{{ ref_name }}`) matches the diff --git a/noxfile.py b/noxfile.py index f88d626a..6b221956 100644 --- a/noxfile.py +++ b/noxfile.py @@ -11,6 +11,7 @@ [ "cookiecutter/hooks", "cookiecutter/local_extensions.py", + "cookiecutter/migrate.py", ] ) nox.configure(config) diff --git a/pyproject.toml b/pyproject.toml index 26af333b..ba4620bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -128,7 +128,13 @@ include = '\.pyi?$' [tool.isort] profile = "black" line_length = 88 -src_paths = ["benchmarks", "examples", "src", "tests"] +src_paths = [ + "benchmarks", + "examples", + "src", + "tests", + "cookiecutter/migrate.py", +] [tool.flake8] # We give some flexibility to go over 88, there are cases like long URLs or From 01f4394c0e3196af7014d44755b33013da9fcaae Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 20 Nov 2024 11:43:57 +0100 Subject: [PATCH 39/50] Update URL in the migration script Signed-off-by: Leandro Lucarella --- cookiecutter/migrate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookiecutter/migrate.py b/cookiecutter/migrate.py index b0f06558..e2b45b76 100644 --- a/cookiecutter/migrate.py +++ b/cookiecutter/migrate.py @@ -10,9 +10,9 @@ 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.py | python3 + curl -sSL https://raw.githubusercontent.com/frequenz-floss/frequenz-repo-config-python//cookiecutter/migrate.py | python3 -Make sure the version you want to migrate to is correct in the URL. +Make sure to replace the `` to the version you want to migrate to in the URL. For jumping multiple versions you should run the script multiple times, once for each version. From bed325f2a59856e55d461d7a9ed66890a72cc98c Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 20 Nov 2024 13:11:24 +0100 Subject: [PATCH 40/50] Reformat pyproject.toml using taplo Signed-off-by: Leandro Lucarella --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ba4620bb..263018e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -107,7 +107,7 @@ dev-pytest = [ "pylint == 3.3.1", # We need this to check for the examples "cookiecutter == 2.6.0", # For checking the cookiecutter scripts "jinja2 == 3.1.4", # For checking the cookiecutter scripts - "sybil >= 6.1.1, < 10", # Should be consistent with the extra-lint-examples dependency + "sybil >= 6.1.1, < 10", # Should be consistent with the extra-lint-examples dependency ] dev = [ "frequenz-repo-config[dev-mkdocs,dev-flake8,dev-formatting,dev-mkdocs,dev-mypy,dev-noxfile,dev-pylint,dev-pytest]", From d9488a24bb326f0a1763b6cf1d4a4b0daff2b85f Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 20 Nov 2024 11:47:16 +0100 Subject: [PATCH 41/50] Add some missing pylint checks to the disabled list Signed-off-by: Leandro Lucarella --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 263018e7..e142361d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -170,8 +170,11 @@ disable = [ # pylint's unsubscriptable check is buggy and is not needed because # it is a type-check, for which we already have mypy. "unsubscriptable-object", + "no-member", # Checked by flake8 + "f-string-without-interpolation", "line-too-long", + "missing-function-docstring", "redefined-outer-name", "unnecessary-lambda-assignment", "unused-import", From 059987c878745b71787befe032477150c6400d5c Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 20 Nov 2024 11:47:44 +0100 Subject: [PATCH 42/50] Disable more pylint checks that are also checked by mypy pylint has some false positive for these checks, so better to just rely on mypy for them. Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 1 + cookiecutter/migrate.py | 39 +++++++++++++++++++ .../pyproject.toml | 6 +-- pyproject.toml | 5 ++- .../actor/frequenz-actor-test/pyproject.toml | 6 +-- .../api/frequenz-api-test/pyproject.toml | 6 +-- .../app/frequenz-app-test/pyproject.toml | 6 +-- .../lib/frequenz-test-python/pyproject.toml | 6 +-- .../model/frequenz-model-test/pyproject.toml | 6 +-- 9 files changed, 61 insertions(+), 20 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 4ba81ec9..9190bdad 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -27,6 +27,7 @@ * Change `edit_uri` default branch to v0.x.x in mkdocs.yml. * Added a new default option `asyncio_default_fixture_loop_scope = "function"` for `pytest-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 by `mypy` to avoid false positives. ## Bug Fixes diff --git a/cookiecutter/migrate.py b/cookiecutter/migrate.py index e2b45b76..1fdae3e5 100644 --- a/cookiecutter/migrate.py +++ b/cookiecutter/migrate.py @@ -92,6 +92,42 @@ def replace_file_contents_atomically( # noqa; DOC501 raise +def add_pylint_checks() -> None: + """Add new pylint checks to the project.""" + pyproject_toml = Path("pyproject.toml") + print( + f"{pyproject_toml}: Skip some flaky pylint checks that are checked better by mypy." + ) + marker = ' "no-member",\n' + pyproject_toml_content = pyproject_toml.read_text(encoding="utf-8") + if pyproject_toml_content.find(marker) == -1: + manual_step( + f"""\ +{pyproject_toml}: We couldn't find the marker {marker!r} in the file. +Please add the following lines to the file manually in the +`[tool.pylint.messages_control]` section, under the `disable` key (ideally below other +checks that are disabled because `mypy` already checks them) if they are missing: + "no-name-in-module", + "possibly-used-before-assignment", +""" + ) + return + + replacement = "" + if pyproject_toml_content.find("possibly-used-before-assignment") == -1: + replacement += ' "possibly-used-before-assignment",\n' + if pyproject_toml_content.find("no-name-in-module") == -1: + replacement += ' "no-name-in-module",\n' + + if not replacement: + print(f"{pyproject_toml}: seems to be already up-to-date.") + return + + replace_file_contents_atomically( + pyproject_toml, marker, marker + replacement, content=pyproject_toml_content + ) + + def main() -> None: """Run the migration steps.""" # Dependabot patch @@ -128,6 +164,9 @@ def main() -> None: ) print("=" * 72) + # Add new pylint checks + add_pylint_checks() + # Add a separation line like this one after each migration step. print("=" * 72) diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml index b185b57d..56a43e38 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml @@ -178,11 +178,11 @@ disable = [ # disabled because it conflicts with isort "wrong-import-order", "ungrouped-imports", - # pylint's unsubscriptable check is buggy and is not needed because - # it is a type-check, for which we already have mypy. + # Checked by mypy (and pylint is very flaky checking these) "unsubscriptable-object", - # Checked by mypy "no-member", + "no-name-in-module", + "possibly-used-before-assignment", # Checked by flake8 "f-string-without-interpolation", "line-too-long", diff --git a/pyproject.toml b/pyproject.toml index e142361d..3c089b67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -167,10 +167,11 @@ disable = [ # disabled because it conflicts with isort "wrong-import-order", "ungrouped-imports", - # pylint's unsubscriptable check is buggy and is not needed because - # it is a type-check, for which we already have mypy. + # Checked by mypy (and pylint is very flaky checking these) "unsubscriptable-object", "no-member", + "no-name-in-module", + "possibly-used-before-assignment", # Checked by flake8 "f-string-without-interpolation", "line-too-long", diff --git a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml index 6d93d7ee..a8cee941 100644 --- a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml @@ -137,11 +137,11 @@ disable = [ # disabled because it conflicts with isort "wrong-import-order", "ungrouped-imports", - # pylint's unsubscriptable check is buggy and is not needed because - # it is a type-check, for which we already have mypy. + # Checked by mypy (and pylint is very flaky checking these) "unsubscriptable-object", - # Checked by mypy "no-member", + "no-name-in-module", + "possibly-used-before-assignment", # Checked by flake8 "f-string-without-interpolation", "line-too-long", diff --git a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml index be149273..4f943ce6 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml @@ -145,11 +145,11 @@ disable = [ # disabled because it conflicts with isort "wrong-import-order", "ungrouped-imports", - # pylint's unsubscriptable check is buggy and is not needed because - # it is a type-check, for which we already have mypy. + # Checked by mypy (and pylint is very flaky checking these) "unsubscriptable-object", - # Checked by mypy "no-member", + "no-name-in-module", + "possibly-used-before-assignment", # Checked by flake8 "f-string-without-interpolation", "line-too-long", diff --git a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml index f0218f09..909dd9d1 100644 --- a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml @@ -136,11 +136,11 @@ disable = [ # disabled because it conflicts with isort "wrong-import-order", "ungrouped-imports", - # pylint's unsubscriptable check is buggy and is not needed because - # it is a type-check, for which we already have mypy. + # Checked by mypy (and pylint is very flaky checking these) "unsubscriptable-object", - # Checked by mypy "no-member", + "no-name-in-module", + "possibly-used-before-assignment", # Checked by flake8 "f-string-without-interpolation", "line-too-long", diff --git a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml index 25719541..4a91ef03 100644 --- a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml @@ -133,11 +133,11 @@ disable = [ # disabled because it conflicts with isort "wrong-import-order", "ungrouped-imports", - # pylint's unsubscriptable check is buggy and is not needed because - # it is a type-check, for which we already have mypy. + # Checked by mypy (and pylint is very flaky checking these) "unsubscriptable-object", - # Checked by mypy "no-member", + "no-name-in-module", + "possibly-used-before-assignment", # Checked by flake8 "f-string-without-interpolation", "line-too-long", diff --git a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml index a87851ba..7705032b 100644 --- a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml @@ -137,11 +137,11 @@ disable = [ # disabled because it conflicts with isort "wrong-import-order", "ungrouped-imports", - # pylint's unsubscriptable check is buggy and is not needed because - # it is a type-check, for which we already have mypy. + # Checked by mypy (and pylint is very flaky checking these) "unsubscriptable-object", - # Checked by mypy "no-member", + "no-name-in-module", + "possibly-used-before-assignment", # Checked by flake8 "f-string-without-interpolation", "line-too-long", From 57c17719584b52de48b5a44c230c9515c34010f5 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 20 Nov 2024 11:47:44 +0100 Subject: [PATCH 43/50] Bump build dependencies Signed-off-by: Leandro Lucarella --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3c089b67..c76e9b65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ # Copyright © 2023 Frequenz Energy-as-a-Service GmbH [build-system] -requires = ["setuptools == 68.1.0", "setuptools_scm[toml] == 8.1.0"] +requires = ["setuptools == 75.5.0", "setuptools_scm[toml] == 8.1.0"] build-backend = "setuptools.build_meta" [project] From 22ce6e192800e9a2bed308350b672d644a23fbef Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 20 Nov 2024 13:05:22 +0100 Subject: [PATCH 44/50] Bump most dependencies in the template Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 2 +- .../pyproject.toml | 36 +++++++++---------- .../actor/frequenz-actor-test/pyproject.toml | 34 +++++++++--------- .../api/frequenz-api-test/pyproject.toml | 30 ++++++++-------- .../app/frequenz-app-test/pyproject.toml | 34 +++++++++--------- .../lib/frequenz-test-python/pyproject.toml | 32 ++++++++--------- .../model/frequenz-model-test/pyproject.toml | 34 +++++++++--------- 7 files changed, 101 insertions(+), 101 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 9190bdad..043765dc 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -23,7 +23,7 @@ * API projects don't include the `google-common-protos` dependency by default. * API projects updated the `grpcio` dependency to `1.66.1`. * API projects updated the `frequenz-api-common` dependency to `0.6`. -* Update the SDK dependency to `1.0.0rc901`. +* 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"` for `pytest-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. diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml index 56a43e38..9a42c784 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml @@ -3,7 +3,7 @@ [build-system] requires = [ - "setuptools == 70.1.1", + "setuptools == 75.5.0", "setuptools_scm[toml] == 8.1.0", "frequenz-repo-config[{{cookiecutter.type}}] == 0.10.0", {%- if cookiecutter.type == "api" %} @@ -44,11 +44,11 @@ requires-python = ">= 3.11, < 4" # TODO(cookiecutter): Remove and add more dependencies if appropriate {%- if cookiecutter.type in ("app", "actor", "model") %} dependencies = [ - "typing-extensions == 4.6.1", + "typing-extensions == 4.12.2", # Make sure to update the version for cross-referencing also in the # mkdocs.yml file when changing the version here (look for the config key # plugins.mkdocstrings.handlers.python.import) - "frequenz-sdk >= 1.0.0rc901, < 1.0.0rc1000", + "frequenz-sdk >= 1.0.0rc1300, < 1.0.0rc1400", ] {%- elif cookiecutter.type == "api" %} dependencies = [ @@ -64,7 +64,7 @@ dependencies = [ ] {%- else %} dependencies = [ - "typing-extensions >= 4.5.0, < 5", + "typing-extensions >= 4.12.2, < 5", ] {%- endif %} dynamic = ["version"] @@ -76,23 +76,23 @@ email = "{{cookiecutter.author_email}}" # TODO(cookiecutter): Remove and add more optional dependencies if appropriate [project.optional-dependencies] dev-flake8 = [ - "flake8 == 7.1.0", + "flake8 == 7.1.1", "flake8-docstrings == 1.7.0", "flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml - "pydoclint == 0.5.3", + "pydoclint == 0.5.9", "pydocstyle == 6.3.0", ] -dev-formatting = ["black == 24.4.2", "isort == 5.13.2"] +dev-formatting = ["black == 24.10.0", "isort == 5.13.2"] dev-mkdocs = [ - "Markdown == 3.6.0", - "black == 24.4.2", - "mike == 2.1.2", + "Markdown == 3.7", + "black == 24.10.0", + "mike == 2.1.3", "mkdocs-gen-files == 0.5.0", "mkdocs-literate-nav == 0.6.1", - "mkdocs-macros-plugin == 1.0.5", - "mkdocs-material == 9.5.27", - "mkdocstrings[python] == 0.26.1", - "mkdocstrings-python == 1.11.1", + "mkdocs-macros-plugin == 1.3.7", + "mkdocs-material == 9.5.45", + "mkdocstrings[python] == 0.27.0", + "mkdocstrings-python == 1.12.2", "frequenz-repo-config[{{cookiecutter.type}}] == 0.10.0", ] dev-mypy = [ @@ -100,12 +100,12 @@ dev-mypy = [ {%- if cookiecutter.type == "api" %} "grpc-stubs == 1.53.0.2", {%- endif %} - "types-Markdown == 3.6.0.20240316", + "types-Markdown == 3.7.0.20240822", # For checking the noxfile, docs/ script, and tests "{{cookiecutter.pypi_package_name}}[dev-mkdocs,dev-noxfile,dev-pytest]", ] dev-noxfile = [ - "nox == 2024.4.15", + "nox == 2024.10.9", "frequenz-repo-config[{{cookiecutter.type}}] == 0.10.0", ] dev-pylint = [ @@ -114,8 +114,8 @@ dev-pylint = [ "{{cookiecutter.pypi_package_name}}[dev-mkdocs,dev-noxfile,dev-pytest]", ] dev-pytest = [ - "pytest == 8.2.2", - "pylint == 3.2.5", # We need this to check for the examples + "pytest == 8.3.3", + "pylint == 3.3.1", # We need this to check for the examples "frequenz-repo-config[extra-lint-examples] == 0.10.0", {%- if cookiecutter.type != "api" %} "pytest-mock == 3.14.0", diff --git a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml index a8cee941..fc8a8daf 100644 --- a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml @@ -3,7 +3,7 @@ [build-system] requires = [ - "setuptools == 70.1.1", + "setuptools == 75.5.0", "setuptools_scm[toml] == 8.1.0", "frequenz-repo-config[actor] == 0.10.0", ] @@ -28,11 +28,11 @@ classifiers = [ requires-python = ">= 3.11, < 4" # TODO(cookiecutter): Remove and add more dependencies if appropriate dependencies = [ - "typing-extensions == 4.6.1", + "typing-extensions == 4.12.2", # Make sure to update the version for cross-referencing also in the # mkdocs.yml file when changing the version here (look for the config key # plugins.mkdocstrings.handlers.python.import) - "frequenz-sdk >= 1.0.0rc901, < 1.0.0rc1000", + "frequenz-sdk >= 1.0.0rc1300, < 1.0.0rc1400", ] dynamic = ["version"] @@ -43,33 +43,33 @@ email = "floss@frequenz.com" # TODO(cookiecutter): Remove and add more optional dependencies if appropriate [project.optional-dependencies] dev-flake8 = [ - "flake8 == 7.1.0", + "flake8 == 7.1.1", "flake8-docstrings == 1.7.0", "flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml - "pydoclint == 0.5.3", + "pydoclint == 0.5.9", "pydocstyle == 6.3.0", ] -dev-formatting = ["black == 24.4.2", "isort == 5.13.2"] +dev-formatting = ["black == 24.10.0", "isort == 5.13.2"] dev-mkdocs = [ - "Markdown == 3.6.0", - "black == 24.4.2", - "mike == 2.1.2", + "Markdown == 3.7", + "black == 24.10.0", + "mike == 2.1.3", "mkdocs-gen-files == 0.5.0", "mkdocs-literate-nav == 0.6.1", - "mkdocs-macros-plugin == 1.0.5", - "mkdocs-material == 9.5.27", - "mkdocstrings[python] == 0.26.1", - "mkdocstrings-python == 1.11.1", + "mkdocs-macros-plugin == 1.3.7", + "mkdocs-material == 9.5.45", + "mkdocstrings[python] == 0.27.0", + "mkdocstrings-python == 1.12.2", "frequenz-repo-config[actor] == 0.10.0", ] dev-mypy = [ "mypy == 1.9.0", - "types-Markdown == 3.6.0.20240316", + "types-Markdown == 3.7.0.20240822", # For checking the noxfile, docs/ script, and tests "frequenz-actor-test[dev-mkdocs,dev-noxfile,dev-pytest]", ] dev-noxfile = [ - "nox == 2024.4.15", + "nox == 2024.10.9", "frequenz-repo-config[actor] == 0.10.0", ] dev-pylint = [ @@ -78,8 +78,8 @@ dev-pylint = [ "frequenz-actor-test[dev-mkdocs,dev-noxfile,dev-pytest]", ] dev-pytest = [ - "pytest == 8.2.2", - "pylint == 3.2.5", # We need this to check for the examples + "pytest == 8.3.3", + "pylint == 3.3.1", # We need this to check for the examples "frequenz-repo-config[extra-lint-examples] == 0.10.0", "pytest-mock == 3.14.0", "pytest-asyncio == 0.24.0", diff --git a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml index 4f943ce6..07a7a5c1 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml @@ -3,7 +3,7 @@ [build-system] requires = [ - "setuptools == 70.1.1", + "setuptools == 75.5.0", "setuptools_scm[toml] == 8.1.0", "frequenz-repo-config[api] == 0.10.0", # We need to pin the protobuf, grpcio and grpcio-tools dependencies to make @@ -54,34 +54,34 @@ email = "floss@frequenz.com" # TODO(cookiecutter): Remove and add more optional dependencies if appropriate [project.optional-dependencies] dev-flake8 = [ - "flake8 == 7.1.0", + "flake8 == 7.1.1", "flake8-docstrings == 1.7.0", "flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml - "pydoclint == 0.5.3", + "pydoclint == 0.5.9", "pydocstyle == 6.3.0", ] -dev-formatting = ["black == 24.4.2", "isort == 5.13.2"] +dev-formatting = ["black == 24.10.0", "isort == 5.13.2"] dev-mkdocs = [ - "Markdown == 3.6.0", - "black == 24.4.2", - "mike == 2.1.2", + "Markdown == 3.7", + "black == 24.10.0", + "mike == 2.1.3", "mkdocs-gen-files == 0.5.0", "mkdocs-literate-nav == 0.6.1", - "mkdocs-macros-plugin == 1.0.5", - "mkdocs-material == 9.5.27", - "mkdocstrings[python] == 0.26.1", - "mkdocstrings-python == 1.11.1", + "mkdocs-macros-plugin == 1.3.7", + "mkdocs-material == 9.5.45", + "mkdocstrings[python] == 0.27.0", + "mkdocstrings-python == 1.12.2", "frequenz-repo-config[api] == 0.10.0", ] dev-mypy = [ "mypy == 1.9.0", "grpc-stubs == 1.53.0.2", - "types-Markdown == 3.6.0.20240316", + "types-Markdown == 3.7.0.20240822", # For checking the noxfile, docs/ script, and tests "frequenz-api-test[dev-mkdocs,dev-noxfile,dev-pytest]", ] dev-noxfile = [ - "nox == 2024.4.15", + "nox == 2024.10.9", "frequenz-repo-config[api] == 0.10.0", ] dev-pylint = [ @@ -90,8 +90,8 @@ dev-pylint = [ "frequenz-api-test[dev-mkdocs,dev-noxfile,dev-pytest]", ] dev-pytest = [ - "pytest == 8.2.2", - "pylint == 3.2.5", # We need this to check for the examples + "pytest == 8.3.3", + "pylint == 3.3.1", # We need this to check for the examples "frequenz-repo-config[extra-lint-examples] == 0.10.0", ] dev = [ diff --git a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml index 909dd9d1..d9d6efa2 100644 --- a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml @@ -3,7 +3,7 @@ [build-system] requires = [ - "setuptools == 70.1.1", + "setuptools == 75.5.0", "setuptools_scm[toml] == 8.1.0", "frequenz-repo-config[app] == 0.10.0", ] @@ -27,11 +27,11 @@ classifiers = [ requires-python = ">= 3.11, < 4" # TODO(cookiecutter): Remove and add more dependencies if appropriate dependencies = [ - "typing-extensions == 4.6.1", + "typing-extensions == 4.12.2", # Make sure to update the version for cross-referencing also in the # mkdocs.yml file when changing the version here (look for the config key # plugins.mkdocstrings.handlers.python.import) - "frequenz-sdk >= 1.0.0rc901, < 1.0.0rc1000", + "frequenz-sdk >= 1.0.0rc1300, < 1.0.0rc1400", ] dynamic = ["version"] @@ -42,33 +42,33 @@ email = "floss@frequenz.com" # TODO(cookiecutter): Remove and add more optional dependencies if appropriate [project.optional-dependencies] dev-flake8 = [ - "flake8 == 7.1.0", + "flake8 == 7.1.1", "flake8-docstrings == 1.7.0", "flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml - "pydoclint == 0.5.3", + "pydoclint == 0.5.9", "pydocstyle == 6.3.0", ] -dev-formatting = ["black == 24.4.2", "isort == 5.13.2"] +dev-formatting = ["black == 24.10.0", "isort == 5.13.2"] dev-mkdocs = [ - "Markdown == 3.6.0", - "black == 24.4.2", - "mike == 2.1.2", + "Markdown == 3.7", + "black == 24.10.0", + "mike == 2.1.3", "mkdocs-gen-files == 0.5.0", "mkdocs-literate-nav == 0.6.1", - "mkdocs-macros-plugin == 1.0.5", - "mkdocs-material == 9.5.27", - "mkdocstrings[python] == 0.26.1", - "mkdocstrings-python == 1.11.1", + "mkdocs-macros-plugin == 1.3.7", + "mkdocs-material == 9.5.45", + "mkdocstrings[python] == 0.27.0", + "mkdocstrings-python == 1.12.2", "frequenz-repo-config[app] == 0.10.0", ] dev-mypy = [ "mypy == 1.9.0", - "types-Markdown == 3.6.0.20240316", + "types-Markdown == 3.7.0.20240822", # For checking the noxfile, docs/ script, and tests "frequenz-app-test[dev-mkdocs,dev-noxfile,dev-pytest]", ] dev-noxfile = [ - "nox == 2024.4.15", + "nox == 2024.10.9", "frequenz-repo-config[app] == 0.10.0", ] dev-pylint = [ @@ -77,8 +77,8 @@ dev-pylint = [ "frequenz-app-test[dev-mkdocs,dev-noxfile,dev-pytest]", ] dev-pytest = [ - "pytest == 8.2.2", - "pylint == 3.2.5", # We need this to check for the examples + "pytest == 8.3.3", + "pylint == 3.3.1", # We need this to check for the examples "frequenz-repo-config[extra-lint-examples] == 0.10.0", "pytest-mock == 3.14.0", "pytest-asyncio == 0.24.0", diff --git a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml index 4a91ef03..9b3dbc77 100644 --- a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml @@ -3,7 +3,7 @@ [build-system] requires = [ - "setuptools == 70.1.1", + "setuptools == 75.5.0", "setuptools_scm[toml] == 8.1.0", "frequenz-repo-config[lib] == 0.10.0", ] @@ -28,7 +28,7 @@ classifiers = [ requires-python = ">= 3.11, < 4" # TODO(cookiecutter): Remove and add more dependencies if appropriate dependencies = [ - "typing-extensions >= 4.5.0, < 5", + "typing-extensions >= 4.12.2, < 5", ] dynamic = ["version"] @@ -39,33 +39,33 @@ email = "floss@frequenz.com" # TODO(cookiecutter): Remove and add more optional dependencies if appropriate [project.optional-dependencies] dev-flake8 = [ - "flake8 == 7.1.0", + "flake8 == 7.1.1", "flake8-docstrings == 1.7.0", "flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml - "pydoclint == 0.5.3", + "pydoclint == 0.5.9", "pydocstyle == 6.3.0", ] -dev-formatting = ["black == 24.4.2", "isort == 5.13.2"] +dev-formatting = ["black == 24.10.0", "isort == 5.13.2"] dev-mkdocs = [ - "Markdown == 3.6.0", - "black == 24.4.2", - "mike == 2.1.2", + "Markdown == 3.7", + "black == 24.10.0", + "mike == 2.1.3", "mkdocs-gen-files == 0.5.0", "mkdocs-literate-nav == 0.6.1", - "mkdocs-macros-plugin == 1.0.5", - "mkdocs-material == 9.5.27", - "mkdocstrings[python] == 0.26.1", - "mkdocstrings-python == 1.11.1", + "mkdocs-macros-plugin == 1.3.7", + "mkdocs-material == 9.5.45", + "mkdocstrings[python] == 0.27.0", + "mkdocstrings-python == 1.12.2", "frequenz-repo-config[lib] == 0.10.0", ] dev-mypy = [ "mypy == 1.9.0", - "types-Markdown == 3.6.0.20240316", + "types-Markdown == 3.7.0.20240822", # For checking the noxfile, docs/ script, and tests "frequenz-test[dev-mkdocs,dev-noxfile,dev-pytest]", ] dev-noxfile = [ - "nox == 2024.4.15", + "nox == 2024.10.9", "frequenz-repo-config[lib] == 0.10.0", ] dev-pylint = [ @@ -74,8 +74,8 @@ dev-pylint = [ "frequenz-test[dev-mkdocs,dev-noxfile,dev-pytest]", ] dev-pytest = [ - "pytest == 8.2.2", - "pylint == 3.2.5", # We need this to check for the examples + "pytest == 8.3.3", + "pylint == 3.3.1", # We need this to check for the examples "frequenz-repo-config[extra-lint-examples] == 0.10.0", "pytest-mock == 3.14.0", "pytest-asyncio == 0.24.0", diff --git a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml index 7705032b..37b5cc84 100644 --- a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml @@ -3,7 +3,7 @@ [build-system] requires = [ - "setuptools == 70.1.1", + "setuptools == 75.5.0", "setuptools_scm[toml] == 8.1.0", "frequenz-repo-config[model] == 0.10.0", ] @@ -28,11 +28,11 @@ classifiers = [ requires-python = ">= 3.11, < 4" # TODO(cookiecutter): Remove and add more dependencies if appropriate dependencies = [ - "typing-extensions == 4.6.1", + "typing-extensions == 4.12.2", # Make sure to update the version for cross-referencing also in the # mkdocs.yml file when changing the version here (look for the config key # plugins.mkdocstrings.handlers.python.import) - "frequenz-sdk >= 1.0.0rc901, < 1.0.0rc1000", + "frequenz-sdk >= 1.0.0rc1300, < 1.0.0rc1400", ] dynamic = ["version"] @@ -43,33 +43,33 @@ email = "floss@frequenz.com" # TODO(cookiecutter): Remove and add more optional dependencies if appropriate [project.optional-dependencies] dev-flake8 = [ - "flake8 == 7.1.0", + "flake8 == 7.1.1", "flake8-docstrings == 1.7.0", "flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml - "pydoclint == 0.5.3", + "pydoclint == 0.5.9", "pydocstyle == 6.3.0", ] -dev-formatting = ["black == 24.4.2", "isort == 5.13.2"] +dev-formatting = ["black == 24.10.0", "isort == 5.13.2"] dev-mkdocs = [ - "Markdown == 3.6.0", - "black == 24.4.2", - "mike == 2.1.2", + "Markdown == 3.7", + "black == 24.10.0", + "mike == 2.1.3", "mkdocs-gen-files == 0.5.0", "mkdocs-literate-nav == 0.6.1", - "mkdocs-macros-plugin == 1.0.5", - "mkdocs-material == 9.5.27", - "mkdocstrings[python] == 0.26.1", - "mkdocstrings-python == 1.11.1", + "mkdocs-macros-plugin == 1.3.7", + "mkdocs-material == 9.5.45", + "mkdocstrings[python] == 0.27.0", + "mkdocstrings-python == 1.12.2", "frequenz-repo-config[model] == 0.10.0", ] dev-mypy = [ "mypy == 1.9.0", - "types-Markdown == 3.6.0.20240316", + "types-Markdown == 3.7.0.20240822", # For checking the noxfile, docs/ script, and tests "frequenz-model-test[dev-mkdocs,dev-noxfile,dev-pytest]", ] dev-noxfile = [ - "nox == 2024.4.15", + "nox == 2024.10.9", "frequenz-repo-config[model] == 0.10.0", ] dev-pylint = [ @@ -78,8 +78,8 @@ dev-pylint = [ "frequenz-model-test[dev-mkdocs,dev-noxfile,dev-pytest]", ] dev-pytest = [ - "pytest == 8.2.2", - "pylint == 3.2.5", # We need this to check for the examples + "pytest == 8.3.3", + "pylint == 3.3.1", # We need this to check for the examples "frequenz-repo-config[extra-lint-examples] == 0.10.0", "pytest-mock == 3.14.0", "pytest-asyncio == 0.24.0", From 58c31fbeb8568b974177bfb3f89da4236b4765fb Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 20 Nov 2024 13:40:08 +0100 Subject: [PATCH 45/50] Split dependencies for app and actor/model Actors and models are libraries, so they should provide ranges of dependencies, but apps should always have their dependencies pinned. Signed-off-by: Leandro Lucarella --- .../{{cookiecutter.github_repo_name}}/pyproject.toml | 12 ++++++++++-- .../actor/frequenz-actor-test/pyproject.toml | 2 +- .../app/frequenz-app-test/pyproject.toml | 2 +- .../model/frequenz-model-test/pyproject.toml | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml index 9a42c784..8dbd7958 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml @@ -42,14 +42,22 @@ classifiers = [ ] requires-python = ">= 3.11, < 4" # TODO(cookiecutter): Remove and add more dependencies if appropriate -{%- if cookiecutter.type in ("app", "actor", "model") %} +{%- if cookiecutter.type in ("actor", "model") %} dependencies = [ - "typing-extensions == 4.12.2", + "typing-extensions >= 4.12.2, < 5", # Make sure to update the version for cross-referencing also in the # mkdocs.yml file when changing the version here (look for the config key # plugins.mkdocstrings.handlers.python.import) "frequenz-sdk >= 1.0.0rc1300, < 1.0.0rc1400", ] +{%- elif cookiecutter.type == "app" %} +dependencies = [ + "typing-extensions == 4.12.2", + # Make sure to update the version for cross-referencing also in the + # mkdocs.yml file when changing the version here (look for the config key + # plugins.mkdocstrings.handlers.python.import) + "frequenz-sdk == 1.0.0rc1300", +] {%- elif cookiecutter.type == "api" %} dependencies = [ "frequenz-api-common >= 0.6.2, < 0.7.0", diff --git a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml index fc8a8daf..632c2e77 100644 --- a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ requires-python = ">= 3.11, < 4" # TODO(cookiecutter): Remove and add more dependencies if appropriate dependencies = [ - "typing-extensions == 4.12.2", + "typing-extensions >= 4.12.2, < 5", # Make sure to update the version for cross-referencing also in the # mkdocs.yml file when changing the version here (look for the config key # plugins.mkdocstrings.handlers.python.import) diff --git a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml index d9d6efa2..5274acad 100644 --- a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml @@ -31,7 +31,7 @@ dependencies = [ # Make sure to update the version for cross-referencing also in the # mkdocs.yml file when changing the version here (look for the config key # plugins.mkdocstrings.handlers.python.import) - "frequenz-sdk >= 1.0.0rc1300, < 1.0.0rc1400", + "frequenz-sdk == 1.0.0rc1300", ] dynamic = ["version"] diff --git a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml index 37b5cc84..d0e4bef8 100644 --- a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ requires-python = ">= 3.11, < 4" # TODO(cookiecutter): Remove and add more dependencies if appropriate dependencies = [ - "typing-extensions == 4.12.2", + "typing-extensions >= 4.12.2, < 5", # Make sure to update the version for cross-referencing also in the # mkdocs.yml file when changing the version here (look for the config key # plugins.mkdocstrings.handlers.python.import) From 4b0113d89e5a980f481b7adbc550481d14d2376b Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 20 Nov 2024 13:20:11 +0100 Subject: [PATCH 46/50] Remove the redundant --platform from the Dockerfile Signed-off-by: Leandro Lucarella --- .github/containers/test-installation/Dockerfile | 2 +- RELEASE_NOTES.md | 1 + cookiecutter/migrate.py | 11 +++++++++++ .../.github/containers/test-installation/Dockerfile | 2 +- .../.github/containers/test-installation/Dockerfile | 2 +- .../.github/containers/test-installation/Dockerfile | 2 +- .../.github/containers/test-installation/Dockerfile | 2 +- .../.github/containers/test-installation/Dockerfile | 2 +- .../.github/containers/test-installation/Dockerfile | 2 +- 9 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/containers/test-installation/Dockerfile b/.github/containers/test-installation/Dockerfile index ac3de243..f053472d 100644 --- a/.github/containers/test-installation/Dockerfile +++ b/.github/containers/test-installation/Dockerfile @@ -4,7 +4,7 @@ # This Dockerfile is used to test the installation of the python package in # multiple platforms in the CI. It is not used to build the package itself. -FROM --platform=${TARGETPLATFORM} python:3.11-slim +FROM python:3.11-slim RUN apt-get update -y && \ apt-get install --no-install-recommends -y \ diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 043765dc..db41c642 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -28,6 +28,7 @@ * Added a new default option `asyncio_default_fixture_loop_scope = "function"` for `pytest-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 by `mypy` to avoid false positives. +* Remove the redundant `--platform` from the testing dockerfile. ## Bug Fixes diff --git a/cookiecutter/migrate.py b/cookiecutter/migrate.py index 1fdae3e5..de6f69aa 100644 --- a/cookiecutter/migrate.py +++ b/cookiecutter/migrate.py @@ -166,6 +166,17 @@ def main() -> None: # Add new pylint checks add_pylint_checks() + print("=" * 72) + + # Remove redundant --platform from the dockerfile + dockerfile = Path(".github/containers/test-installation/Dockerfile") + print(f"{dockerfile}: Removing redundant --platform.") + if dockerfile.is_file(): + replace_file_contents_atomically( + dockerfile, "--platform=${TARGETPLATFORM} ", "" + ) + else: + print(f"{dockerfile}: Not found.") # Add a separation line like this one after each migration step. print("=" * 72) diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/.github/containers/test-installation/Dockerfile b/cookiecutter/{{cookiecutter.github_repo_name}}/.github/containers/test-installation/Dockerfile index 6c408565..9357144d 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/.github/containers/test-installation/Dockerfile +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/.github/containers/test-installation/Dockerfile @@ -5,7 +5,7 @@ # This Dockerfile is used to test the installation of the python package in # multiple platforms in the CI. It is not used to build the package itself. -FROM --platform=${TARGETPLATFORM} python:3.11-slim +FROM python:3.11-slim RUN apt-get update -y && \ apt-get install --no-install-recommends -y \ diff --git a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/containers/test-installation/Dockerfile b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/containers/test-installation/Dockerfile index 6ca61423..d5e23993 100644 --- a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/containers/test-installation/Dockerfile +++ b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/.github/containers/test-installation/Dockerfile @@ -3,7 +3,7 @@ # This Dockerfile is used to test the installation of the python package in # multiple platforms in the CI. It is not used to build the package itself. -FROM --platform=${TARGETPLATFORM} python:3.11-slim +FROM python:3.11-slim RUN apt-get update -y && \ apt-get install --no-install-recommends -y \ diff --git a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/containers/test-installation/Dockerfile b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/containers/test-installation/Dockerfile index 6ca61423..d5e23993 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/containers/test-installation/Dockerfile +++ b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/.github/containers/test-installation/Dockerfile @@ -3,7 +3,7 @@ # This Dockerfile is used to test the installation of the python package in # multiple platforms in the CI. It is not used to build the package itself. -FROM --platform=${TARGETPLATFORM} python:3.11-slim +FROM python:3.11-slim RUN apt-get update -y && \ apt-get install --no-install-recommends -y \ diff --git a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/containers/test-installation/Dockerfile b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/containers/test-installation/Dockerfile index 6ca61423..d5e23993 100644 --- a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/containers/test-installation/Dockerfile +++ b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/.github/containers/test-installation/Dockerfile @@ -3,7 +3,7 @@ # This Dockerfile is used to test the installation of the python package in # multiple platforms in the CI. It is not used to build the package itself. -FROM --platform=${TARGETPLATFORM} python:3.11-slim +FROM python:3.11-slim RUN apt-get update -y && \ apt-get install --no-install-recommends -y \ diff --git a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/containers/test-installation/Dockerfile b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/containers/test-installation/Dockerfile index 6ca61423..d5e23993 100644 --- a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/containers/test-installation/Dockerfile +++ b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/.github/containers/test-installation/Dockerfile @@ -3,7 +3,7 @@ # This Dockerfile is used to test the installation of the python package in # multiple platforms in the CI. It is not used to build the package itself. -FROM --platform=${TARGETPLATFORM} python:3.11-slim +FROM python:3.11-slim RUN apt-get update -y && \ apt-get install --no-install-recommends -y \ diff --git a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/containers/test-installation/Dockerfile b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/containers/test-installation/Dockerfile index 6ca61423..d5e23993 100644 --- a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/containers/test-installation/Dockerfile +++ b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/.github/containers/test-installation/Dockerfile @@ -3,7 +3,7 @@ # This Dockerfile is used to test the installation of the python package in # multiple platforms in the CI. It is not used to build the package itself. -FROM --platform=${TARGETPLATFORM} python:3.11-slim +FROM python:3.11-slim RUN apt-get update -y && \ apt-get install --no-install-recommends -y \ From db7c18292077e3a22e30db5e96abca134599bc09 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 20 Nov 2024 13:53:02 +0100 Subject: [PATCH 47/50] Add missing migration step for `edit_uri` Signed-off-by: Leandro Lucarella --- cookiecutter/migrate.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cookiecutter/migrate.py b/cookiecutter/migrate.py index de6f69aa..8b5b2f67 100644 --- a/cookiecutter/migrate.py +++ b/cookiecutter/migrate.py @@ -177,6 +177,12 @@ def main() -> None: ) else: print(f"{dockerfile}: Not found.") + print("=" * 72) + + # Make sure `edit_uri` points to the default branch + manual_step( + "Make sure that the `edit_uri` in the `mkdocs.yml` file points to the default branch." + ) # Add a separation line like this one after each migration step. print("=" * 72) From ad98556991c3ae978874389bd346b83441c2b755 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 20 Nov 2024 13:54:17 +0100 Subject: [PATCH 48/50] Add missing migration step for the default fixture scope Signed-off-by: Leandro Lucarella --- cookiecutter/migrate.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/cookiecutter/migrate.py b/cookiecutter/migrate.py index 8b5b2f67..9ca36736 100644 --- a/cookiecutter/migrate.py +++ b/cookiecutter/migrate.py @@ -128,6 +128,32 @@ def add_pylint_checks() -> None: ) +def fix_default_fixture_scope() -> None: + """Fix the default scope of fixtures to 'function'.""" + pyproject_toml = Path("pyproject.toml") + print(f"{pyproject_toml}: Fix the default scope of fixtures to 'function'.") + marker = 'asyncio_mode = "auto"\n' + pyproject_toml_content = pyproject_toml.read_text(encoding="utf-8") + if pyproject_toml_content.find(marker) == -1: + manual_step( + f"""\ +{pyproject_toml}: We couldn't find the marker {marker!r} in the file. +Please add the following line to the file manually in the +`[tool.pytest.ini_options]` section if it is missing: +asyncio_default_fixture_loop_scope = "function" +""" + ) + return + + replacement = 'asyncio_default_fixture_loop_scope = "function"\n' + if pyproject_toml_content.find(replacement) >= 0: + print(f"{pyproject_toml}: seems to be already up-to-date.") + return + replace_file_contents_atomically( + pyproject_toml, marker, marker + replacement, content=pyproject_toml_content + ) + + def main() -> None: """Run the migration steps.""" # Dependabot patch @@ -183,6 +209,10 @@ def main() -> None: manual_step( "Make sure that the `edit_uri` in the `mkdocs.yml` file points to the default branch." ) + print("=" * 72) + + # Fix the default scope of fixtures to 'function' + fix_default_fixture_scope() # Add a separation line like this one after each migration step. print("=" * 72) From f44d0b79a77a7b0f6f106830b1c92e04476005b2 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 20 Nov 2024 13:32:05 +0100 Subject: [PATCH 49/50] Bump the repo-config dependency to 0.11.0 In preparation for the 0.11.0 release. Signed-off-by: Leandro Lucarella --- .../{{cookiecutter.github_repo_name}}/pyproject.toml | 8 ++++---- .../actor/frequenz-actor-test/pyproject.toml | 8 ++++---- .../api/frequenz-api-test/pyproject.toml | 8 ++++---- .../app/frequenz-app-test/pyproject.toml | 8 ++++---- .../lib/frequenz-test-python/pyproject.toml | 8 ++++---- .../model/frequenz-model-test/pyproject.toml | 8 ++++---- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml index 8dbd7958..2cdc06b1 100644 --- a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml +++ b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml @@ -5,7 +5,7 @@ requires = [ "setuptools == 75.5.0", "setuptools_scm[toml] == 8.1.0", - "frequenz-repo-config[{{cookiecutter.type}}] == 0.10.0", + "frequenz-repo-config[{{cookiecutter.type}}] == 0.11.0", {%- if cookiecutter.type == "api" %} # We need to pin the protobuf, grpcio and grpcio-tools dependencies to make # sure the code is generated using the minimum supported versions, as older @@ -101,7 +101,7 @@ dev-mkdocs = [ "mkdocs-material == 9.5.45", "mkdocstrings[python] == 0.27.0", "mkdocstrings-python == 1.12.2", - "frequenz-repo-config[{{cookiecutter.type}}] == 0.10.0", + "frequenz-repo-config[{{cookiecutter.type}}] == 0.11.0", ] dev-mypy = [ "mypy == 1.9.0", @@ -114,7 +114,7 @@ dev-mypy = [ ] dev-noxfile = [ "nox == 2024.10.9", - "frequenz-repo-config[{{cookiecutter.type}}] == 0.10.0", + "frequenz-repo-config[{{cookiecutter.type}}] == 0.11.0", ] dev-pylint = [ # dev-pytest already defines a dependency to pylint because of the examples @@ -124,7 +124,7 @@ dev-pylint = [ dev-pytest = [ "pytest == 8.3.3", "pylint == 3.3.1", # We need this to check for the examples - "frequenz-repo-config[extra-lint-examples] == 0.10.0", + "frequenz-repo-config[extra-lint-examples] == 0.11.0", {%- if cookiecutter.type != "api" %} "pytest-mock == 3.14.0", "pytest-asyncio == 0.24.0", diff --git a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml index 632c2e77..45a10a9c 100644 --- a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml @@ -5,7 +5,7 @@ requires = [ "setuptools == 75.5.0", "setuptools_scm[toml] == 8.1.0", - "frequenz-repo-config[actor] == 0.10.0", + "frequenz-repo-config[actor] == 0.11.0", ] build-backend = "setuptools.build_meta" @@ -60,7 +60,7 @@ dev-mkdocs = [ "mkdocs-material == 9.5.45", "mkdocstrings[python] == 0.27.0", "mkdocstrings-python == 1.12.2", - "frequenz-repo-config[actor] == 0.10.0", + "frequenz-repo-config[actor] == 0.11.0", ] dev-mypy = [ "mypy == 1.9.0", @@ -70,7 +70,7 @@ dev-mypy = [ ] dev-noxfile = [ "nox == 2024.10.9", - "frequenz-repo-config[actor] == 0.10.0", + "frequenz-repo-config[actor] == 0.11.0", ] dev-pylint = [ # dev-pytest already defines a dependency to pylint because of the examples @@ -80,7 +80,7 @@ dev-pylint = [ dev-pytest = [ "pytest == 8.3.3", "pylint == 3.3.1", # We need this to check for the examples - "frequenz-repo-config[extra-lint-examples] == 0.10.0", + "frequenz-repo-config[extra-lint-examples] == 0.11.0", "pytest-mock == 3.14.0", "pytest-asyncio == 0.24.0", "async-solipsism == 0.6", diff --git a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml index 07a7a5c1..b399b89f 100644 --- a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml @@ -5,7 +5,7 @@ requires = [ "setuptools == 75.5.0", "setuptools_scm[toml] == 8.1.0", - "frequenz-repo-config[api] == 0.10.0", + "frequenz-repo-config[api] == 0.11.0", # We need to pin the protobuf, grpcio and grpcio-tools dependencies to make # sure the code is generated using the minimum supported versions, as older # versions can't work with code that was generated with newer versions. @@ -71,7 +71,7 @@ dev-mkdocs = [ "mkdocs-material == 9.5.45", "mkdocstrings[python] == 0.27.0", "mkdocstrings-python == 1.12.2", - "frequenz-repo-config[api] == 0.10.0", + "frequenz-repo-config[api] == 0.11.0", ] dev-mypy = [ "mypy == 1.9.0", @@ -82,7 +82,7 @@ dev-mypy = [ ] dev-noxfile = [ "nox == 2024.10.9", - "frequenz-repo-config[api] == 0.10.0", + "frequenz-repo-config[api] == 0.11.0", ] dev-pylint = [ # dev-pytest already defines a dependency to pylint because of the examples @@ -92,7 +92,7 @@ dev-pylint = [ dev-pytest = [ "pytest == 8.3.3", "pylint == 3.3.1", # We need this to check for the examples - "frequenz-repo-config[extra-lint-examples] == 0.10.0", + "frequenz-repo-config[extra-lint-examples] == 0.11.0", ] dev = [ "frequenz-api-test[dev-mkdocs,dev-flake8,dev-formatting,dev-mkdocs,dev-mypy,dev-noxfile,dev-pylint,dev-pytest]", diff --git a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml index 5274acad..6f21a230 100644 --- a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml @@ -5,7 +5,7 @@ requires = [ "setuptools == 75.5.0", "setuptools_scm[toml] == 8.1.0", - "frequenz-repo-config[app] == 0.10.0", + "frequenz-repo-config[app] == 0.11.0", ] build-backend = "setuptools.build_meta" @@ -59,7 +59,7 @@ dev-mkdocs = [ "mkdocs-material == 9.5.45", "mkdocstrings[python] == 0.27.0", "mkdocstrings-python == 1.12.2", - "frequenz-repo-config[app] == 0.10.0", + "frequenz-repo-config[app] == 0.11.0", ] dev-mypy = [ "mypy == 1.9.0", @@ -69,7 +69,7 @@ dev-mypy = [ ] dev-noxfile = [ "nox == 2024.10.9", - "frequenz-repo-config[app] == 0.10.0", + "frequenz-repo-config[app] == 0.11.0", ] dev-pylint = [ # dev-pytest already defines a dependency to pylint because of the examples @@ -79,7 +79,7 @@ dev-pylint = [ dev-pytest = [ "pytest == 8.3.3", "pylint == 3.3.1", # We need this to check for the examples - "frequenz-repo-config[extra-lint-examples] == 0.10.0", + "frequenz-repo-config[extra-lint-examples] == 0.11.0", "pytest-mock == 3.14.0", "pytest-asyncio == 0.24.0", "async-solipsism == 0.6", diff --git a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml index 9b3dbc77..a2c6979b 100644 --- a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml @@ -5,7 +5,7 @@ requires = [ "setuptools == 75.5.0", "setuptools_scm[toml] == 8.1.0", - "frequenz-repo-config[lib] == 0.10.0", + "frequenz-repo-config[lib] == 0.11.0", ] build-backend = "setuptools.build_meta" @@ -56,7 +56,7 @@ dev-mkdocs = [ "mkdocs-material == 9.5.45", "mkdocstrings[python] == 0.27.0", "mkdocstrings-python == 1.12.2", - "frequenz-repo-config[lib] == 0.10.0", + "frequenz-repo-config[lib] == 0.11.0", ] dev-mypy = [ "mypy == 1.9.0", @@ -66,7 +66,7 @@ dev-mypy = [ ] dev-noxfile = [ "nox == 2024.10.9", - "frequenz-repo-config[lib] == 0.10.0", + "frequenz-repo-config[lib] == 0.11.0", ] dev-pylint = [ # dev-pytest already defines a dependency to pylint because of the examples @@ -76,7 +76,7 @@ dev-pylint = [ dev-pytest = [ "pytest == 8.3.3", "pylint == 3.3.1", # We need this to check for the examples - "frequenz-repo-config[extra-lint-examples] == 0.10.0", + "frequenz-repo-config[extra-lint-examples] == 0.11.0", "pytest-mock == 3.14.0", "pytest-asyncio == 0.24.0", "async-solipsism == 0.6", diff --git a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml index d0e4bef8..6e4410d0 100644 --- a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml +++ b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml @@ -5,7 +5,7 @@ requires = [ "setuptools == 75.5.0", "setuptools_scm[toml] == 8.1.0", - "frequenz-repo-config[model] == 0.10.0", + "frequenz-repo-config[model] == 0.11.0", ] build-backend = "setuptools.build_meta" @@ -60,7 +60,7 @@ dev-mkdocs = [ "mkdocs-material == 9.5.45", "mkdocstrings[python] == 0.27.0", "mkdocstrings-python == 1.12.2", - "frequenz-repo-config[model] == 0.10.0", + "frequenz-repo-config[model] == 0.11.0", ] dev-mypy = [ "mypy == 1.9.0", @@ -70,7 +70,7 @@ dev-mypy = [ ] dev-noxfile = [ "nox == 2024.10.9", - "frequenz-repo-config[model] == 0.10.0", + "frequenz-repo-config[model] == 0.11.0", ] dev-pylint = [ # dev-pytest already defines a dependency to pylint because of the examples @@ -80,7 +80,7 @@ dev-pylint = [ dev-pytest = [ "pytest == 8.3.3", "pylint == 3.3.1", # We need this to check for the examples - "frequenz-repo-config[extra-lint-examples] == 0.10.0", + "frequenz-repo-config[extra-lint-examples] == 0.11.0", "pytest-mock == 3.14.0", "pytest-asyncio == 0.24.0", "async-solipsism == 0.6", From 10676e3c5b596b26ab3d9cb59ec348b61c0eab5b Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 20 Nov 2024 13:45:28 +0100 Subject: [PATCH 50/50] Update release notes for the release of v0.11.0 Signed-off-by: Leandro Lucarella --- RELEASE_NOTES.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index db41c642..d5242cb3 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -2,17 +2,15 @@ ## 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 - - - ## New Features * Added a new GitHub branch ruleset for Rust projects. @@ -33,7 +31,3 @@ ## Bug Fixes * Sybil now parses the `__init__.py` file as well. Previously it was disabled due to an upstream bug. - -### Cookiecutter template - -