Skip to content

Commit

Permalink
Update to repo-config v0.7.1 (#223)
Browse files Browse the repository at this point in the history
- ci: Add extra debug information.
- ci: Add meta-jobs (`nox-all` and `nox-cross-arch-all`) to be able to
require them in branch protection rules so we don't have to update the
protection rules each time we add or remove a job from the matrix.
- ci: Add support for cross-arch testing, including testing in arm64.
- ci: Ignore dependabot pushes (they are tested via the PR).
- ci: Run `nox` sessions concurrently to speed up tests.
- ci: Test installation of the package in different platforms.
- dependabot: Update dependencies in groups, so we get only one PR to
update multiple dependencies.
- dependabot: Update dependencies monthly instead of daily.
- docs: Add a few handy `mkdocs`/`markdown` extensions.
- docs: Add `mkdocs-macros-plugin` to be able to use macros in the
documentation.
- docs: Fix formatting of mermaid diagrams.
- docs: Move some support files for the documentation website to names
starting with `_` to make it more clear they are only support files.
- docs: Replace the `mkdocs-section-index` plugin (which has caused
problems in the past) with the `mkdocs-material` built-in
`navigation.indexes` feature.
- docs: Show inherited class members in the documentation.
- docs: Use a custom style to show code annotation numbers for better
ordering.
- docs: Use the new documentation website versioning scheme. This means
now multiple development branches are exposed, as well as pre-releases.
Also the order of the versions is improved. The `next` version is
replaced by the multiple `vX.Y-dev` versions.
- nox: Add a `flake8` session, mainly needed to run `pydocstyle` but
also use it to run `pycodestyle` and `flake8` regular checks. `flake8`
is much faster than `pylint`, so when there are conflicting checks we
prefer `flake8`.
- nox: Replace `darglint` with `pydoclint`.
- Remove unnecessary fields from the cookiecutter replay file.
- Unify some `pyproject.toml` options and move other tool options (like
`mypy`) to this file.
- Remove types from the docs
- Remove empty lines between docstrings and code
- Remove double comment char (`#`)
- Fix arguments documentation
- Add missing `Yields` section to the documentation
- Add missing `Returns` section to `consume()`
- Ignore `Raises` sections without explicit `raise` statements
- Remove obsolete `darglint` ignore directives
  • Loading branch information
christianparpart authored Nov 1, 2023
2 parents 40ab70c + a15edb2 commit 1dab247
Show file tree
Hide file tree
Showing 30 changed files with 620 additions and 150 deletions.
3 changes: 1 addition & 2 deletions .cookiecutter-replay.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"python_package": "frequenz.channels",
"pypi_package_name": "frequenz-channels",
"github_repo_name": "frequenz-channels-python",
"default_codeowners": "@frequenz-floss/python-sdk-team",
"_template": "gh:frequenz-floss/frequenz-repo-config-python"
"default_codeowners": "@frequenz-floss/python-sdk-team"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# License: MIT
# Copyright © 2023 Frequenz Energy-as-a-Service GmbH
# This Dockerfile is used to run the tests in architectures not supported by
# GitHub Actions.

FROM docker.io/library/ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive

# Install Python 3.11 and curl to install pip later
RUN apt-get update -y && \
apt-get install --no-install-recommends -y \
software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get install --no-install-recommends -y \
ca-certificates \
curl \
git \
python3.11 \
python3.11-distutils && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install pip
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11

RUN update-alternatives --install \
/usr/local/bin/python python /usr/bin/python3.11 1 && \
python -m pip install --upgrade --no-cache-dir pip

COPY entrypoint.bash /usr/bin/entrypoint.bash

ENTRYPOINT ["/usr/bin/entrypoint.bash"]
9 changes: 9 additions & 0 deletions .github/containers/nox-cross-arch/entrypoint.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
# License: MIT
# Copyright © 2023 Frequenz Energy-as-a-Service GmbH
set -e

echo "System details:" $(uname -a)
echo "Machine:" $(uname -m)

exec "$@"
12 changes: 12 additions & 0 deletions .github/containers/test-installation/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# License: MIT
# Copyright © 2023 Frequenz Energy-as-a-Service GmbH
# 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

RUN python -m pip install --upgrade --no-cache-dir pip

COPY dist dist
RUN pip install dist/*.whl && \
rm -rf dist
25 changes: 21 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
time: "07:00"
interval: "monthly"
day: "thursday"
labels:
- "part:tooling"
- "type:tech-debt"
Expand All @@ -13,12 +13,29 @@ updates:
versioning-strategy: auto
# Allow up to 10 open pull requests for updates to dependency versions
open-pull-requests-limit: 10
# We group production and development ("optional" in the context of
# pyproject.toml) dependency updates when they are patch and minor updates,
# so we end up with less PRs being generated.
# Major updates are still managed, but they'll create one PR per
# dependency, as major updates are expected to be breaking, it is better to
# manage them individually.
groups:
required:
dependency-type: "production"
update-types:
- "minor"
- "patch"
optional:
dependency-type: "development"
update-types:
- "minor"
- "patch"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "06:00"
interval: "monthly"
day: "thursday"
labels:
- "part:tooling"
- "type:tech-debt"
Loading

0 comments on commit 1dab247

Please sign in to comment.