Pull requests are welcome! By participating in this project, you agree to abide by our code of conduct.
Fork and then clone the repository:
# replace <USER> with your username
git clone git@github.com:<USER>/python-cli-template.gitcd python-cli-templateInstall uv:
brew install uvInstall development dependencies:
uv sync --all-extrasInstall pre-commit into your git hooks:
uv run pre-commit installMake your changes, add tests/documentation, and ensure tests pass.
Write a commit message that follows the Conventional Commits specification:
- feat: A new feature
- fix: A bug fix
- perf: A code change that improves performance
- refactor: A code change that neither fixes a bug nor adds a feature
- test: Add missing tests or correct existing tests
- build: Changes that affect the build system or external dependencies
- ci: Updates configuration files and scripts for continuous integration
- docs: Documentation only changes
Push to your fork and create a pull request.
At this point, wait for us to review your pull request. We'll try to review pull requests within 1-3 business days. We may suggest changes, improvements, and/or alternatives.
Things that will improve the chance that your pull request will be accepted:
- Write tests that pass CI.
- Write solid documentation.
- Write a good commit message.
Install test dependencies:
uv sync --extra testRun the tests:
uv run pytestRun the tests with coverage:
uv run coverage run -m pytestGenerate a coverage report:
uv run coverage reportuv run coverage htmlInstall the package with uv:
uv tool install . --forceTest the command:
python-cli-template --helpInstall lint dependencies:
uv sync --extra lintUpdate pre-commit hooks to the latest version:
uv run pre-commit autoupdateRun all pre-commit hooks:
uv run pre-commit run --all-filesLint all files:
uv run ruff check # --fixFormat all files:
uv run ruff formatRun type checking:
uv run mypy .Run the CLI:
uv run python-cli-templateInstall build dependencies:
uv sync --extra buildGenerate the distribution packages:
uv buildUpload all of the archives under dist:
uv publish --repository testpypiInstall the package:
uv tool install --index-url testpypi python-cli-templateBundle the package with PyInstaller:
uv run pyinstaller python_cli_template.cli --name python-cli-templateInstall docs dependencies:
uv sync --extra docsGenerate the docs with pdoc:
uv run pdoc src/python_cli_template/Release and publish are automated with Release Please.