Thank you for your interest in contributing! This document covers development, testing, and release procedures.
# Clone and enter the repository
git clone https://github.com/elifarley/command-mock.git
cd command-mock
# Install dev dependencies
make installRun tests with coverage:
make testRun tests without coverage (faster):
make quickRun a specific test:
make test-case K=test_exact_matchFormat code:
make format # Auto-fix formatting
make check-format # Check without modifyingRun linting & type checks:
make lintRun full CI pipeline locally:
make ci # check-format → lint → testClean build artifacts:
make clean # Remove __pycache__, .pytest_cache, build/, dist/
make distclean # Also remove .venv, .mypy_cache, .ruff_cacheFor all available targets, run:
make help-
Create a branch for your feature or fix:
git checkout -b feature/my-feature
-
Make your changes and test locally:
make ci # Ensure everything passes -
Commit with a clear message:
git commit -m "Add feature X: Brief description" -
Push and open a pull request on GitHub.
Ensure all changes are committed and pushed to main:
git add .
git commit -m "Your changes here"
git push origin mainGitHub Actions will run the test suite automatically on your commits.
Use semantic versioning without the v prefix:
# Create an annotated tag
git tag 0.1.3 -m "Release 0.1.3: Description of changes"
# Push the tag to GitHub
git push origin 0.1.3Examples of valid tags:
0.1.0- Patch release0.2.0- Minor release1.0.0- Major release1.0.0-rc1- Release candidate
When you push a tag, GitHub Actions automatically:
- Triggers
.github/workflows/release.yml - Runs pre-release checks on Python 3.12 & 3.13
- Builds distribution (wheel + sdist)
setuptools_scmauto-injects the version from the git tag
- Publishes to PyPI using Trusted Publishing (OIDC)
- Creates a GitHub Release with auto-generated notes and artifacts
After 1-2 minutes, verify:
- GitHub Actions: https://github.com/elifarley/command-mock/actions
- Release workflow should show ✅ success
- PyPI: https://pypi.org/project/orgecc-command-mock/
- New version should be visible
- GitHub Releases: https://github.com/elifarley/command-mock/releases
- Release entry with auto-generated notes should appear
Check the GitHub Actions log for details. Fix the failing tests and re-tag:
# Delete the failed tag
git tag -d 0.1.3
git push origin :refs/tags/0.1.3
# Fix the code
# ... make changes, commit, push ...
# Re-tag and try again
git tag 0.1.3 -m "Release 0.1.3: Fixed tests"
git push origin 0.1.3If you see an error about "invalid-publisher", Trusted Publishing needs to be set up on PyPI:
- Go to https://pypi.org/project/orgecc-command-mock/
- Navigate to Project settings → Publishing
- Add GitHub as a trusted publisher:
- Repository name: elifarley/command-mock
- Environment name: pypi
- Workflow name: release.yml
If you need to modify and re-release the same version number:
# Delete the tag locally and remotely
git tag -d 0.1.3
git push origin :refs/tags/0.1.3
# Make your changes, commit, and push
git add .
git commit -m "Fix for 0.1.3"
git push origin main
# Re-create and push the tag
git tag 0.1.3 -m "Release 0.1.3: Updated"
git push origin 0.1.3- See CLAUDE.md for architecture details and core components
- See README.md for user-facing documentation
- Core modules:
src/command_mock/recorder.py,src/command_mock/player.py - Tests:
tests/test_core.py, fixtures intests/conftest.py - Mock data stored in:
tests/mocks/<command_type>/
Open an issue on GitHub or check the README.md and CLAUDE.md for more information.