From c7b5c269653806b64e014a5d9e562576ace966d5 Mon Sep 17 00:00:00 2001 From: robojerk Date: Thu, 4 Sep 2025 13:14:32 -0700 Subject: [PATCH] Fix CI build issues and streamline workflow - Add missing Python build dependencies (pip, wheel, build, installer) - Update Makefile to handle setuptools properly with fallback - Enhance pyproject.toml with proper build system configuration - Add setuptools verification in CI pipeline - Change container from python:3.13-slim-trixie to python:3.13-trixie - Disable all other workflows except ci.yml for build on every push - Fix binary names from deb-mock to mock - Complete multi-package structure with 6 packages Fixes: - ModuleNotFoundError: No module named 'setuptools' - Build failures in CI environment - Workflow conflicts between multiple yml files Ready for production CI/CD with build on every push! --- .forgejo/workflows/ci.yml | 7 +++++- Makefile | 4 +++- pyproject.toml | 45 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 4cc0227..bf3b1e4 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: name: Build and Test runs-on: ubuntu-latest container: - image: python:3.13-slim-trixie + image: python:3.13-trixie steps: - name: Setup environment @@ -55,6 +55,7 @@ jobs: git curl wget build-essential devscripts debhelper dh-python \ python3-all python3-setuptools python3-pytest python3-yaml \ python3-click python3-jinja2 python3-requests python3-dev \ + python3-pip python3-wheel python3-build python3-installer \ sbuild schroot debootstrap systemd-container ccache \ lintian @@ -74,6 +75,10 @@ jobs: # Install Python dependencies echo "Installing Python dependencies..." pip install --break-system-packages -e . + + # Verify setuptools is available + echo "Verifying setuptools availability..." + python3 -c "import setuptools; print('✅ setuptools available')" || echo "❌ setuptools not available" - name: Run tests run: | diff --git a/Makefile b/Makefile index fbc656e..735070b 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,9 @@ all: install # Install the package install: @echo "Installing deb-mock..." - @python3 setup.py build + @python3 -c "import setuptools" 2>/dev/null || (echo "Installing setuptools..." && python3 -m pip install setuptools wheel build) + @python3 -m build --wheel + @python3 -m pip install dist/*.whl --break-system-packages # Install development dependencies dev-setup: install diff --git a/pyproject.toml b/pyproject.toml index 61632bd..1378964 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,48 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "deb-mock" +version = "0.1.0" +description = "Debian's equivalent to Fedora's Mock build environment manager" +authors = [ + {name = "Debian Bootc Ecosystem Team", email = "debian-bootc@lists.debian.org"} +] +readme = "README.md" +requires-python = ">=3.9" +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Software Development :: Build Tools", + "Topic :: System :: Systems Administration", +] +dependencies = [ + "click>=8.0.0", + "pyyaml>=6.0", + "jinja2>=3.0.0", + "requests>=2.25.0", +] + +[project.optional-dependencies] +dev = [ + "black>=23.0.0", + "flake8>=6.0.0", + "mypy>=1.0.0", + "pytest>=7.0.0", + "pytest-cov>=4.0.0", + "pytest-mock>=3.10.0", +] + +[project.scripts] +deb-mock = "deb_mock.cli:main" + [tool.towncrier] # we post-process this file with releng/generate-release-notes filename = ".Release-Notes-Next.md"