From 87c0236b7ad7c4738b6812eb30752e66b404c7c2 Mon Sep 17 00:00:00 2001 From: "Caleb St. John" <30729806+yocalebo@users.noreply.github.com> Date: Tue, 23 Sep 2025 10:36:55 -0400 Subject: [PATCH] NAS-137581 / 26.04 / fix building on trixie (#929) * fix building on trixie * fix inconsistencies in pyproject.toml * fix manifest.yml * remove hard-coded debian version from readme --- .github/workflows/manifest.yml | 6 +++--- MANIFEST.in | 4 ++++ Makefile | 2 +- README.md | 5 ++++- pyproject.toml | 27 +++++++++++++++++++++++++++ setup.cfg | 4 ++++ setup.py | 24 ------------------------ 7 files changed, 43 insertions(+), 29 deletions(-) create mode 100644 MANIFEST.in create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.github/workflows/manifest.yml b/.github/workflows/manifest.yml index afbb13d..9598e98 100644 --- a/.github/workflows/manifest.yml +++ b/.github/workflows/manifest.yml @@ -8,11 +8,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python 3.10 + - uses: actions/checkout@v4 + - name: Set up Python 3.13 uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.13' - name: Validating manifest run: | python -m pip install --upgrade pip diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..499b81b --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,4 @@ +include scripts/parse_deps.pl +include README.md +include LICENSE +include requirements.txt \ No newline at end of file diff --git a/Makefile b/Makefile index 022e89a..4e8d096 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ ifneq ($(REPO_CHANGED),0) @${PYTHON} -m venv venv-${COMMIT_HASH} || { echo "Failed to create virutal environment"; exit 1; } @{ . ./venv-${COMMIT_HASH}/bin/activate && \ python3 -m pip install -r requirements.txt >/dev/null 2>&1 && \ - python3 setup.py install >/dev/null 2>&1; } || { echo "Failed to install scale-build"; exit 1; } + python3 -m pip install . >/dev/null 2>&1; } || { echo "Failed to install scale-build"; exit 1; } endif all: checkout packages update iso diff --git a/README.md b/README.md index 7b80d02..6040d78 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ Found an issue in the build for SCALE? Please report it on our [Jira bugtracker] ## Requirements - - Debian 10 or later (VM or Bare-Metal) + - Supported version of Debian + - Python 3.11 or later - 20GB of RAM - At least 15GB of free disk space @@ -33,6 +34,8 @@ In addition to the host, you will want to pre-install the following packages: ## Usage +The build system automatically manages a Python virtual environment to ensure build consistency. It detects changes in the git repository hash and automatically recreates the virtual environment when needed, ensuring that the build tools are always in sync with the current codebase. + After the pre-requistes are installed, simply run "make" (as root or sudo) to perform a complete build which performs the following steps: ``` make checkout ``` diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2899897 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,27 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "scale_build" +description = "A build framework for TrueNAS SCALE" +readme = "README.md" +license = {text = "GPL-3.0"} +requires-python = ">=3.11" +dynamic = ["version"] +dependencies = [ + "coloredlogs", + "toposort", + "requests", + "pyyaml", +] + +[project.scripts] +scale_build = "scale_build.main:main" + +[tool.setuptools.packages.find] +where = ["."] +include = ["scale_build*", "truenas_install*"] + +[tool.setuptools] +include-package-data = true diff --git a/setup.cfg b/setup.cfg index aa079ec..824de4b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,6 @@ [flake8] max-line-length=120 + +[options] +scripts = + scripts/parse_deps.pl \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 4a0dd09..0000000 --- a/setup.py +++ /dev/null @@ -1,24 +0,0 @@ -from setuptools import find_packages, setup - -setup( - name='scale_build', - description='A build framework for TrueNAS SCALE', - packages=find_packages(), - include_package_data=True, - license='BSD', - platforms='any', - install_requires=[ - 'coloredlogs', - 'toposort', - 'requests', - 'pyyaml' - ], - entry_points={ - 'console_scripts': [ - 'scale_build = scale_build.main:main', - ], - }, - scripts=[ - 'scripts/parse_deps.pl', - ] -)