Python CLI app template project featuring the modern and extensible Python project manager hatch.
Project description
python-cli-app-template
Boilerplate for Python CLI utility project.
Features
- Uses Hatch - modern PEP-compliant project manager
- Uses Typer framework for managing CLI commands
- Uses Dynaconf for flexible management of configurations
Usage
pca --help
Development
To set up hatch and pre-commit for the first time:
- install hatch globally, e.g. with pipx or brew, i.e.
pipx install hatch
, - make sure pre-commit is installed globally, e.g. with
pipx install pre-commit
.
A special feature that makes hatch very different from other familiar tools is that you almost never
activate, or enter, an environment. Instead, you use hatch run env_name:command
and the default
environment
is assumed for a command if there is no colon found. Thus you must always define your environment in a declarative
way and hatch makes sure that the environment reflects your declaration by updating it whenever you issue
a hatch run ...
. This helps with reproducability and avoids forgetting to specify dependencies since the
hatch workflow is to specify everything directly in pyproject.toml. Only in rare cases, you
will use hatch shell
to enter the default
environment, which is similar to what you may know from other tools.
To get you started, use hatch run test:cov
or hatch run test:no-cov
to run the unitest with or without coverage reports,
respectively. Use hatch run lint:all
to run all kinds of typing and linting checks. Try to automatically fix linting
problems with hatch run lint:fix
and use hatch run docs:serve
to build and serve your documentation.
You can also easily define your own environments and commands. Check out the environment setup of hatch
in pyproject.toml for more commands as well as the package, build and tool configuration.
The environments defined by hatch are configured to generate lock files using hatch-pip-compile under locks
.
To upgrade all packages in an environment like test
, just run hatch run test:upgrade-all
. To upgrade specific
packages, type hatch run test:upgrade-pkg pkg1,pkg2
.
Credits
This package was created with The Hatchlor project template.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file python_cli_app_template-0.3.0.tar.gz
.
File metadata
- Download URL: python_cli_app_template-0.3.0.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e16ed5db2e30998a60128f97552f2fc79c597a7dba5538bf4f14384524d764f0 |
|
MD5 | 00322888dc25b6847cc08158a4b06acd |
|
BLAKE2b-256 | fb074350c3c528b2bfcce31c362a19e73c5a36a7207e131fa6c9eb3757412ec4 |
File details
Details for the file python_cli_app_template-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: python_cli_app_template-0.3.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19eb319926cb53bddf3e6232647325fda0136860630b80722bbbf0859247cbe1 |
|
MD5 | 0701b6cdacd84bb3b55ce3902cc0a829 |
|
BLAKE2b-256 | 6176205e182f8181bd45e08431e62446402ac03a057eb3166a419a2d4f304b5d |