Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## Summary

_Describe the change and the user-facing or developer-facing impact._

## Related Issues

Closes #(issue number) or Relates to #(issue number)

## What Changed

- _Summarize the code, tests, docs, or tooling changes._
- _Call out any API, CLI, or behavior changes explicitly._

## Type of Change

- **Bugfix**: Fix an existing feature
- **Feature**: Introduces new functionality without breaking changes
- **Enhancement**: Improves existing functionality
- **Breaking Change**: Introduces breaking changes that require migration
- **Refactoring**: Code restructuring without behavioral changes
- **Build/Infrastructure**: Build system, CI/CD, dependencies, Docker
- **Documentation**: Documentation, comments, or changelog updates

## Validation

- `./tools/lint.sh --changed`
- `./tools/test.sh -q`
- `./tools/docs.sh` (if docs or public API changed)
- `python -m build` (if packaging or release files changed)
- Manual testing described below when automated coverage is not enough

## Breaking Changes

_Describe any migration, compatibility, or deprecation impact. Write `None` if not applicable._

## Notes for Reviewers

_Call out anything that deserves extra attention: edge cases, tradeoffs, follow-up work, or known limitations._

## Checklist

- Code follows project style guidelines
- Self-review completed
- Comments added for complex logic
- No breaking changes without documentation
- Commit messages follow semantic convention: `{type}({scope}): {message}`
30 changes: 20 additions & 10 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,43 @@ name: cmdcraft unit testing

on:
push:
branches: [master]
branches:
- master
- v*-rc
pull_request:
branches: [master, v*-rc]
workflow_dispatch:

jobs:
test:
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install Dependencies
cache: pip

- name: Install dependencies
run: |
sudo apt remove python3-pip
python -m pip install --upgrade pip
python -m pip install . ruff coverage pytest readme_renderer
- name: Analysis
run: ./tools/analyse.sh
pip install -e '.[dev]'

- name: Lint
run: ./tools/lint.sh --changed

- name: Tests
run: ./tools/test.sh

- name: Validate README.rst
run: python -m readme_renderer README.rst
run: python -m readme_renderer.rst README.rst > /dev/null
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Python
.venv/
*__pycache__*
**/.pyc
tmp/
docs/build/
*.egg
*.egg-info
dist
build
build/
_build/
docs/html/
eggs
19 changes: 19 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2
build:
os: ubuntu-24.04
tools:
python: "3.12"

sphinx:
configuration: docs/conf.py

python:
install:
- method: pip
path: .
extra_requirements:
- docs

formats:
- epub
- pdf
15 changes: 12 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
cmdcraft
========

.. image:: https://github.com/weinsen/cmdcraft/actions/workflows/unit_tests.yml/badge.svg?branch=master
:target: https://github.com/weinsen/cmdcraft/actions/workflows/unit_tests.yml

``cmdcraft`` is a library that aims to build fast and stable
interative devtools. It that native Python metadata from objects to build prompt
interactive devtools. It uses native Python metadata from objects to build prompt
commands, so you don't have to manually configure input options.

.. image:: docs/source/images/example.gif
.. image:: docs/images/example.gif

Comment on lines 10 to 12
Features
--------
Expand All @@ -18,7 +21,13 @@ Features
Contributing
============

Contributions are welcome! Please start by reading the `Contributing Guidelines <CONTRIBUING.rst>`_ file.
Contributions are welcome! Please start by reading the `Contributing Guidelines <docs/pages/contributing.rst>`_ file.

License
=======

This project is licensed under the BSD-style license found in the LICENSE file in the
root directory of this source tree.

Special thanks
==============
Expand Down
27 changes: 10 additions & 17 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
# Minimal makefile for Sphinx documentation
#
PYTHON ?= python
SPHINXBUILD = $(PYTHON) -m sphinx
SPHINXAPIDOC = $(PYTHON) -m sphinx.ext.apidoc
SOURCEDIR = .
BUILDDIR = _build

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
.PHONY: apidoc html

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
apidoc:
$(SPHINXAPIDOC) -f -e -o _generated ../src/cmdcraft

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
html:
$(SPHINXBUILD) -b html "$(SOURCEDIR)" "$(BUILDDIR)/html"
37 changes: 37 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""Sphinx configuration for the cmdcraft documentation."""

project = "cmdcraft"
copyright = "2026, A. M. Weinsen Jr"
author = "A. M. Weinsen Jr"
release = "0.0.7"

extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_autodoc_typehints",
]

autodoc_default_options = {
"members": True,
"undoc-members": False,
"private-members": False,
"show-inheritance": True,
"inherited-members": True,
}

autodoc_typehints = "description"
napoleon_google_docstring = True
autosummary_generate = True
autosummary_imported_members = False

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
html_title = f"{project} {release} documentation"

# Explicit root doc (Sphinx defaults to 'index' but be explicit).
root_doc = "index"
File renamed without changes
24 changes: 24 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Welcome to cmdcraft documentation!
==================================

``cmdcraft`` is a library that aims to build fast and stable
interactive devtools. It uses native Python metadata from objects to build prompt
commands, so you don't have to manually configure input options.

Table of Contents
-----------------

.. toctree::
:maxdepth: 2
:caption: Contents:

pages/intro/index
pages/howto/crafting
pages/contributing
pages/changelog
pages/documentation

Special thanks
==============

- `Python Prompt Toolkit <https://github.com/prompt-toolkit/python-prompt-toolkit>`_: Awesome prompt utility.
35 changes: 0 additions & 35 deletions docs/make.bat

This file was deleted.

12 changes: 10 additions & 2 deletions CHANGELOG.rst → docs/pages/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
=========

v0.0.7
----------

- Move packaging metadata into ``pyproject.toml`` and remove ``setup.py`` plus ``requirements.txt``.
- Add shared tooling helpers and dedicated ``lint`` / ``test`` scripts that honor the repository virtual environment and base ref.
- Expand GitHub Actions coverage to Python 3.13, release-candidate branches, editable installs, and draft PR handling.
- Reorganize the Sphinx docs for Read the Docs, add API documentation pages, and document the updated contributor workflow.

v0.0.6
------

Expand Down Expand Up @@ -28,7 +36,7 @@ v0.0.4
- Improve linting

Fixed issues:
******
*************
#2: Exception while typing quoted arguments

v0.0.3
Expand All @@ -40,7 +48,7 @@ v0.0.3
v0.0.2

Fixed issues:
******
*************
#1: Input mishandling options

- Input handling
Expand Down
8 changes: 7 additions & 1 deletion CONTRIBUING.rst → docs/pages/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,10 @@ we ask to start the brief message with one of these tags:
- `infra`: The commit contains changes to the project infrastructure

Also, if the commit is related to a specific tracked issue, please insert its number
preceded by #.
preceded by #.

Local checks
============

Use ``./tools/lint.sh --changed`` to lint only the Python files changed on your branch,
or ``./tools/lint.sh --all`` for a full-repository Ruff check plus formatting validation.
20 changes: 20 additions & 0 deletions docs/pages/documentation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Documentation
=============

BasePrompter
------------

.. automodule:: cmdcraft.base
:members:

Prompter
--------

.. automodule:: cmdcraft.prompter
:members:

Command
-------

.. automodule:: cmdcraft.command
:members:
File renamed without changes.
File renamed without changes.
27 changes: 0 additions & 27 deletions docs/source/conf.py

This file was deleted.

Loading
Loading