From 87b806d1b994ffe20cbc45a2eb4737087498dcfa Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sun, 7 Dec 2025 22:29:58 +0100 Subject: [PATCH] feat: package config/ and defaults.yaml correctly for Nix & setuptools This commit fixes the missing `config/defaults.yaml` issue that caused `pkgmgr --help` to fail with exit code 5 inside Nix builds and during integration tests. Changes: - Added `config/__init__.py` to make the directory a proper Python package. - Updated `pyproject.toml` to rely on setuptools package discovery. - Extended `tool.setuptools.packages.find.include` to include both `pkgmgr*` and `config*`. - Added `tool.setuptools.package-data` so `defaults.yaml` is included in wheels, Nix builds, and PKGBUILD-derived installations. - Removed the conflicting `tool.setuptools.packages` declaration. This ensures that Nix's pypaBuildPhase can build the wheel successfully and that `pkgmgr --help` no longer crashes due to missing default config. Reference: https://chatgpt.com/share/6935f05f-03d8-800f-a126-b3114cc116ec --- config/__init__.py | 0 pyproject.toml | 13 +++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 config/__init__.py diff --git a/config/__init__.py b/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml index 29bef01..e6150d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,16 @@ dev = [ [project.scripts] pkgmgr = "pkgmgr.cli:main" -# Tell setuptools to find the pkgmgr package +# ----------------------------- +# setuptools configuration +# ----------------------------- +# We use find_packages(), not a fixed list, +# and explicitly include pkgmgr* and config* + [tool.setuptools.packages.find] where = ["."] -include = ["pkgmgr*"] +include = ["pkgmgr*", "config*"] + +# Ensure defaults.yaml is shipped inside wheels & nix builds +[tool.setuptools.package-data] +"config" = ["defaults.yaml"]