Publish to PyPI via trusted publishing; the scaffold ships inside the package - #12
Merged
Conversation
… package The pre-publish check found a wheel that passed its smoke test for the wrong reason: setuptools' parent-relative package data landed template/ at the WHEEL ROOT — a bare unnamespaced directory installed straight into site-packages, found by luria init only because parent.parent from inside site-packages happens to BE site-packages. Functional, and one neighbouring package's template/ away from a file fight. Fixed with hatchling force-include: the wheel carries luria/template/, the repo keeps template/ at the top level where a visitor browses it (ADR-021), and init._template_dir() tries the packaged location first with the checkout as fallback. publish.yml: build and publish as separate jobs — the artifact that ships is byte-identical to the one tested — with the publish job in the `pypi` environment holding id-token: write and nothing else. Trusted publishing means the credential is an identity, not a secret. Fires on GitHub release + workflow_dispatch. The release gate is a cold-install smoke test: pip install the built wheel into a fresh venv, then init → index → journal new → lint in an empty directory — the only configuration that exercises the packaged template path, since a checkout always has the fallback. Run by hand first, it caught the scaffolded CLAUDE.md's illustrative wikilinks leaking as day-one warnings; the examples now use codes whose resolution status is identical in both contexts (ADR-777 annotated, DP-3 and LU-DP-9 resolving everywhere), so a fresh project lints with zero warnings. Also: real PyPI metadata (classifiers, URLs, keywords), README says pip install luria, sdist carries build inputs not the record. ADR-027 records the decision. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014H7APrKgWA23SVZMNF8H86
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The publishing half of #3, matched to the trusted publisher you registered (
publish.yml,pypienvironment). Recorded as ADR-027.The bug the pre-publish check found
The existing packaging worked by accident. Setuptools' parent-relative package data (
luria = ["../template/**/*"]) landedtemplate/at the wheel root — a bare, unnamespaced directory installed straight intosite-packages, where it would collide with any other package shipping one.luria initfound it only becausePath(__file__).parent.parentfrom inside site-packages happens to be site-packages. Green smoke test, collision-prone packaging.Fix: hatchling
force-includemaps top-leveltemplate/→luria/template/in the wheel. The repo keepstemplate/at the top level where a visitor browses it (ADR-021); the install keeps to its namespace;init._template_dir()tries the packaged location first, checkout fallback second. Verified: nothing outsideluria/in the wheel;site-packagescontains onlyluriaand deps.The workflow
pypienvironment gate covers the smallest surface, withid-token: writeand nothing else. No token to leak, rotate, or forget.workflow_dispatchas escape hatch.pip install dist/*.whlinto a fresh venv, theninit → index → journal new → index → lintin an empty directory. This is the only configuration that exercises the packaged-template path — a checkout always has the fallback, so the dogfooding repo structurally can't catch this class.Run by hand before writing the workflow, the smoke test immediately caught the scaffolded CLAUDE.md's illustrative wikilinks (
[[ADR-013]],[[SG-DP-18]]) leaking as day-one dangling-code warnings in a fresh project — third instance of the example-leak pattern. The examples now use codes whose resolution status is identical in both contexts (ADR-777annotated everywhere,DP-3andLU-DP-9resolving everywhere), so a fresh project lints with zero warnings and the annotation is never stale in this repo.Also
pip install luria.pip downloadwould be segregate meta-project memory #3's deadweight relocated.Verification
twine checkpasses; wheel contains 16 template files underluria/template/, nothing outsideluria/.luria lintclean.After merge
Cut a GitHub release (v0.1.0, matching
pyproject.toml) andpublish.ymltakes it from there. I can draft the release once this merges — say the word.Generated by Claude Code