1
0
mirror of https://github.com/containers/ramalama.git synced 2026-02-05 06:46:39 +01:00

ci: run type checking

Add a "make type-check" Makefile target, and run it as part of the CI workflow.

Add a couple extra depedencies to enable type checking for yaml and jsonschema.

Signed-off-by: Mike Bonnet <mikeb@redhat.com>
This commit is contained in:
Mike Bonnet
2025-10-28 16:57:27 -07:00
parent 499b2bc7e2
commit 5fd9c4f750
3 changed files with 12 additions and 2 deletions

View File

@@ -36,6 +36,10 @@ jobs:
run: |
uv run -- make man-check
- name: Run type checking
run: |
uv run -- make type-check
build-image:
runs-on: ubuntu-24.04
timeout-minutes: 60

View File

@@ -10,7 +10,7 @@ PATH := $(PATH):$(HOME)/.local/bin
MYPIP ?= pip
IMAGE ?= ramalama
PROJECT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
EXCLUDE_DIRS := .venv venv .tox
EXCLUDE_DIRS := .venv venv .tox build
EXCLUDE_OPTS := $(addprefix --exclude-dir=,$(EXCLUDE_DIRS))
PYTHON_SCRIPTS := $(shell grep -lEr "^\#\!\s*/usr/bin/(env +)?python(3)?(\s|$$)" $(EXCLUDE_OPTS) $(PROJECT_DIR) || true)
BATS_IMAGE ?= localhost/bats:latest
@@ -146,8 +146,12 @@ ifeq ($(OS),Linux)
hack/xref-helpmsgs-manpages
endif
.PHONY: type-check
type-check:
mypy $(addprefix --exclude=,$(EXCLUDE_DIRS)) --exclude test $(PROJECT_DIR)
.PHONY: validate
validate: codespell lint check-format man-check
validate: codespell lint check-format man-check type-check
.PHONY: pypi-build
pypi-build: clean

View File

@@ -65,6 +65,8 @@ dev = [
"pytest~=8.3",
"wheel~=0.45.0",
"mypy",
"types-PyYAML",
"types-jsonschema",
"tox"
]