Skip to content

Commit

Permalink
Update repo-config to v10.0.0
Browse files Browse the repository at this point in the history
Signed-off-by: Talwinder Singh <[email protected]>
  • Loading branch information
TalweSingh committed Feb 10, 2025
1 parent 940f7b8 commit f212457
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 11 deletions.
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
47 changes: 45 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- name: Setup Git
uses: frequenz-floss/[email protected]
# TODO(cookiecutter): Uncomment this for projects with private dependencies
# with:
# username: ${{ secrets.GIT_USER }}
# password: ${{ secrets.GIT_PASS }}

- name: Print environment (debug)
run: env

Expand Down Expand Up @@ -152,6 +159,13 @@ jobs:
needs: ["build"]
runs-on: ubuntu-20.04
steps:
- name: Setup Git
uses: frequenz-floss/[email protected]
# 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
Expand All @@ -177,6 +191,13 @@ jobs:
if: github.event_name != 'push'
runs-on: ubuntu-20.04
steps:
- name: Setup Git
uses: frequenz-floss/[email protected]
# 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:
Expand Down Expand Up @@ -340,11 +361,33 @@ jobs:
# https://blog.pypi.org/posts/2023-04-20-introducing-trusted-publishers/
id-token: write
steps:
- name: Download distribution files
uses: actions/download-artifact@v3
- name: Setup Git
uses: frequenz-floss/[email protected]
# 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: 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
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,21 @@ 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",
]
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]",
]
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,10 +151,14 @@ 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
Expand Down

0 comments on commit f212457

Please sign in to comment.