- Pre-commit hooks
- mypy
- flake8
- mkdocs-material
- packaging
- Containerization
Install cookiecutter.
$ pip install --user cookiecutter
Generate your project template using cookiecutter.
$ cookiecutter gh:yankeexe/cookiecutter-python-cli
-
cd
into project directory. -
Create a virtual environment.
$ make venv
- Activate it.
$ source venv/bin/activate
- Install development dependencies with editable mode to test the CLI.
$ make install
This Cookiecutter comes with two generic CLI commands, namely, init
and show
.
NOTE
<<cli_command>>
is the executable command you choose for your CLI during project setup.
$ <<cli_command>> init
$ <<cli_command>> show
CLI commands can be tested with Docker.
-
Build an image for the CLI.
Image is tagged with the same name as the
cli_command
.
$ make docker-image
- Run the command inside the container.
$ docker-run --rm <<cli_command>> init
- Install documentation-related dependencies.
$ make docs
- Serve the docs locally.
$ make serve-docs
NOTE
Make sure you have account in PyPI before you try this out.
To publish you CLI to PyPI, run:
$ make distributions
dist
directory will be created inside your project directory. Upload it to PyPI using:
$ twine dist/*
For help related to make commands.
$ make help