From 7aa5fa4b727741c6a42a3cd3bbf92c9e7ce5c6a9 Mon Sep 17 00:00:00 2001 From: Lee Chapman Date: Sun, 11 Jan 2026 10:57:22 -0800 Subject: [PATCH] fix: add build target to Makefile and use make build in CI Add 'build' target to Makefile that builds the Python package using python -m build. This allows CI to use 'make build' as intended. Changes: - Add 'build' target to Makefile (cleans and builds package) - Update .gitlab-ci.yml to use 'make build' instead of 'python -m build' - Add 'make' package back to CI dependencies - Update help text to include build target --- .gitlab-ci.yml | 4 ++-- Makefile | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 096118d..17fda9b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,9 +13,9 @@ build: stage: build image: harbor.dataknife.net/dockerhub/library/python:3.14-slim script: - - apt-get update && apt-get install -y --no-install-recommends git build-essential + - apt-get update && apt-get install -y --no-install-recommends make git build-essential - pip install --upgrade pip build - - python -m build + - make build artifacts: paths: - dist/ diff --git a/Makefile b/Makefile index cfd1d07..b58bede 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: help install dev test lint format clean docker-build docker-login docker-push docker-pull docker-run run check check-all commit-changes release venv +.PHONY: help install dev test lint format clean build docker-build docker-login docker-push docker-pull docker-run run check check-all commit-changes release venv # Force use of bash shell (required for make to work properly with line continuations) SHELL := /bin/bash @@ -67,6 +67,10 @@ format: $(BLACK) src tests $(RUFF) check --fix src tests +build: clean + pip install --upgrade pip build + python -m build + clean: find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true find . -type f -name "*.pyc" -delete