Skip to content

fix(ci): explicit setuptools packages + SPDX license#1

Merged
mbachaud merged 1 commit into
masterfrom
fix/ci-pyproject-packages
May 11, 2026
Merged

fix(ci): explicit setuptools packages + SPDX license#1
mbachaud merged 1 commit into
masterfrom
fix/ci-pyproject-packages

Conversation

@mbachaud
Copy link
Copy Markdown
Owner

Summary

Every CI run since v0.1.0 has been red on pip install -e ".[dev]". Root cause: setuptools flat-layout auto-discovery sees lib/, hooks/, agents/, skills/, scaffold/, commands/ at the repo root and refuses to build with Multiple top-level packages discovered in a flat-layout. Also a deprecation warning about project.license as a TOML table.

Fix

pyproject.toml:

  • [tool.setuptools.packages.find] with include = ["lib*"] — only lib is real Python code. Other top-level dirs are Claude Code plugin data (hooks.json, skill markdown, agent markdown, scaffold templates) read directly from disk by the plugin loader.
  • license = "Apache-2.0" SPDX string + license-files = ["LICENSE"] (PEP 639) — replaces the deprecated TOML-table form.
  • Pinned setuptools>=77.0.0 for PEP 639 support.

Local verification

  • pip install -e ".[dev]" succeeds on this branch.
  • 92 pytest tests pass.
  • ruff check . clean.

Code review

Independent review (feature-dev:code-reviewer subagent) approved: subpackage discovery is complete (lib, lib.compliance_templates, lib.drift_scoring), SPDX license-files change is safe at the pinned setuptools version, no silent breakage paths in the current feature set. Forward-looking note: if non-Python assets are added under lib/ later (yaml templates, etc.), they'll need a [tool.setuptools.package-data] stanza to ship in wheels.

Test plan

  • Local pip install -e ".[dev]" succeeds
  • Local pytest -q — 92/92 passing
  • Local ruff check . clean
  • CI green on ubuntu-latest × py3.11
  • CI green on ubuntu-latest × py3.12
  • CI green on windows-latest × py3.11
  • CI green on windows-latest × py3.12

🤖 Generated with Claude Code

CI failed across all 4 matrix legs (ubuntu/windows × py3.11/3.12) at the
`pip install -e .[dev]` step.

Root cause: setuptools flat-layout auto-discovery saw lib/, hooks/, agents/,
skills/, scaffold/, commands/ as top-level packages and refused to build with
'Multiple top-level packages discovered'.

Fix:
- Restrict packages to lib* via [tool.setuptools.packages.find]
- hooks/agents/skills/scaffold/commands are plugin data, not Python packages
- Switch license from deprecated TOML table to SPDX string + license-files
- Pin setuptools>=77.0.0 for SPDX support

Verified locally: 'pip install -e .[dev]' succeeds, 92 tests pass, ruff clean.
@mbachaud mbachaud merged commit 6985a79 into master May 11, 2026
4 checks passed
@mbachaud mbachaud deleted the fix/ci-pyproject-packages branch May 11, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant