Files
pkgmgr/pyproject.toml
Kevin Veen-Birkenbach 87b806d1b9 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
2025-12-07 22:29:58 +01:00

52 lines
1.1 KiB
TOML

[build-system]
requires = [
"setuptools>=68",
"wheel"
]
build-backend = "setuptools.build_meta"
[project]
name = "package-manager"
version = "0.1.1"
description = "Kevin's package-manager tool (pkgmgr)"
readme = "README.md"
requires-python = ">=3.11"
license = { text = "MIT" }
authors = [
{ name = "Kevin Veen-Birkenbach", email = "info@veen.world" }
]
# Base runtime dependencies
dependencies = [
"PyYAML>=6.0"
]
[project.urls]
Homepage = "https://github.com/kevinveenbirkenbach/package-manager"
Source = "https://github.com/kevinveenbirkenbach/package-manager"
[project.optional-dependencies]
dev = [
"pytest",
"mypy"
]
# CLI entrypoint: this is the "pkgmgr" command
[project.scripts]
pkgmgr = "pkgmgr.cli:main"
# -----------------------------
# setuptools configuration
# -----------------------------
# We use find_packages(), not a fixed list,
# and explicitly include pkgmgr* and config*
[tool.setuptools.packages.find]
where = ["."]
include = ["pkgmgr*", "config*"]
# Ensure defaults.yaml is shipped inside wheels & nix builds
[tool.setuptools.package-data]
"config" = ["defaults.yaml"]