Skip to content

chore: prepare package for PyPI publication as "useprimer"#222

Merged
ccf merged 2 commits intomainfrom
chore/pypi-ready
Apr 25, 2026
Merged

chore: prepare package for PyPI publication as "useprimer"#222
ccf merged 2 commits intomainfrom
chore/pypi-ready

Conversation

@ccf
Copy link
Copy Markdown
Owner

@ccf ccf commented Apr 24, 2026

Summary

The PyPI name primer is already taken by a 2015 prime-numbers library, so this PR preps the package to publish as useprimer — matching the domain. The Python module stays primer (same pattern as PyYAMLyaml), so import primer and the primer CLI entry point are unchanged.

Once published, the PyPI project page surfaces the six [project.urls] entries as inbound links from pypi.org — a very high-trust domain. That's the SEO signal we need to help accelerate Google indexing of useprimer.dev (on top of the developer-distribution benefit).

pyproject.toml

  • Rename [project] name"useprimer"
  • Add readme, license, authors, maintainers, keywords, classifiers
  • Add [project.urls] → Homepage, Documentation, Repository, Issues, Changelog, Live Demo
  • Add [tool.hatch.build.targets.wheel] packages = ["src/primer"] so hatch finds the module under the new project name
  • Add [tool.hatch.build.targets.sdist] include = [...] for a proper sdist

README.md

  • Update install command: pip install primerpip install useprimer (with note that the Python module is still primer)

PUBLISHING.md (new)

  • Token setup (PyPI + TestPyPI)
  • Release workflow (build → twine check → TestPyPI rehearsal → PyPI upload → tag/push)
  • Verification steps

Test plan

  • python -m build produces useprimer-0.2.0-py3-none-any.whl
  • Wheel contents include primer/ module + primer/_alembic/ migrations
  • METADATA file contains all 6 Project-URL entries
  • python -c "import primer; print(primer.__name__)"primer
  • pytest tests/test_hook_installer.py tests/test_hook_session_end.py → 43 passed

Follow-up (not in this PR)

Actually publishing requires a PyPI account + API token (documented in PUBLISHING.md). The first upload from a clean account will also need to go through TestPyPI first to verify the rendered project page looks right before committing the public name.

🤖 Generated with Claude Code


Note

Low Risk
Mostly packaging/metadata changes for PyPI plus docs; runtime behavior should be unchanged, with the main risk being a misconfigured build that omits modules/migrations or breaks version reporting.

Overview
Prepares the project for PyPI publication under the new distribution name useprimer while keeping the import/CLI name primer.

Updates pyproject.toml with the new project name, richer package metadata and project.urls, and Hatch build config to explicitly include src/primer plus sdist contents. The CLI’s --version lookup is switched to package_name="useprimer", and the README/install docs are updated accordingly, with a new PUBLISHING.md documenting the release workflow.

Reviewed by Cursor Bugbot for commit 9ce8da9. Bugbot is set up for automated code reviews on this repo. Configure here.

ccf and others added 2 commits April 24, 2026 07:23
The PyPI name "primer" is already taken by a prime-numbers library,
so the PyPI project becomes "useprimer" — matching the domain exactly.
The Python module stays `primer` (same pattern as PyYAML → `yaml`),
so imports and the `primer` CLI entry point are unchanged.

pyproject.toml:
- Rename [project] name → "useprimer"
- Add readme, license, authors, maintainers, keywords, classifiers
- Add [project.urls] for Homepage, Documentation, Repository,
  Issues, Changelog, and Live Demo — these surface as inbound
  links on the PyPI project page (SEO signal from a high-trust
  domain, which should help accelerate Google indexing of
  useprimer.dev)
- Add [tool.hatch.build.targets.wheel] packages so hatch picks up
  src/primer/ under the new project name
- Add [tool.hatch.build.targets.sdist] include list

README.md:
- Update install command from `pip install primer` to
  `pip install useprimer` with a note that the Python module is
  still `primer`

PUBLISHING.md:
- New doc covering token setup, TestPyPI rehearsal, full release
  workflow, and tag/push steps

Verified: `python -m build` produces useprimer-0.2.0-py3-none-any.whl
with all Project-URL entries intact; `import primer` still works from
the built wheel.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…tion

Click's version_option uses importlib.metadata to look up the installed
distribution. The Python module is still `primer` but the PyPI package
is now `useprimer`, so click was raising:

  RuntimeError: 'primer' is not installed. Try passing 'package_name'
  instead.

Update the explicit package_name so --version resolves against the
correct distribution. Fixes the test_version CI failure.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ccf ccf merged commit 3eb3ae2 into main Apr 25, 2026
6 checks passed
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