Opinionated Python template for new CLIs.
- Go to or create the CLI folder.
- Get the template files:
npx degit github:joaopalmeiro/template-python-clior
npx degit github:joaopalmeiro/template-python-cli --force- Search for
template-python-cliand replace it with the CLI name. Ignore the template repository URL in the NOTES.md file. - Search for
template_python_cliand 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 Palmeiroand replace it with the author's name. - Search for
[email protected]and replace it with the author's email address. - Open the pyproject.toml file and add the CLI-specific dependencies. See the
Dependency configurationandEnvironment configurationpages in the Hatch documentation for more information (if necessary). - Update the
Source codelink at the top to the CLI repository link (if necessary). - Change
GitHubin theDeploymentsection toGitLaborCodebergand update the link to the corresponding Tags page (if necessary). - Update the
IssuesandSourcefields 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 Startedsection.
Via pipx
pipx run template-python-cli --helppipx run template-python-cliInstall pyenv (if necessary).
pyenv install && pyenv versionspip install hatch==1.12.0 && hatch --versionhatch config set dirs.env.virtual .hatchhatch config showhatch env createhatch statushatch env showhatch dep show tablehatch run pip listhatch run template-python-cli --helphatch run template-python-clihatch run qa:linthatch run qa:formathatch project metadatahatch version microhatch version minorhatch version majorhatch build --cleanecho "v$(hatch version)" | pbcopy- Commit and push changes.
- Create a tag on GitHub Desktop.
- Check GitHub.
hatch publish- Check PyPI.