Opinionated Python template for new CLIs.
- Go to or create the CLI folder.
- Get the template files:
npx degit github:joaopalmeiro/template-python-cli
or
npx degit github:joaopalmeiro/template-python-cli --force
- Search for
template-python-cli
and replace it with the CLI name. Ignore the template repository URL in the NOTES.md file. - Search for
template_python_cli
and replace it with the underscored version of the CLI name. - Search for
Opinionated Python template for new CLIs.
and replace it with the (short) CLI description. - Search for
João Palmeiro
and replace it with the author's name. - Search for
joaopalmeiro@proton.me
and replace it with the author's email address. - Open the pyproject.toml file and add the CLI-specific dependencies. See the
Dependency configuration
andEnvironment configuration
pages in the Hatch documentation for more information (if necessary). - Update the
Source code
link at the top to the CLI repository link (if necessary). - Change
GitHub
in theDeployment
section toGitLab
orCodeberg
and update the link to the corresponding Tags page (if necessary). - Update the
Issues
andSource
fields in the pyproject.toml file with their respective repository-related links (if necessary). - Remove
hatch-cli-demo/
from the .gitignore file. - Delete the TEMPLATE.md file.
- Delete the
Getting Started
section.
Via pipx
pipx run template-python-cli --help
pipx run template-python-cli
Install pyenv (if necessary).
pyenv install && pyenv versions
pip install hatch==1.12.0 && hatch --version
hatch config set dirs.env.virtual .hatch
hatch config show
hatch env create
hatch status
hatch env show
hatch dep show table
hatch run pip list
hatch run template-python-cli --help
hatch run template-python-cli
hatch run qa:lint
hatch run qa:format
hatch project metadata
hatch version micro
hatch version minor
hatch version major
hatch build --clean
echo "v$(hatch version)" | pbcopy
- Commit and push changes.
- Create a tag on GitHub Desktop.
- Check GitHub.
hatch publish
- Check PyPI.