Skip to content

release: rename PyPI distribution darnit -> darnit-core#260

Merged
mlieberman85 merged 2 commits into
kusari-oss:mainfrom
mlieberman85:release/rename-darnit-to-darnit-core
May 14, 2026
Merged

release: rename PyPI distribution darnit -> darnit-core#260
mlieberman85 merged 2 commits into
kusari-oss:mainfrom
mlieberman85:release/rename-darnit-to-darnit-core

Conversation

@mlieberman85
Copy link
Copy Markdown
Contributor

Summary

The bare `darnit` name on PyPI conflicts with a similarly-named existing project. Renames the PyPI distribution to `darnit-core` to avoid the conflict before reserving names for v0.1.0.

Deliberately scoped to ONLY the PyPI distribution name. Three identifiers exist independently:

Identifier Before After
PyPI distribution name `darnit` `darnit-core`
Python import name (`import darnit`, `packages/darnit/src/darnit/` on disk) `darnit` unchanged
CLI command name (`darnit audit ...`) `darnit` unchanged

Users still type `darnit audit` and write `import darnit` — the only visible change is `pip install darnit-core` instead of `pip install darnit`, and most users won't see that because they install `darnit-mcp` (the meta-package) which pulls the core in transitively.

What changed (15 files)

Distribution / dependency declarations

  • `packages/darnit/pyproject.toml` — `name` field
  • 6 dependents — `"darnit>=0.1.0"` → `"darnit-core>=0.1.0"` (baseline, gittuf, example, hello, plugins, testchecks)
  • `pyproject.toml` (root) — workspace mapping, dependency list, `attestation` extras dep
  • `packaging/pypi/public-packages.txt` — first line

Documentation

  • `scripts/generate_docs.py` — install hint
  • `docs/generated/USAGE_GUIDE.md` — regenerated from the script

Runtime metadata lookups

  • `packages/darnit/src/darnit/cli.py` — `importlib.metadata.version()` call updated, AND wrapped in a new `_resolve_version()` helper that falls back to `"dev"` if metadata isn't on the import path. This was a latent crash before; the pre-rename code only worked locally because of an unrelated stale install on the contributor's machine. Defensive handling is overdue.
  • `packages/darnit/src/darnit/core/verification.py` — sigstore install hint message

Test

  • `tests/darnit/core/test_verification.py::test_verify_darnit_core` — the test ironically named for the new package now verifies the new distribution name, with a docstring explaining the import vs distribution split.

Intentionally NOT changed (these are import names, not distribution names)

  • `pyproject.toml:110` — mypy `packages = ["darnit", ...]`
  • `pyproject.toml:161` — ruff `known-first-party = ["darnit", ...]`

Confirmed by their siblings (`darnit_baseline` with underscore = import name; distinct from `darnit-baseline` with hyphen = distribution name).

Test plan

  • `uv run ruff check .` — clean
  • `uv run pytest tests/ --ignore=tests/integration/ -q` — 2122 passed / 6 skipped / 0 failed
  • `uv run python scripts/validate_sync.py --verbose` — PASS
  • `uv run python scripts/generate_docs.py` — regenerated docs committed; no remaining diff
  • No bare `darnit` distribution-name references remain in any pyproject.toml file

Next step

After this merges, the v0.1.0 release prereqs become: reserve `darnit-core` (instead of `darnit`) on PyPI + TestPyPI as Trusted Publisher, then continue with the rest of the runbook in `packaging/README.md`.

🤖 Generated with Claude Code

mlieberman85 and others added 2 commits May 14, 2026 14:21
The bare `darnit` name on PyPI conflicts with a similarly-named
existing project. Renames the PyPI distribution to `darnit-core` to
avoid the conflict before reserving names for v0.1.0. The change is
deliberately scoped to ONLY the PyPI distribution name:

- Python import name stays `darnit` (packages/darnit/src/darnit/
  on disk, `import darnit.core.composition` in code) — unchanged
