diff --git a/.github/workflows/auto-dependabot.yaml b/.github/workflows/auto-dependabot.yaml new file mode 100644 index 0000000..d3f5aa1 --- /dev/null +++ b/.github/workflows/auto-dependabot.yaml @@ -0,0 +1,40 @@ +name: Auto-merge Dependabot PR + +on: + # XXX: !!! SECURITY WARNING !!! + # pull_request_target has write access to the repo, and can read secrets. We + # need to audit any external actions executed in this workflow and make sure no + # checked out code is run (not even installing dependencies, as installing + # dependencies usually can execute pre/post-install scripts). We should also + # only use hashes to pick the action to execute (instead of tags or branches). + # For more details read: + # https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ + pull_request_target: + +permissions: + contents: read + pull-requests: write + +jobs: + auto-merge: + name: Auto-merge Dependabot PR + if: > + github.actor == 'dependabot[bot]' && + !contains(github.event.pull_request.title, 'the repo-config group') + runs-on: ubuntu-slim + steps: + - name: Generate GitHub App token + id: app-token + uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 + with: + app-id: ${{ secrets.FREQUENZ_AUTO_DEPENDABOT_APP_ID }} + private-key: ${{ secrets.FREQUENZ_AUTO_DEPENDABOT_APP_PRIVATE_KEY }} + + - name: Auto-merge Dependabot PR + uses: frequenz-floss/dependabot-auto-approve@e943399cc9d76fbb6d7faae446cd57301d110165 # v1.5.0 + with: + github-token: ${{ steps.app-token.outputs.token }} + dependency-type: 'all' + auto-merge: 'true' + merge-method: 'merge' + add-label: 'tool:auto-merged' diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index cdc37b6..a93bef0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -28,11 +28,9 @@ jobs: strategy: fail-fast: false matrix: - arch: - - amd64 - - arm - os: + platform: - ubuntu-24.04 + - ubuntu-24.04-arm python: - "3.11" - "3.12" @@ -41,7 +39,7 @@ jobs: # that uses the same venv to run multiple linting sessions - "ci_checks_max" - "pytest_min" - runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }} + runs-on: ${{ matrix.platform }} steps: - name: Run nox @@ -63,7 +61,7 @@ jobs: needs: ["nox"] # We skip this job only if nox was also skipped if: always() && needs.nox.result != 'skipped' - runs-on: ubuntu-24.04 + runs-on: ubuntu-slim env: DEPS_RESULT: ${{ needs.nox.result }} steps: @@ -112,15 +110,13 @@ jobs: strategy: fail-fast: false matrix: - arch: - - amd64 - - arm - os: + platform: - ubuntu-24.04 + - ubuntu-24.04-arm python: - "3.11" - "3.12" - runs-on: ${{ matrix.os }}${{ matrix.arch != 'amd64' && format('-{0}', matrix.arch) || '' }} + runs-on: ${{ matrix.platform }} steps: - name: Setup Git @@ -172,7 +168,7 @@ jobs: needs: ["test-installation"] # We skip this job only if test-installation was also skipped if: always() && needs.test-installation.result != 'skipped' - runs-on: ubuntu-24.04 + runs-on: ubuntu-slim env: DEPS_RESULT: ${{ needs.test-installation.result }} steps: @@ -295,7 +291,7 @@ jobs: # discussions to create the release announcement in the discussion forums contents: write discussions: write - runs-on: ubuntu-24.04 + runs-on: ubuntu-slim steps: - name: Download distribution files uses: actions/download-artifact@v8 diff --git a/.github/workflows/dco-merge-queue.yml b/.github/workflows/dco-merge-queue.yml index fb1cd90..d9597ad 100644 --- a/.github/workflows/dco-merge-queue.yml +++ b/.github/workflows/dco-merge-queue.yml @@ -5,7 +5,7 @@ on: jobs: DCO: - runs-on: ubuntu-latest + runs-on: ubuntu-slim if: ${{ github.actor != 'dependabot[bot]' }} steps: - run: echo "This DCO job runs on merge_queue event and doesn't check PR contents" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 8d02c13..c327e7f 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -7,7 +7,7 @@ jobs: permissions: contents: read pull-requests: write - runs-on: ubuntu-latest + runs-on: ubuntu-slim steps: - name: Labeler # XXX: !!! SECURITY WARNING !!! diff --git a/.github/workflows/release-notes-check.yml b/.github/workflows/release-notes-check.yml index 9f7ee31..545d537 100644 --- a/.github/workflows/release-notes-check.yml +++ b/.github/workflows/release-notes-check.yml @@ -16,7 +16,7 @@ on: jobs: check-release-notes: name: Check release notes are updated - runs-on: ubuntu-latest + runs-on: ubuntu-slim permissions: pull-requests: read steps: diff --git a/mkdocs.yml b/mkdocs.yml index 9383fc4..f520d2d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -103,8 +103,8 @@ plugins: default_handler: python handlers: python: + paths: ["src"] options: - paths: ["src"] docstring_section_style: spacy inherited_members: true merge_init_into_class: false @@ -116,7 +116,7 @@ plugins: show_source: true show_symbol_type_toc: true signature_crossrefs: true - import: + inventories: # 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 diff --git a/pyproject.toml b/pyproject.toml index 8f6b62c..fb5974d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ requires = [ "setuptools == 80.10.1", "setuptools_scm[toml] == 9.2.2", - "frequenz-repo-config[lib] == 0.13.7", + "frequenz-repo-config[lib] == 0.16.0", ] build-backend = "setuptools.build_meta" @@ -13,12 +13,12 @@ build-backend = "setuptools.build_meta" name = "frequenz-gridpool" description = "High-level interface to grid pools for the Frequenz platform." readme = "README.md" -license = { text = "MIT" } +license = "MIT" +license-files = ["LICENSE"] keywords = ["frequenz", "python", "lib", "library", "gridpool"] classifiers = [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Libraries", @@ -49,6 +49,7 @@ render-graph = [ dev-flake8 = [ "flake8 == 7.3.0", + "flake8-datetimez == 20.10.0", "flake8-docstrings == 1.7.0", "flake8-pyproject == 1.2.4", # For reading the flake8 config from pyproject.toml "pydoclint == 0.8.3", @@ -65,7 +66,7 @@ dev-mkdocs = [ "mkdocs-material == 9.7.3", "mkdocstrings[python] == 1.0.3", "mkdocstrings-python == 1.19.0", - "frequenz-repo-config[lib] == 0.13.7", + "frequenz-repo-config[lib] == 0.16.0", ] dev-mypy = [ "mypy == 1.19.1", @@ -76,7 +77,7 @@ dev-mypy = [ ] dev-noxfile = [ "nox == 2025.11.12", - "frequenz-repo-config[lib] == 0.13.7", + "frequenz-repo-config[lib] == 0.16.0", ] dev-pylint = [ # dev-pytest already defines a dependency to pylint because of the examples @@ -86,7 +87,7 @@ dev-pylint = [ dev-pytest = [ "pytest == 9.0.2", "pylint == 4.0.5", # We need this to check for the examples - "frequenz-repo-config[extra-lint-examples] == 0.13.7", + "frequenz-repo-config[extra-lint-examples] == 0.16.0", "pytest-mock == 3.15.1", "pytest-asyncio == 1.3.0", "async-solipsism == 0.9",