Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update repo-config to v0.10.0 #146

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/containers/test-installation/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,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
41 changes: 40 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Setup Git
uses: frequenz-floss/[email protected]
# with:
# username: ${{ secrets.GIT_USER }}
# password: ${{ secrets.GIT_PASS }}

- name: Print environment (debug)
run: env

Expand Down Expand Up @@ -152,6 +158,12 @@ jobs:
needs: ["build"]
runs-on: ubuntu-20.04
steps:
- name: Setup Git
uses: frequenz-floss/[email protected]
# with:
# username: ${{ secrets.GIT_USER }}
# password: ${{ secrets.GIT_PASS }}

- name: Fetch sources
uses: actions/checkout@v4
- name: Download package
Expand All @@ -177,6 +189,12 @@ jobs:
if: github.event_name != 'push'
runs-on: ubuntu-20.04
steps:
- name: Setup Git
uses: frequenz-floss/[email protected]
# with:
# username: ${{ secrets.GIT_USER }}
# password: ${{ secrets.GIT_PASS }}

- name: Fetch sources
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -340,11 +358,32 @@ jobs:
# https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/
id-token: write
steps:
- name: Download distribution files
- name: Setup Git
uses: frequenz-floss/[email protected]
# 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: Publish the Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- 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
2 changes: 2 additions & 0 deletions .github/workflows/release-notes-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
5 changes: 1 addition & 4 deletions docs/_scripts/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ def _slugify(text: str) -> str:
Returns:
The slugified text.
"""
# The type of the return value is not defined for the markdown library.
# Also for some reason `mypy` thinks the `toc` module doesn't have a
# `slugify_unicode` function, but it definitely does.
return toc.slugify_unicode(text, "-") # type: ignore[attr-defined,no-any-return]
return toc.slugify_unicode(text, "-")


def _hook_macros_plugin(env: macros.MacrosPlugin) -> None:
Expand Down
3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ plugins:
- literate-nav:
nav_file: SUMMARY.md
- mike:
alias_type: redirect
alias_type: symlink
canonical_version: latest
- mkdocstrings:
default_handler: python
Expand All @@ -110,6 +110,7 @@ plugins:
show_root_members_full_path: true
show_signature_annotations: true
show_source: true
show_symbol_type_toc: true
signature_crossrefs: true
import:
# See https://mkdocstrings.github.io/python/usage/#import for details
Expand Down
19 changes: 13 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
requires = [
"setuptools == 68.1.0",
"setuptools_scm[toml] == 7.1.0",
"frequenz-repo-config[api] == 0.9.2",
"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.
Expand Down Expand Up @@ -66,26 +66,27 @@ dev-flake8 = [
dev-formatting = ["black == 24.4.2", "isort == 5.12.0"]
dev-mkdocs = [
"black == 24.4.2",
"Markdown==3.4.4",
"Markdown==3.7",
"mike == 2.0.0",
"mkdocs-gen-files == 0.5.0",
"mkdocs-literate-nav == 0.6.1",
"mkdocs-macros-plugin == 1.0.4",
"mkdocs-material == 9.4.4",
"mkdocstrings[python] == 0.25.0",
"mkdocstrings-python == 1.9.2",
"mkdocstrings-python == 1.10.8",
"frequenz-repo-config[api] == 0.9.2",
"frequenz-repo-config[api] == 0.10.0",
]
dev-mypy = [
"mypy == 1.5.1",
"grpc-stubs == 1.53.0.5",
"types-Markdown == 3.4.2.10",
"types-Markdown == 3.7.0.20241204",
# For checking the noxfile, docs/ script, and tests
"frequenz-api-weather[dev-mkdocs,dev-noxfile,dev-pytest]",
]
dev-noxfile = [
"nox == 2024.4.15",
"frequenz-repo-config[api] == 0.9.2",
"frequenz-repo-config[api] == 0.10.0",
]
dev-pylint = [
"pylint == 3.0.2",
Expand All @@ -94,7 +95,7 @@ dev-pylint = [
]
dev-pytest = [
"pytest == 8.3.3",
"frequenz-repo-config[extra-lint-examples] == 0.9.2",
"frequenz-repo-config[extra-lint-examples] == 0.10.0",
]
dev = [
"frequenz-api-weather[dev-mkdocs,dev-flake8,dev-formatting,dev-mkdocs,dev-mypy,dev-noxfile,dev-pylint,dev-pytest]",
Expand Down Expand Up @@ -132,6 +133,7 @@ check-yield-types = false
arg-type-hints-in-docstring = false
arg-type-hints-in-signature = true
allow-init-docstring = true
check-class-attributes = false

[tool.pylint.similarities]
ignore-comments = ['yes']
Expand All @@ -149,17 +151,22 @@ 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",
# Checked by mypy
"no-member",
# Checked by flake8
"f-string-without-interpolation",
"redefined-outer-name",
"unused-import",
"line-too-long",
"missing-function-docstring",
"unused-variable",
"unnecessary-lambda-assignment",
# Checked by mypy
"no-member",
]

[tool.pytest.ini_options]
asyncio_default_fixture_loop_scope = "function"
testpaths = ["tests"]

[tool.mypy]
Expand Down