How mtkennerly/dunamai works
Project type and purpose
• Dunamai is a Python-based library and command-line tool (CLI) whose sole concern is to generate dynamic, VCS-derived version strings.
• It’s not a web or full-stack application but an open-source, reusable tool focused on version discovery via Git, Mercurial, Darcs, Subversion, Bazaar, Fossil, and Pijul.
• The README emphasizes both a programmatic API (Version.from_* calls) and a user-facing CLI (dunamai from …, dunamai check …), plus optional CI and build-system integrations (GitHub Action, Poetry plugin, setuptools).
File structure
• Top level
• Configuration & CI: .github/, .flake8, pyproject.toml, tasks.py, mkdocs.yaml, workflows, and docs.
• Core code: dunamai/ package with __main__.py, __init__.py, py.typed.
• Documentation: docs/ plus README.md, CHANGELOG.md, CONTRIBUTING.md.
• Tests: tests/unit/, tests/integration/, tests/archival/ (archived‐repo fixtures).
• Patterns
• A clear separation of concerns: CLI entrypoint vs. library API vs. VCS adapters vs. formatting logic.
• No web server or persistence beyond reading the local repo or archival files.
README for additional insights
• Architecture is implied, not drawn:
• A version‐detection core that “auto-detects” or selects a VCS backend.
• Adapters for multiple VCSs, each encapsulating how to read tags, commits, metadata.
• A Version class with discrete parts and a serialize() engine that applies PEP 440, SemVer, Haskell PVP, or custom formats.
• Integration hooks (setup.py, Poetry, environment variables) and a GitHub Action.