- CLI command stays `darnit` — `[project.scripts]` entry point in
  packages/darnit/pyproject.toml maps `darnit` to `darnit.cli:main`
- The four other public package names (`darnit-baseline`,
  `darnit-gittuf`, `darnit-mcp`) keep their slugs unchanged

Files touched:
- packages/darnit/pyproject.toml — name field
- 6 dependent packages' pyproject.toml — dep on `darnit>=0.1.0` ->
  `darnit-core>=0.1.0` (baseline, gittuf, example, hello, plugins,
  testchecks)
- pyproject.toml (root) — workspace mapping, dependency list, and
  the `attestation` extras dep. mypy `packages` and ruff
  `known-first-party` entries stay `darnit` because those refer to
  the IMPORT name, not the distribution name.
- packaging/pypi/public-packages.txt — first line
- scripts/generate_docs.py — `pip install darnit darnit-baseline`
  -> `pip install darnit-core darnit-baseline`
- docs/generated/USAGE_GUIDE.md — auto-regenerated from the script
- packages/darnit/src/darnit/cli.py — `importlib.metadata.version()`
  lookup updated to `darnit-core`. ALSO: wrapped the lookup in a new
  `_resolve_version()` helper that falls back to "dev" when metadata
  isn't on the import path (e.g., running from a source checkout
  with no editable install, or when a stale binary outside the
  workspace venv is invoked). This was a latent crash before — the
  pre-rename code only worked locally because of an unrelated stale
  install.
- packages/darnit/src/darnit/core/verification.py — sigstore
  install hint message
- tests/darnit/core/test_verification.py::test_verify_darnit_core —
  the test ironically named for the new package now verifies the
  new distribution name, with a docstring explaining the import vs
  distribution split.

Verification:
- ruff check: clean
- full suite: 2122 passed / 6 skipped / 0 failed
- validate_sync.py: PASS

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The initial rename commit missed four workflow files that hardcoded
the old `darnit` PyPI distribution name. CI's Build job failed on
kusari-oss#260 with `error: Package darnit not found in workspace`.

Workflows updated:
- ci.yml: `uv build --package darnit` -> `--package darnit-core`
- publish.yml: same build step + the `publish-darnit` job is now
  `publish-darnit-core` (job name, step name, downstream `needs:`)
- release.yml: the orchestrator's `publish-darnit` job renamed to
  `publish-darnit-core`, including the per-job `packages-dir`
  (`dist/darnit/` -> `dist/darnit-core/`), three downstream `needs:`
  references in publish-darnit-baseline / publish-darnit-gittuf /
  finalize, and the PYPI_DARNIT env-var sourcing for finalize's
  result aggregation. Updated the comment block explaining the
  publish sequencing to reference `darnit-core>=...` deps. The
  per-package build loop (line 222-228) already reads from
  packaging/pypi/public-packages.txt and picks up darnit-core
  automatically — no change needed.
- release-smoke.yml: the per-package smoke `case` arm `"darnit")`
  is now `"darnit-core")` (the renamed package's smoke). Updated
  the darnit-mcp comment to mention `darnit-core` dependency.

User-facing names that intentionally stay `darnit` (separate
identifiers from the PyPI distribution):
- Container image: `ghcr.io/.../darnit`
- Binary asset filenames: `darnit-${VERSION}-${OS}-${ARCH}`
- Homebrew formula: `brew install kusari-oss/tap/darnit`
- Claude Code plugin zip: `darnit-claude-plugin-${VERSION}.zip`
- The CLI command itself: `darnit --version`
- Python import: `import darnit`

actionlint v1.7.12: clean. Same suite (2122 pass) still applies.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mlieberman85 mlieberman85 merged commit e3458e4 into kusari-oss:main May 14, 2026
10 checks passed
@mlieberman85 mlieberman85 deleted the release/rename-darnit-to-darnit-core branch May 14, 2026 20:28
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