Skip to content

Migrate to hatch#30

Open
tobixen wants to merge 9 commits intomasterfrom
migrate-to-hatch
Open

Migrate to hatch#30
tobixen wants to merge 9 commits intomasterfrom
migrate-to-hatch

Conversation

@tobixen
Copy link
Member

@tobixen tobixen commented Mar 14, 2026

I think I don't like poetry

I'm piggybacking some other test/qa/ci/docs-stuff into the same pull request

tobixen and others added 9 commits March 14, 2026 13:37
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace poetry-core + poetry-dynamic-versioning build backend with
  hatchling + hatch-vcs
- Move dev dependencies from [tool.poetry.group.dev] to
  [project.optional-dependencies] dev group (install with pip install -e ".[dev]")
- Add [tool.hatch.build.hooks.vcs] to generate plann/_version.py at install time
- Set dynamic = ["version"] in [project] so hatch-vcs controls the version
- Remove poetry.lock (no lock file with hatch)
- Update CI workflows to use pip install -e ".[dev]" and python -m pytest/deptry
- Update Makefile dev/test/lint targets accordingly
- Add plann/_version.py to .gitignore (auto-generated, commit-specific)

This fixes the broken versioning: pip show plann now reports the correct
version from git tags instead of 0.0.0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without this, deptry flags all dev deps (pytest, ruff, xandikos, etc.)
as DEP002 (defined but unused), because it doesn't distinguish between
runtime and dev optional dependency groups by default.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Delete plann/metadata.py: hardcoded version dict was only used to set
  an unused __version__ in cli.py; version is now properly provided by
  hatch-vcs / importlib.metadata
- Remove the dead import and __version__ assignment from cli.py
- Fix lychee workflow: add explicit --config .lychee.toml so exclude
  patterns (example URLs, bedework.org) are actually applied
- Replace peter-evans/create-issue-from-file with gh CLI create-or-update
  logic so repeated runs update the existing issue rather than flooding
  with new ones; auto-close the issue when all links are healthy
- Add lychee cache step (actions/cache) for faster runs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Uses click.version_option(package_name="plann") which reads the version
from importlib.metadata at runtime, so it always reflects the installed
package version from git tags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- pre-commit: update ruff v0.8.4→v0.15.6, pre-commit-hooks v5→v6,
  lychee nightly→v0.23.0; add --config .lychee.toml to lychee hook;
  add no-push-to-master pre-push hook
- cli: add -V shorthand for --version
- pyproject.toml: add filterwarnings=error to pytest config
- Makefile: install target now auto-detects uv/pipx before falling
  back to pip --user
- Add CONTRIBUTING.md
- Remove setup.cfg (legacy tox config, superseded by pyproject.toml)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Enforce https://www.conventionalcommits.org/en/v1.0.0/ on commit messages.
Requires: pre-commit install --hook-type commit-msg

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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