Skip to content
Open
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
12 changes: 6 additions & 6 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[flake8]
ignore=
E123,E125,E731,E722,W503,W605, # Black takes care of these
D202, # no blank lines after docstring
D203, # blank line before class docstring
D212, # multi-line summary starts at first line
D401, # imperitive mood
D413, # blank line after last section
E123,E125,E731,E722,W503,W605,
D202,
D203,
D212,
D401,
D413
max-line-length=110
docstring-convention=numpy
select=E,W,F
12 changes: 6 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ jobs:
)
)
steps:
- uses: actions/checkout@v2
- name: Setup Python 3.8
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- name: Setup Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: 3.11

- name: Echo manual trigger params
if: github.event_name == 'workflow_dispatch'
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
fail-fast: false
name: Build ${{ matrix.benchmark }} on ${{ matrix.arch }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Echo Matrix Permutation
run: |
cat << EOF
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
fail-fast: false
name: Push Manifest ${{ matrix.image_name }}:${{ matrix.tag }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Echo Matrix Permutation
run: |
cat << EOF
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
pyver: [6, 7, 8, 9]
pyver: [11, 12]
name: Run Doc Tests -- Python 3.${{ matrix.pyver }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install build dependencies
run: sudo apt-get install -y pandoc
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: 3.${{ matrix.pyver }}
- name: Install tox
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
pyver: [6, 7, 8, 9]
pyver: [11, 12]
name: Run Unit Tests -- Python 3.${{ matrix.pyver }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.${{ matrix.pyver }}
- name: Install tox
run: pip install tox
- name: Run Tox
run: tox -e py3${{ matrix.pyver }}-unit
- name: Generate coverage report
if: matrix.pyver == 6
if: matrix.pyver == 11
run: tox -e coverage
- name: Upload coverage report
if: matrix.pyver == 6
if: matrix.pyver == 11
uses: codecov/codecov-action@v1
with:
files: ./coverage.xml
Expand Down
18 changes: 9 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
repos:
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.3.1
rev: v1.5.5
hooks:
- id: remove-tabs

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: check-merge-conflict
Expand All @@ -16,14 +16,13 @@ repos:
- id: check-ast

- repo: https://github.com/psf/black
rev: 22.10.0
rev: 25.1.0
hooks:
- id: black
args: ['--line-length', '110']
additional_dependencies: ['click==8.0.4']

- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 6.0.1
hooks:
- id: isort
args:
Expand All @@ -32,18 +31,18 @@ repos:
- --line-length=110

- repo: https://github.com/PyCQA/flake8
rev: '5.0.4'
rev: '7.3.0'
hooks:
- id: flake8
additional_dependencies: ['pep8-naming', 'flake8-docstrings']

- repo: https://github.com/PyCQA/pylint
rev: v2.15.5
rev: v3.3.8
hooks:
- id: pylint

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.982
rev: v1.17.1
hooks:
- id: mypy
additional_dependencies:
Expand All @@ -57,9 +56,10 @@ repos:
- --no-strict-optional

- repo: https://github.com/asottile/pyupgrade
rev: v3.2.0
rev: v3.20.0
hooks:
- id: pyupgrade
args: [--py311-plus]

ci:
autofix_commit_msg: |
Expand Down
20 changes: 10 additions & 10 deletions ci/build_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
import re
import shlex
import subprocess
from typing import Dict, Iterable, List, Set, Union
from collections.abc import Iterable

ARCHS = (
"amd64",
Expand Down Expand Up @@ -108,7 +108,7 @@ def get_git_diff(upstream_branch: str) -> str:
return completed_process.stdout.decode("utf-8")


def parse_git_diff(diff_str: str) -> Set[str]:
def parse_git_diff(diff_str: str) -> set[str]:
"""
Return parsed output of `git-diff --name-only`.

Expand Down Expand Up @@ -142,7 +142,7 @@ def get_dockerfile_list() -> str:
return completed_process.stdout.decode("utf-8")


def parse_dockerfile_list(df_list: str) -> Set[str]:
def parse_dockerfile_list(df_list: str) -> set[str]:
"""
Parse given list of Dockerfiles into a set of str.

Expand Down Expand Up @@ -220,7 +220,7 @@ def new(cls, dockerfile: str, changed: bool, archs: Iterable[str], tags: Iterabl
tags=tags,
)

def build_json(self) -> Iterable[Dict[str, Union[str, bool]]]:
def build_json(self) -> Iterable[dict[str, str | bool]]:
"""Convert the given MatrixEntry into series of JSON-dicts, one for each arch."""

for arch in self.archs:
Expand All @@ -236,7 +236,7 @@ def build_json(self) -> Iterable[Dict[str, Union[str, bool]]]:
"tags": " ".join([f"{tag}{tag_suffix}" for tag in self.tags]),
}

def manifest_json(self) -> Iterable[Dict[str, Union[str, bool]]]:
def manifest_json(self) -> Iterable[dict[str, str | bool]]:
"""Convert the given MatrixEntry into series of JSON-dicts, one for each tag."""

for tag in self.tags:
Expand Down Expand Up @@ -274,14 +274,14 @@ class MatrixBuilder:
Set of changed files within the snafu repository.
"""

def __init__(
def __init__( # pylint: disable=too-many-positional-arguments
self,
archs: Iterable[str],
tags: Iterable[str],
bones: Iterable[str],
upstream_branch: str,
dockerfile_set: Set[str],
changed_set: Set[str],
dockerfile_set: set[str],
changed_set: set[str],
):
"""Contsruct the matrix builder."""

Expand All @@ -291,8 +291,8 @@ def __init__(
self.upstream_branch = upstream_branch
self.dockerfile_set = dockerfile_set
self.changed_set = changed_set
self.manifest_matrix: Dict[str, List[Dict[str, Union[str, bool]]]] = {}
self.build_matrix: Dict[str, List[Dict[str, Union[str, bool]]]] = {}
self.manifest_matrix: dict[str, list[dict[str, str | bool]]] = {}
self.build_matrix: dict[str, list[dict[str, str | bool]]] = {}

self.reset()

Expand Down
Loading
Loading